content: package org.ruoyi.system.controller.system;
  
  import cn.dev33.satoken.annotation.SaCheckPermission;
  import lombok.RequiredArgsConstructor;
  import org.ruoyi.common.core.domain.R;
  import org.ruoyi.common.log.annotation.Log;
  import org.ruoyi.common.log.enums.BusinessType;
  import org.ruoyi.common.web.core.BaseController;
  import org.ruoyi.core.page.PageQuery;
  import org.ruoyi.core.page.TableDataInfo;
  import org.ruoyi.system.domain.SysNotice;
  import org.ruoyi.system.domain.bo.SysNoticeBo;
  import org.ruoyi.system.domain.vo.SysNoticeVo;
  import org.ruoyi.system.service.ISysNoticeService;
  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;
  
      /**
       * 获取公告列表
       */
      @GetMapping("/list")
      public TableDataInfo<SysNoticeVo> list(SysNoticeBo notice, PageQuery pageQuery) {
          //公告类型（1通知 2公告）
          notice.setNoticeType("2");
          return noticeService.selectPageNoticeList(notice, pageQuery);
      }
  
      /**
       * 获取通知信息
       */
      @GetMapping("/getNotice")
      public R<SysNotice> getNotice(SysNoticeBo notice) {
          return R.ok(noticeService.getNotice(notice));
      }
  
      /**
       * 根据通知公告编号获取详细信息
       *
       * @param noticeId 公告ID
       */
      @SaCheckPermission("system:notice:query")
      @GetMapping(value = "/{noticeId}")
      public R<SysNoticeVo> getInfo(@PathVariable Long noticeId) {
          return R.ok(noticeService.selectNoticeById(noticeId));
      }
  
      /**
       * 新增通知公告
       */
      @SaCheckPermission("system:notice:add")
      @Log(title = "通知公告", businessType = BusinessType.INSERT)
      @PostMapping
      public R<Void> add(@Validated @RequestBody SysNoticeBo notice) {
          return toAjax(noticeService.insertNotice(notice));
      }
  
      /**
       * 修改通知公告
       */
      @SaCheckPermission("system:notice:edit")
      @Log(title = "通知公告", businessType = BusinessType.UPDATE)
      @PutMapping
      public R<Void> edit(@Validated @RequestBody SysNoticeBo notice) {
          return toAjax(noticeService.updateNotice(notice));
      }
  
      /**
       * 删除通知公告
       *
       * @param noticeIds 公告ID串
       */
      @SaCheckPermission("system:notice:remove")
      @Log(title = "通知公告", businessType = BusinessType.DELETE)
      @DeleteMapping("/{noticeIds}")
      public R<Void> remove(@PathVariable Long[] noticeIds) {
          return toAjax(noticeService.deleteNoticeByIds(noticeIds));
      }
  }
  