1. notice module
This commit is contained in:
2026-02-12 16:54:18 +08:00
parent 0b6e90acb7
commit a8693e77cc

View File

@@ -106,11 +106,13 @@ public class CommonUserNoticeServiceImpl extends BaseServiceImpl<CommonUserNotic
public CommonUserNoticeDetailApiVO userNoticeDetail(Long id) { public CommonUserNoticeDetailApiVO userNoticeDetail(Long id) {
CommonUserNoticeEntity notice = getById(id); CommonUserNoticeEntity notice = getById(id);
Assert.notNull(notice, "无效消息"); Assert.notNull(notice, "无效消息");
if (notice.getNoticeType() != NoticeType.GLOBAL.getCode() && notice.getNoticeType() != NoticeType.APP_SYSTEM.getCode() && notice.getNoticeType() != NoticeType.MARKET_SYSTEM.getCode()) {
Assert.isTrue(Objects.equals(notice.getUserId(), AuthUtil.getUserId()), "无效消息"); Assert.isTrue(Objects.equals(notice.getUserId(), AuthUtil.getUserId()), "无效消息");
if (notice.getHasRead() == 0) { if (notice.getHasRead() == 0) {
notice.setHasRead(1); notice.setHasRead(1);
updateById(notice); updateById(notice);
} }
}
return AppCommonConvert.INSTANCE.convertNoticeDetailVO(notice); return AppCommonConvert.INSTANCE.convertNoticeDetailVO(notice);
} }