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