Răsfoiți Sursa

通知代码提交

pans 6 luni în urmă
părinte
comite
7fa84b87ea

+ 16 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/NoticeController.java

@@ -134,6 +134,22 @@ public class NoticeController {
     }
 
 
+    /**
+     * 获取notice详情
+     *
+     * @author pans
+     * @date  2025/07/25 16:17
+     */
+    @ApiOperationSupport(order = 5)
+    @ApiOperation("获取notice详情")
+    @GetMapping("/disk/notice/readDetail")
+    public CommonResult<NoticeVo> readDetail(@Valid NoticeIdParam noticeIdParam) {
+        return CommonResult.data(noticeService.readDetail(noticeIdParam));
+    }
+
+
+
+
     /**
      * 发布
      *

+ 2 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/NoticeMapper.java

@@ -40,4 +40,6 @@ public interface NoticeMapper extends BaseMapper<Notice> {
     void cancel(NoticeIdParam noticeIdParam);
 
     Page<NoticeVo> readPage(@Param("page") Page<Object> objectPage, @Param("noticePageParam")  NoticePageParam noticePageParam, @Param("typelist") List<String> typelist);
+
+    NoticeVo readDetail(@Param("userId") String userId,@Param("noticeId") Long noticeId);
 }

+ 26 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/NoticeMapper.xml

@@ -71,7 +71,28 @@
         order by a.MODIFY_TIME desc
     </select>
 
-
+    <select id="readDetail" resultType="vip.xiaonuo.disk.vo.notice.NoticeVo">
+        SELECT
+            a.NOTICE_ID noticeId,
+            a.CONTENT content,
+            a.CREATE_TIME createTime,
+            a.CREATE_USER_ID createUserId,
+            a.MODIFY_TIME modifyTime,
+            a.MODIFY_USER_ID modifyUserId,
+            a.PLATFORM platform,
+            a.TITLE title,
+            a.PUBLISH_USER publishUser,
+            a.PUBLISH_TIME publishTime,
+            a.NOTICE_STATUS noticeStatus,
+            b.name publishUserName,
+            CASE
+                WHEN (SELECT count(1) FROM USER_READ c WHERE a.NOTICE_ID = c.MAIN_ID AND c.USER_ID = #{userId}) > 0
+                    THEN true  ELSE false  END AS isRead
+        FROM
+            ONLINEEDU."notice" a
+        LEFT JOIN sys_user b ON  a.PUBLISH_USER = b.id
+        where a.NOTICE_ID=#{noticeId}
+    </select>
 
     <select id="detail" resultType="vip.xiaonuo.disk.vo.notice.NoticeVo">
         SELECT
@@ -92,6 +113,10 @@
         where a.NOTICE_ID=#{noticeId}
     </select>
 
+
+
+
+
     <update id="publish">
         update notice set notice_status=1 where  NOTICE_ID=#{noticeId}
     </update>

+ 2 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/NoticeService.java

@@ -85,4 +85,6 @@ public interface NoticeService extends IService<Notice> {
     void cancel(@Valid NoticeIdParam noticeIdParam);
 
     Page<NoticeVo> readPage(NoticePageParam noticePageParam);
+
+    NoticeVo readDetail(@Valid NoticeIdParam noticeIdParam);
 }

+ 4 - 5
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/NoticeServiceImpl.java

@@ -67,11 +67,10 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
         return noticeMapper.readPage(CommonPageRequest.defaultPage(), noticePageParam,typelist);
     }
 
-
-
-
-
-
+    @Override
+    public NoticeVo readDetail(NoticeIdParam noticeIdParam) {
+        return noticeMapper.readDetail(StpLoginUserUtil.getLoginUser().getId(),noticeIdParam.getNoticeId());
+    }
 
 
     @Transactional(rollbackFor = Exception.class)