From 9bfde6f6a312ba08a5931cdb5e61c35cfbede5d6 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Tue, 14 Oct 2025 20:53:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(system/message):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=B6=88=E6=81=AF=E8=AF=A6=E6=83=85=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #193 --- .../admin/system/controller/UserMessageController.java | 5 +++-- .../src/main/resources/mapper/MessageMapper.xml | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) 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,