Browse Source

单独查询公告详情接口

zyf12 2 years ago
parent
commit
8aa095ccf3

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PostNoticeController.java

@@ -77,6 +77,17 @@ public class PostNoticeController extends BaseController
         return success(postNoticeService.selectPostNoticeByNoticeId(noticeId));
     }
 
+    /**
+     * 单独获取公告详细信息
+     * @param noticeId
+     * @return
+     */
+    @ApiOperation("单独获取公告详细信息")
+    @PreAuthorize("@ss.hasPermi('system:notice:queryDetail')")
+    @GetMapping(value = "/{/detail/noticeId}")
+    public AjaxResult getDetail(@PathVariable("noticeId")Long noticeId){
+        return success(postNoticeService.selectDetailByNoticeId(noticeId));
+    }
     /**
      * 新增公告
      */

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PostNoticeMapper.java

@@ -27,6 +27,13 @@ public interface PostNoticeMapper
      */
     public List<PostNotice> selectPostNoticeList(PostNotice postNotice);
 
+    /**
+     * 查询公告详情
+     * @param noticeId
+     * @return
+     */
+    public String selectDetailByNoticeId(Long noticeId);
+
     /**
      * 新增公告
      *
@@ -58,4 +65,5 @@ public interface PostNoticeMapper
      * @return 结果
      */
     public int deletePostNoticeByNoticeIds(Long[] noticeIds);
+
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPostNoticeService.java

@@ -58,4 +58,12 @@ public interface IPostNoticeService
      * @return 结果
      */
     public int deletePostNoticeByNoticeId(Long noticeId);
+
+    /**
+     * 查询公告详情
+     *
+     * @param noticeId
+     * @return
+     */
+    public String selectDetailByNoticeId(Long noticeId);
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PostNoticeServiceImpl.java

@@ -44,6 +44,12 @@ public class PostNoticeServiceImpl implements IPostNoticeService
         return postNoticeMapper.selectPostNoticeList(postNotice);
     }
 
+
+    @Override
+    public String selectDetailByNoticeId(Long noticeId) {
+        return postNoticeMapper.selectDetailByNoticeId(noticeId);
+    }
+
     /**
      * 新增公告
      *
@@ -93,4 +99,5 @@ public class PostNoticeServiceImpl implements IPostNoticeService
     {
         return postNoticeMapper.deletePostNoticeByNoticeId(noticeId);
     }
+
 }

+ 4 - 0
ruoyi-system/src/main/resources/mapper/system/PostNoticeMapper.xml

@@ -32,6 +32,10 @@
         <include refid="selectPostNoticeVo"/>
         where notice_id = #{noticeId}
     </select>
+    <select id="selectDetailByNoticeId" resultType="String">
+        select detail_detail from post_notice
+        where notice_id = #{noticeId}
+    </select>
 
     <insert id="insertPostNotice" parameterType="PostNotice" useGeneratedKeys="true" keyProperty="noticeId">
         insert into post_notice