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

View File

@@ -106,10 +106,12 @@ 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, "无效消息");
Assert.isTrue(Objects.equals(notice.getUserId(), AuthUtil.getUserId()), "无效消息"); if (notice.getNoticeType() != NoticeType.GLOBAL.getCode() && notice.getNoticeType() != NoticeType.APP_SYSTEM.getCode() && notice.getNoticeType() != NoticeType.MARKET_SYSTEM.getCode()) {
if (notice.getHasRead() == 0) { Assert.isTrue(Objects.equals(notice.getUserId(), AuthUtil.getUserId()), "无效消息");
notice.setHasRead(1); if (notice.getHasRead() == 0) {
updateById(notice); notice.setHasRead(1);
updateById(notice);
}
} }
return AppCommonConvert.INSTANCE.convertNoticeDetailVO(notice); return AppCommonConvert.INSTANCE.convertNoticeDetailVO(notice);
} }