feat:全局性广播飘窗-增加地区隔离逻辑(只展示当前地区的飘屏)
This commit is contained in:
@@ -29,6 +29,7 @@ import com.chwl.core.im.custom.bean.RoomTemplateNotifyMsgBean
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.manager.IMNetEaseManager
|
||||
import com.chwl.core.noble.bean.AllServiceGiftProtocol
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.example.lib_utils.log.ILog
|
||||
import com.google.gson.Gson
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
@@ -146,7 +147,9 @@ object GlobalNotifyManager : Observer<BroadcastMessage>, ILog {
|
||||
protocol.data.toString(),
|
||||
RoomTemplateNotifyMsgBean::class.java
|
||||
)
|
||||
queue.addLast(data)
|
||||
if (UserModel.get().isSamePartition(data.partitionId ?: 0)) {
|
||||
queue.addLast(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 礼物
|
||||
@@ -156,7 +159,9 @@ object GlobalNotifyManager : Observer<BroadcastMessage>, ILog {
|
||||
protocol.data.toString(),
|
||||
AllServiceGiftProtocol.DataBean::class.java
|
||||
)
|
||||
queue.addLast(data)
|
||||
if (UserModel.get().isSamePartition(data.partitionId)) {
|
||||
queue.addLast(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 寻爱之旅
|
||||
@@ -172,7 +177,9 @@ object GlobalNotifyManager : Observer<BroadcastMessage>, ILog {
|
||||
protocol.data.toString(),
|
||||
LuckyBagNoticeInfo::class.java
|
||||
)
|
||||
queue.addLast(data)
|
||||
if (UserModel.get().isSamePartition(data.partitionId)) {
|
||||
queue.addLast(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,6 +190,9 @@ object GlobalNotifyManager : Observer<BroadcastMessage>, ILog {
|
||||
protocol.data.toString(),
|
||||
RoomBoxPrizeInfo::class.java
|
||||
)
|
||||
if (!UserModel.get().isSamePartition(data.partitionId)) {
|
||||
return
|
||||
}
|
||||
val roomBoxPrizeAttachment = RoomBoxPrizeAttachment(
|
||||
CustomAttachment.CUSTOM_MSG_BOX,
|
||||
CustomAttachment.CUSTOM_MSG_SUB_BOX_ALL_ROOM_NOTIFY_BY_SVGA
|
||||
|
@@ -16,4 +16,5 @@ public class LuckyBagNoticeInfo implements Serializable {
|
||||
private String luckyBagGiftPic;
|
||||
private String giftPic;
|
||||
private int giftNum;
|
||||
private long partitionId;
|
||||
}
|
||||
|
@@ -11,4 +11,5 @@ public class RoomBoxPrizeInfo {
|
||||
private long roomUid;
|
||||
private int prizeNum;
|
||||
private int userLevelLimit;
|
||||
private long partitionId;
|
||||
}
|
@@ -18,6 +18,8 @@ class RoomTemplateNotifyMsgBean : TemplateMessage() {
|
||||
// SVGA-文本的坑位KEY
|
||||
private var svgaTextKey: String? = null
|
||||
|
||||
val partitionId: Long? = null
|
||||
|
||||
fun getSvgaTextKey(): String {
|
||||
return svgaTextKey ?: "noble_text_tx"
|
||||
}
|
||||
|
@@ -49,6 +49,16 @@ public class AllServiceGiftProtocol extends BaseProtocol<AllServiceGiftProtocol.
|
||||
private String levelNum;
|
||||
private boolean isHomeShow;
|
||||
|
||||
private long partitionId;
|
||||
|
||||
public long getPartitionId() {
|
||||
return partitionId;
|
||||
}
|
||||
|
||||
public void setPartitionId(long partitionId) {
|
||||
this.partitionId = partitionId;
|
||||
}
|
||||
|
||||
public String getSendUserNick() {
|
||||
return sendUserNick;
|
||||
}
|
||||
|
@@ -245,4 +245,5 @@ public interface IUserModel extends IModel {
|
||||
*/
|
||||
Single<String> saveArea(String area);
|
||||
|
||||
boolean isSamePartition(long partitionId);
|
||||
}
|
||||
|
@@ -838,6 +838,14 @@ public final class UserModel extends BaseModel implements IUserModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSamePartition(long partitionId) {
|
||||
if (currentUserInfo.partitionId == 0) {
|
||||
return true;
|
||||
}
|
||||
return currentUserInfo.partitionId == partitionId;
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 获取某个用户的用户信息
|
||||
|
@@ -334,6 +334,10 @@ public class UserInfo implements Serializable {
|
||||
@Setter
|
||||
public boolean inOnline;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public long partitionId;
|
||||
|
||||
public UserInfo() {
|
||||
|
||||
}
|
||||
@@ -366,6 +370,7 @@ public class UserInfo implements Serializable {
|
||||
this.bindType = userInfo.bindType;
|
||||
this.isReview = userInfo.isReview;
|
||||
this.newAvatar = userInfo.newAvatar;
|
||||
this.partitionId = userInfo.partitionId;
|
||||
}
|
||||
|
||||
public Location getUserExpand() {
|
||||
@@ -713,6 +718,14 @@ public class UserInfo implements Serializable {
|
||||
this.familyId = familyId;
|
||||
}
|
||||
|
||||
public long getPartitionId() {
|
||||
return partitionId;
|
||||
}
|
||||
|
||||
public void setPartitionId(long partitionId) {
|
||||
this.partitionId = partitionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserInfo{" +
|
||||
|
Reference in New Issue
Block a user