2 Коміти 0c53052303 ... 7e851c241d

Автор SHA1 Опис Дата
  wangyunpeng 7e851c241d Merge branch '20250912-wyp-illegalNotice' into test 1 день тому
  wangyunpeng d4eab70fb4 一键全部已读 1 день тому

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformNoticeController.java

@@ -42,6 +42,13 @@ public class ContentPlatformNoticeController {
         return CommonResponse.success();
     }
 
+    @ApiOperation(value = "一键全部已读")
+    @PostMapping("/readAll")
+    public CommonResponse<Void> noticeReadAll() {
+        noticeService.noticeReadAll();
+        return CommonResponse.success();
+    }
+
     @ApiOperation(value = "检查违规视频发送通知", hidden = true)
     @JwtIgnore
     @GetMapping("/job/checkContentPlatformIllegalVideoJob")

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformNoticeService.java

@@ -12,4 +12,6 @@ public interface ContentPlatformNoticeService {
     Long getNotReadCount();
 
     void noticeRead(NoticeReadParam param);
+
+    void noticeReadAll();
 }

+ 17 - 2
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java

@@ -39,10 +39,14 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
         for (ContentPlatformIllegalMsg item : list) {
             NoticeItemVO vo = new NoticeItemVO();
             vo.setId(item.getId());
-            String title = "视频“" + item.getTitle() + "”被封禁,请及时替换";
+            String videoTitle = item.getTitle();
+            if (videoTitle.length() >= 20) {
+                videoTitle = videoTitle.substring(0, 19) + "...";
+            }
+            String title = "视频“" + videoTitle + "”被封禁,请及时替换";
             vo.setTitle(title);
             String msg = "您在" + item.getBusinessType() + "栏目中使用的视频“" +
-                    item.getTitle() + "”(视频ID:" + item.getVideoId() + ")被微信封禁,请及时替换为其他视频。";
+                    videoTitle + "”(视频ID:" + item.getVideoId() + ")被微信封禁,请及时替换为其他视频。";
             vo.setMsg(msg);
             vo.setStatus(item.getStatus());
             vo.setCreateTimestamp(item.getCreateTimestamp());
@@ -68,4 +72,15 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
         illegalMsg.setUpdateTimestamp(System.currentTimeMillis());
         msgMapper.updateByPrimaryKeySelective(illegalMsg);
     }
+
+    @Override
+    public void noticeReadAll() {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        ContentPlatformIllegalMsg record = new ContentPlatformIllegalMsg();
+        record.setStatus(1);
+        record.setUpdateTimestamp(System.currentTimeMillis());
+        msgMapper.updateByExampleSelective(record, example);
+    }
 }