From cf4c8aac931b6b3b65d6989b55e8e1a556b7478f Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 25 Apr 2024 09:08:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=AC=E5=91=8A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyp/web/controller/manager/SysNoticeManager.java | 5 +++++ .../hyp/web/controller/system/SysNoticeController.java | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/manager/SysNoticeManager.java b/hyp-admin/src/main/java/com/hyp/web/controller/manager/SysNoticeManager.java index 481deb4..3d7b201 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/manager/SysNoticeManager.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/manager/SysNoticeManager.java @@ -75,4 +75,9 @@ public class SysNoticeManager { return noticeService.removeByIds(Arrays.asList(noticeIds)); } + + public SysNotice getNotice(){ + return noticeService.list().get(0); + } + } diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/system/SysNoticeController.java b/hyp-admin/src/main/java/com/hyp/web/controller/system/SysNoticeController.java index 33d7678..20955ec 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/system/SysNoticeController.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/system/SysNoticeController.java @@ -3,6 +3,8 @@ package com.hyp.web.controller.system; import java.util.List; import com.hyp.web.controller.manager.SysNoticeManager; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -26,6 +28,7 @@ import com.hyp.system.domain.SysNotice; * * @author ruoyi */ +@Api("通知公告") @RestController @RequestMapping("/system/notice") public class SysNoticeController extends BaseController @@ -89,4 +92,11 @@ public class SysNoticeController extends BaseController { return toAjax(sysNoticeManager.deleteNoticeByIds(noticeIds)); } + + + @ApiOperation("查询公告") + @GetMapping("/getNotice") + public AjaxResult getNotice() { + return success(sysNoticeManager.getNotice()); + } }