完善已读逻辑
This commit is contained in:
parent
349c6948fb
commit
9bb59f448f
@ -162,10 +162,11 @@ public class AppGroupMessageService {
|
||||
if (StrUtil.isEmpty(userId)) {
|
||||
throw new BizException(ResponseStatus.PARM_ERROR, "用户ID错误:" + userId);
|
||||
}
|
||||
String messageIds = (String) attributes.get("messageIds");
|
||||
String messageIds = accessor.getFirstNativeHeader("messageIds");
|
||||
if (StrUtil.isEmpty(messageIds)) {
|
||||
throw new BizException(ResponseStatus.PARM_ERROR, "消息ID错误:" + messageIds);
|
||||
}
|
||||
LoggerUtil.info("readMessage:userId=" + userId + ",messageIds=" + messageIds);
|
||||
String[] ids = messageIds.split(",");
|
||||
List<Integer> list = new ArrayList<>(ids.length);
|
||||
for (String id : ids) {
|
||||
@ -187,7 +188,7 @@ public class AppGroupMessageService {
|
||||
QueryGroupMessageType msgType = QueryGroupMessageType.fromValue(type);
|
||||
NavigableSet<Integer> sortedSet = groupCacheService.getMessageIdSet(groupId, userId, msgType);
|
||||
if (lastId != null) {
|
||||
sortedSet = sortedSet.tailSet(lastId, false);
|
||||
sortedSet = sortedSet.headSet(lastId, false);
|
||||
}
|
||||
return sortedSet.size();
|
||||
}
|
||||
|
||||
@ -195,6 +195,7 @@ public class CollectTask {
|
||||
Map<String, VideoUserWatchCollect> map = new HashMap<>();
|
||||
liveWatchList.forEach(liveWatch -> {
|
||||
liveWatch.setVodSeconds(0);
|
||||
liveWatch.setVodMinutes(0);
|
||||
map.put(liveWatch.getUserId(), liveWatch);
|
||||
});
|
||||
|
||||
@ -202,8 +203,10 @@ public class CollectTask {
|
||||
VideoUserWatchCollect liveWatch = map.get(vodWatch.getUserId());
|
||||
if (liveWatch != null) {
|
||||
liveWatch.setVodSeconds(vodWatch.getVodSeconds());
|
||||
liveWatch.setVodMinutes(vodWatch.getVodMinutes());
|
||||
} else {
|
||||
vodWatch.setLiveSeconds(0);
|
||||
vodWatch.setLiveMinutes(0);
|
||||
map.put(vodWatch.getUserId(), vodWatch);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user