liusheng
10 天以前 d45ec43365b9f79d62c3f303dda7172acb3c4776
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
@@ -1,6 +1,9 @@
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;
@@ -27,8 +30,7 @@
 */
@RestController
@RequestMapping("/system/notice")
public class SysNoticeController extends BaseController
{
public class SysNoticeController extends BaseController {
    @Autowired
    private ISysNoticeService noticeService;
@@ -37,9 +39,11 @@
     */
    //@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);
    }
@@ -49,8 +53,7 @@
     */
    //@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));
    }
@@ -60,8 +63,7 @@
    //@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));
    }
@@ -72,8 +74,7 @@
    //@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));
    }
@@ -84,8 +85,7 @@
    //@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));
    }
}