This commit is contained in:
18401019693
2022-07-26 17:40:57 +08:00
parent 202c265e71
commit 021429a60d
4 changed files with 64 additions and 14 deletions

View File

@@ -8,6 +8,39 @@ import com.google.gson.annotations.SerializedName;
public class NoviceInstructorModel extends BaseModel {
@SerializedName("sendFirstMessage")
private String sendFirstMessage = "";
@SerializedName("msg_zdy_send")
private String msgZdySend = "";
@SerializedName("msg_zdy_send_text")
private String msgZdySendText = "";
@SerializedName("home_zdy_pop")
private String homeZdyPop = "";
public String getMsgZdySend() {
return msgZdySend;
}
public NoviceInstructorModel setMsgZdySend(String msgZdySend) {
this.msgZdySend = msgZdySend;
return this;
}
public String getMsgZdySendText() {
return msgZdySendText;
}
public NoviceInstructorModel setMsgZdySendText(String msgZdySendText) {
this.msgZdySendText = msgZdySendText;
return this;
}
public String getHomeZdyPop() {
return homeZdyPop;
}
public NoviceInstructorModel setHomeZdyPop(String homeZdyPop) {
this.homeZdyPop = homeZdyPop;
return this;
}
public String getSendFirstMessage() {
return sendFirstMessage;

View File

@@ -6,8 +6,11 @@ import android.os.Handler;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.NoviceInstructorModel;
import com.yunbao.common.event.NoviceInstructorEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.base.BaseCacheManager;
import org.greenrobot.eventbus.EventBus;
@@ -48,8 +51,8 @@ public class NoviceInstructorManager extends BaseCacheManager {
*/
public NoviceInstructorModel getNoviceInstructor() {
if (null == model) {
model = new Gson().fromJson(
getString(KEY_NOVICE_INSTRUCTOR), NoviceInstructorModel.class);
model = new Gson().fromJson(getString(KEY_NOVICE_INSTRUCTOR), NoviceInstructorModel.class);
netHandler.post(instructorOperationRunnable);
}
return model;
}
@@ -68,16 +71,27 @@ public class NoviceInstructorManager extends BaseCacheManager {
* 清除相关信息
*/
public void removeNoviceInstructor() {
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
.params("uid", userInfo.getId())
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
}
});
model = null;
deleteByKey(KEY_NOVICE_INSTRUCTOR);
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(false));
}
/**
* 请求接口获取是否展示
*/
public void getNetNoviceInstructor() {
if (model != null)
netHandler.post(instructorOperationRunnable);
public void getNetNoviceInstructor(String info) {
model = new Gson().fromJson(info, NoviceInstructorModel.class);
setNoviceInstructor(model);
}
/**
@@ -87,7 +101,6 @@ public class NoviceInstructorManager extends BaseCacheManager {
@Override
public void run() {
//展示指引弹窗
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(true));
}