|  |  | 
 |  |  | package com.ruoyi.web.controller.system; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | import com.ruoyi.common.core.domain.entity.SysUser; | 
 |  |  | import com.ruoyi.common.core.domain.model.LoginUser; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.validation.annotation.Validated; | 
 |  |  | 
 |  |  |  */ | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/system/notice") | 
 |  |  | public class SysNoticeController extends BaseController | 
 |  |  | { | 
 |  |  | public class SysNoticeController extends BaseController { | 
 |  |  |     @Autowired | 
 |  |  |     private ISysNoticeService noticeService; | 
 |  |  |  | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:notice:list')") | 
 |  |  |     @GetMapping("/list") | 
 |  |  |     public TableDataInfo list(SysNotice notice) | 
 |  |  |     { | 
 |  |  |     public TableDataInfo list(SysNotice notice) { | 
 |  |  |         startPage(); | 
 |  |  |         LoginUser loginUser = getLoginUser(); | 
 |  |  |         SysUser user = loginUser.getUser(); | 
 |  |  |         notice.setOrgid(user.getOrgid()); | 
 |  |  |         List<SysNotice> list = noticeService.selectNoticeList(notice); | 
 |  |  |         return getDataTable(list); | 
 |  |  |     } | 
 |  |  | 
 |  |  |      */ | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:notice:query')") | 
 |  |  |     @GetMapping(value = "/{noticeId}") | 
 |  |  |     public AjaxResult getInfo(@PathVariable Long noticeId) | 
 |  |  |     { | 
 |  |  |     public AjaxResult getInfo(@PathVariable Long noticeId) { | 
 |  |  |         return success(noticeService.selectNoticeById(noticeId)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:notice:add')") | 
 |  |  |     @Log(title = "通知公告", businessType = BusinessType.INSERT) | 
 |  |  |     @PostMapping("/add") | 
 |  |  |     public AjaxResult add(@Validated @RequestBody SysNotice notice) | 
 |  |  |     { | 
 |  |  |     public AjaxResult add(@Validated @RequestBody SysNotice notice) { | 
 |  |  |         notice.setCreateBy(getUsername()); | 
 |  |  |         return toAjax(noticeService.insertNotice(notice)); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:notice:edit')") | 
 |  |  |     @Log(title = "通知公告", businessType = BusinessType.UPDATE) | 
 |  |  |     @PostMapping("/edit") | 
 |  |  |     public AjaxResult edit(@Validated @RequestBody SysNotice notice) | 
 |  |  |     { | 
 |  |  |     public AjaxResult edit(@Validated @RequestBody SysNotice notice) { | 
 |  |  |         notice.setUpdateBy(getUsername()); | 
 |  |  |         return toAjax(noticeService.updateNotice(notice)); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     //@PreAuthorize("@ss.hasPermi('system:notice:remove')") | 
 |  |  |     @Log(title = "通知公告", businessType = BusinessType.DELETE) | 
 |  |  |     @GetMapping("/remove/{noticeIds}") | 
 |  |  |     public AjaxResult remove(@PathVariable Long[] noticeIds) | 
 |  |  |     { | 
 |  |  |     public AjaxResult remove(@PathVariable Long[] noticeIds) { | 
 |  |  |         return toAjax(noticeService.deleteNoticeByIds(noticeIds)); | 
 |  |  |     } | 
 |  |  | } |