package com.dl.web.controller.system; import cn.dev33.satoken.annotation.SaCheckPermission; import com.dl.common.annotation.Log; import com.dl.common.core.controller.BaseController; import com.dl.common.core.domain.PageQuery; import com.dl.common.core.domain.R; import com.dl.common.core.page.TableDataInfo; import com.dl.common.enums.BusinessType; import com.dl.system.domain.SysNotice; import com.dl.system.service.ISysNoticeService; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; /** * 公告 信息操作处理 * * @author Lion Li */ @Validated @RequiredArgsConstructor @RestController @RequestMapping("/system/notice") public class SysNoticeController extends BaseController { private final ISysNoticeService noticeService; /** * 获取通知公告列表 */ @SaCheckPermission("system:notice:list") @GetMapping("/list") public TableDataInfo list(SysNotice notice, PageQuery pageQuery) { return noticeService.selectPageNoticeList(notice, pageQuery); } /** * 根据通知公告编号获取详细信息 * * @param noticeId 公告ID */ @SaCheckPermission("system:notice:query") @GetMapping(value = "/{noticeId}") public R getInfo(@PathVariable String noticeId) { return R.ok(noticeService.selectNoticeById(noticeId)); } /** * 新增通知公告 */ @SaCheckPermission("system:notice:add") @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping public R add(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.insertNotice(notice)); } /** * 修改通知公告 */ @SaCheckPermission("system:notice:edit") @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PutMapping public R edit(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.updateNotice(notice)); } /** * 删除通知公告 * * @param noticeIds 公告ID串 */ @SaCheckPermission("system:notice:remove") @Log(title = "通知公告", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") public R remove(@PathVariable String[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } }