消息中心遮罩修改

This commit is contained in:
18401019693 2022-09-05 15:57:43 +08:00
parent 7c287e2abf
commit 7281296d8e
7 changed files with 71 additions and 14 deletions

View File

@ -10,6 +10,9 @@ public class VipModel extends BaseModel {
@SerializedName("type")
private String type = "";
@SerializedName("admin_id")
private String adminId;
public String getType() {
return type;
}
@ -18,4 +21,13 @@ public class VipModel extends BaseModel {
this.type = type;
return this;
}
public String getAdminId() {
return adminId;
}
public VipModel setAdminId(String adminId) {
this.adminId = adminId;
return this;
}
}

View File

@ -14,6 +14,7 @@ import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.SearchModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.SlideInBannerModel;
import com.yunbao.common.bean.VipModel;
import java.util.List;
@ -218,4 +219,10 @@ public interface PDLiveApi {
*/
@GET("/api/public/?service=Message.setMessageReadAll")
Observable<ResponseModel<List<String>>> setMessageReadAll();
/**
* 获取当前用户指导员ID
*/
@GET("/api/public/?service=User.getUserInstructor")
Observable<ResponseModel<List<VipModel>>> getUserInstructor();
}

View File

@ -7,6 +7,7 @@ import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.bean.VipModel;
import com.yunbao.common.http.API;
import com.yunbao.common.http.base.HttpCallback;
@ -172,4 +173,20 @@ public class LiveNetManager {
}
}).isDisposed();
}
/**
* 获取当前用户指导员ID
*/
public void getUserInstructor(HttpCallback<List<VipModel>> callback) {
API.get().pdLiveApi(mContext).getUserInstructor()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null)
callback.onSuccess(listResponseModel.getData().getInfo());
}, throwable -> {
if (callback != null)
callback.onError(throwable.getMessage());
}).isDisposed();
}
}

View File

@ -577,6 +577,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
isfloatBannernet = false;
}
});
//获取指导员账号
ConversationIMListManager.get(this).getUserInstructor(this);
}
/**

View File

@ -145,18 +145,14 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
}
}, null);
//点击事件
politicalInstructor.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
ViewClicksAntiShake.clicksAntiShake(politicalInstructor, () -> {
String targetId = ConversationIMListManager.get(mContext).getTargetId();
if (!TextUtils.isEmpty(targetId)) {
ConversationIMListManager.get(mContext).jumpConversation(mContext, targetId);
guide.dismiss();
}
});
}
});
}
/**
@ -212,7 +208,6 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
* 初始化数据
*/
private void initData() {
ConversationIMListManager.get(mContext).getConversationListByPage(false);
IMLoginManager.get(mContext).checkInstructor();
mProcessResultUtil = new ProcessResultUtil(this);
netHandler.post(imUserInfoRunnable);
@ -413,7 +408,7 @@ public class PDLiveConversationListActivity extends AbsActivity implements View.
DialogUitl.showSimpleDialog(mContext, null, getString(R.string.clear_unread_messages), false, new DialogUitl.SimpleCallback3() {
@Override
public void onConfirmClick(Dialog dialog) {
ConversationIMListManager.get(mContext).getConversationListByPage(true);
// ConversationIMListManager.get(mContext).getConversationListByPage(true);
LiveNetManager.get(mContext)
.setMessageReadAll(new com.yunbao.common.http.base.HttpCallback<String>() {
@Override

View File

@ -690,7 +690,7 @@ public class MainHttpUtil {
}
//
public static void setMessageReadAll(){
HttpClient.getInstance().get("Message.setMessageReadAll","")
HttpClient.getInstance().get("User.getUserInstructor","")
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {

View File

@ -13,8 +13,10 @@ import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.Gson;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.VipModel;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.InstructorRemarkManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.activity.PDLIiveChatActivity;
@ -280,8 +282,30 @@ public class ConversationIMListManager {
private long timeStamp = 0;
/**
* 获取新手指导员账号
* 获取当前指导员ID
*/
public void getUserInstructor(Activity context) {
LiveNetManager.get(context)
.getUserInstructor(new com.yunbao.common.http.base.HttpCallback<List<VipModel>>() {
@Override
public void onSuccess(List<VipModel> data) {
if (data != null && data.size() > 0) {
targetId = data.get(0).getAdminId();
}
}
@Override
public void onError(String error) {
}
});
}
/**
* 获取新手指导员账号废弃过时
*/
@Deprecated
public void getConversationListByPage(boolean clearMessages) {
RongIMClient.getInstance().getConversationListByPage(new RongIMClient.ResultCallback<List<Conversation>>() {
@Override