fix(system/message): 修复全部已读无效

This commit is contained in:
2025-06-15 17:58:08 +08:00
parent 93bd70dc5c
commit 271e2d8681

View File

@@ -76,7 +76,9 @@ public class MessageServiceImpl implements MessageService {
// 查询当前用户的未读消息
List<MessageDO> list = baseMapper.selectUnreadListByUserId(userId);
List<Long> unreadIds = list.stream().map(MessageDO::getId).toList();
messageLogService.addWithUserId(CollUtil.intersection(unreadIds, ids).stream().toList(), userId);
messageLogService.addWithUserId(CollUtil.isNotEmpty(ids)
? CollUtil.intersection(unreadIds, ids).stream().toList()
: unreadIds, userId);
WebSocketUtils.sendMessage(StpUtil.getTokenValueByLoginId(userId), String.valueOf(baseMapper
.selectUnreadListByUserId(userId)
.size()));