| | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; |
| | | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeRespVO; |
| | | import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeSaveReqVO; |
| | |
| | | |
| | | @Resource |
| | | private WebSocketSenderApi webSocketSenderApi; |
| | | |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建通知公告") |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获取通知公告列表") |
| | | @PreAuthorize("@ss.hasPermission('system:notice:query')") |
| | | public CommonResult<PageResult<NoticeRespVO>> getNoticePage(@Validated NoticePageReqVO pageReqVO) { |
| | | PageResult<NoticeDO> pageResult = noticeService.getNoticePage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, NoticeRespVO.class)); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得通知公告") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('system:notice:query')") |
| | | public CommonResult<NoticeRespVO> getNotice(@RequestParam("id") Long id) { |
| | | NoticeDO notice = noticeService.getNotice(id); |
| | | return success(BeanUtils.toBean(notice, NoticeRespVO.class)); |
| | | NoticeRespVO respVO = BeanUtils.toBean(notice, NoticeRespVO.class); |
| | | if (respVO != null) { |
| | | respVO.setAttachmentList(storageAttachmentApi.listAttachments("notice", id)); |
| | | } |
| | | return success(respVO); |
| | | } |
| | | |
| | | @PostMapping("/push") |