From 5d0063471718f400a944a7b2a2178b91e93103b1 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Tue, 23 Jul 2024 09:02:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9F=A5=E8=AF=A2=E4=BF=9D=E5=AF=86?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/system/SysNoticeController.java | 8 ++++++++ .../java/com/ruoyi/system/mapper/SysNoticeMapper.java | 8 ++++++++ .../com/ruoyi/system/service/ISysNoticeService.java | 3 +++ .../system/service/impl/SysNoticeServiceImpl.java | 11 +++++++++++ .../main/resources/mapper/system/SysNoticeMapper.xml | 5 +++++ 5 files changed, 35 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysNoticeController.java index 9f993fd..3679fe5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysNoticeController.java @@ -110,4 +110,12 @@ public class SysNoticeController extends BaseController { return toAjax(noticeService.deleteNoticeByIds(ids)); } + + + @GetMapping ("/getNotice") + @ResponseBody + public AjaxResult getNotice() + { + return AjaxResult.success(noticeService.selectList()); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java index dd402e2..836abd5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -49,4 +49,12 @@ public interface SysNoticeMapper * @return 结果 */ public int deleteNoticeByIds(String[] noticeIds); + + + /** + * 查询公告列表 + * + * @return 公告集合 + */ + public List selectList(); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java index 6398b5a..174ebd8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -49,4 +49,7 @@ public interface ISysNoticeService * @return 结果 */ public int deleteNoticeByIds(String ids); + + + public SysNotice selectList(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java index 7968b9a..31f06b3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -79,4 +79,15 @@ public class SysNoticeServiceImpl implements ISysNoticeService { return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); } + + /** + * 查询公告列表 + * + * @return 公告集合 + */ + @Override + public SysNotice selectList() + { + return noticeMapper.selectList().get(0); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml index a18784b..65bece1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -81,5 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{noticeId} + + \ No newline at end of file