diff --git a/continew-system/src/main/java/top/continew/admin/system/controller/UserMessageController.java b/continew-system/src/main/java/top/continew/admin/system/controller/UserMessageController.java index 9c7cf8c5..fb3824f5 100644 --- a/continew-system/src/main/java/top/continew/admin/system/controller/UserMessageController.java +++ b/continew-system/src/main/java/top/continew/admin/system/controller/UserMessageController.java @@ -16,6 +16,7 @@ package top.continew.admin.system.controller; +import cn.hutool.core.collection.CollUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.ParameterIn; @@ -81,8 +82,8 @@ public class UserMessageController { @GetMapping("/{id}") public MessageDetailResp getMessage(@PathVariable Long id) { MessageDetailResp detail = messageService.get(id); - CheckUtils.throwIf(detail == null || (NoticeScopeEnum.USER.equals(detail.getScope()) && !detail.getUsers() - .contains(UserContextHolder.getUserId().toString())), "消息不存在或无权限访问"); + CheckUtils.throwIf(detail == null || (NoticeScopeEnum.USER.equals(detail.getScope()) && !CollUtil + .contains(detail.getUsers(), UserContextHolder.getUserId().toString())), "消息不存在或无权限访问"); messageService.readMessage(Collections.singletonList(id), UserContextHolder.getUserId()); detail.setIsRead(true); return detail; diff --git a/continew-system/src/main/resources/mapper/MessageMapper.xml b/continew-system/src/main/resources/mapper/MessageMapper.xml index c461949a..5427e119 100644 --- a/continew-system/src/main/resources/mapper/MessageMapper.xml +++ b/continew-system/src/main/resources/mapper/MessageMapper.xml @@ -2,6 +2,11 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > + + + + + - SELECT t1.id, t1.title,