From 15cda0c83554e200196a33021ab04a8611e3b261 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 30 Jan 2023 14:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=BF=9B=E8=A1=8C=E9=99=84=E4=BB=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/sys/controller/NoticeController.java | 6 +++++- .../main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java index ecd4678..26cb952 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/NoticeController.java @@ -2,6 +2,7 @@ package com.ningdatech.pmapi.sys.controller; import com.ningdatech.basic.model.IdVo; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.sys.entity.req.NoticeListReq; import com.ningdatech.pmapi.sys.entity.req.NoticeSaveReq; import com.ningdatech.pmapi.sys.entity.req.NoticeStatusModifyReq; @@ -24,7 +25,7 @@ import javax.validation.Valid; * @since 2022-07-21 */ @RestController -@Api(tags = "消息管理") +@Api(tags = "公告管理") @RequiredArgsConstructor @RequestMapping("/api/v1/notice") public class NoticeController { @@ -33,6 +34,7 @@ public class NoticeController { @PostMapping("/save") @ApiOperation("新增通知") + @WebLog("新增公告") public IdVo save(@Valid @RequestBody NoticeSaveReq req) { return noticeManage.saveOrModify(req); } @@ -45,6 +47,7 @@ public class NoticeController { @PostMapping("/enabled") @ApiOperation("启用禁用") + @WebLog("启用禁用") public Boolean save(@Valid @RequestBody NoticeStatusModifyReq req) { return noticeManage.changeEnabled(req); } @@ -63,6 +66,7 @@ public class NoticeController { @DeleteMapping("/del") @ApiOperation("删除公告") + @WebLog("删除公告") public void delNotice(@RequestBody IdVo req) { noticeManage.delNotice(req.getId()); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index 5961508..ee187ad 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -50,8 +50,10 @@ public class NoticeManage { Notice notice = noticeService.getById(id); NoticeDetailVO detail = BeanUtil.copyProperties(notice, NoticeDetailVO.class); List fileIds = BizUtils.splitToLong(notice.getAttachment()); - List attachFiles = fileService.getByIds(fileIds); - detail.setAttachments(attachFiles); + if (!fileIds.isEmpty()) { + List attachFiles = fileService.getByIds(fileIds); + detail.setAttachments(attachFiles); + } return detail; } @@ -92,7 +94,7 @@ public class NoticeManage { return PageVo.of(tempDataList, page.getTotal()); } - public void delNotice(Long id){ + public void delNotice(Long id) { noticeService.removeById(id); }