From 9bb59f448f2c67c87185957cfad7013b6b1c534c Mon Sep 17 00:00:00 2001 From: easonzhu Date: Thu, 20 Feb 2025 09:50:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=B7=B2=E8=AF=BB=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upchina/group/service/app/AppGroupMessageService.java | 5 +++-- src/main/java/com/upchina/video/schedule/CollectTask.java | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/upchina/group/service/app/AppGroupMessageService.java b/src/main/java/com/upchina/group/service/app/AppGroupMessageService.java index 7fffd55..e14691d 100644 --- a/src/main/java/com/upchina/group/service/app/AppGroupMessageService.java +++ b/src/main/java/com/upchina/group/service/app/AppGroupMessageService.java @@ -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 list = new ArrayList<>(ids.length); for (String id : ids) { @@ -187,7 +188,7 @@ public class AppGroupMessageService { QueryGroupMessageType msgType = QueryGroupMessageType.fromValue(type); NavigableSet sortedSet = groupCacheService.getMessageIdSet(groupId, userId, msgType); if (lastId != null) { - sortedSet = sortedSet.tailSet(lastId, false); + sortedSet = sortedSet.headSet(lastId, false); } return sortedSet.size(); } diff --git a/src/main/java/com/upchina/video/schedule/CollectTask.java b/src/main/java/com/upchina/video/schedule/CollectTask.java index 9d1c938..e784758 100644 --- a/src/main/java/com/upchina/video/schedule/CollectTask.java +++ b/src/main/java/com/upchina/video/schedule/CollectTask.java @@ -195,6 +195,7 @@ public class CollectTask { Map 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); } });