From 56050aa6501f3d9d2f79a2c40a28815878ac56ee Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期四, 24 十一月 2022 15:14:47 +0800 Subject: [PATCH] update 同步 ruoyi 相关提交 * fix 修复Log注解GET请求记录不到参数问题 * fix 修复某些特性的环境生成代码变乱码TXT文件问题 * update 消除Vue3控制台出现的警告信息 * fix 开启TopNav没有子菜单隐藏侧边栏 * fix 修复回显数据字典数组异常问题(I60UYQ) * update 忽略不必要的属性数据返回 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java | 70 ++++++++++++++-------------------- 1 files changed, 29 insertions(+), 41 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java index 224e594..54b30d6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java @@ -1,92 +1,80 @@ package com.ruoyi.web.controller.system; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import cn.dev33.satoken.annotation.SaCheckPermission; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.PageQuery; +import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.service.ISysNoticeService; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; /** * 鍏憡 淇℃伅鎿嶄綔澶勭悊 - * - * @author ruoyi + * + * @author Lion Li */ +@Validated +@RequiredArgsConstructor @RestController @RequestMapping("/system/notice") -public class SysNoticeController extends BaseController -{ - @Autowired - private ISysNoticeService noticeService; +public class SysNoticeController extends BaseController { + + private final ISysNoticeService noticeService; /** * 鑾峰彇閫氱煡鍏憡鍒楄〃 */ - @PreAuthorize("@ss.hasPermi('system:notice:list')") + @SaCheckPermission("system:notice:list") @GetMapping("/list") - public TableDataInfo list(SysNotice notice) - { - startPage(); - List<SysNotice> list = noticeService.selectNoticeList(notice); - return getDataTable(list); + public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) { + return noticeService.selectPageNoticeList(notice, pageQuery); } /** * 鏍规嵁閫氱煡鍏憡缂栧彿鑾峰彇璇︾粏淇℃伅 + * + * @param noticeId 鍏憡ID */ - @PreAuthorize("@ss.hasPermi('system:notice:query')") + @SaCheckPermission("system:notice:query") @GetMapping(value = "/{noticeId}") - public AjaxResult getInfo(@PathVariable Long noticeId) - { - return AjaxResult.success(noticeService.selectNoticeById(noticeId)); + public R<SysNotice> getInfo(@PathVariable Long noticeId) { + return R.ok(noticeService.selectNoticeById(noticeId)); } /** * 鏂板閫氱煡鍏憡 */ - @PreAuthorize("@ss.hasPermi('system:notice:add')") + @SaCheckPermission("system:notice:add") @Log(title = "閫氱煡鍏憡", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysNotice notice) - { - notice.setCreateBy(SecurityUtils.getUsername()); + public R<Void> add(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.insertNotice(notice)); } /** * 淇敼閫氱煡鍏憡 */ - @PreAuthorize("@ss.hasPermi('system:notice:edit')") + @SaCheckPermission("system:notice:edit") @Log(title = "閫氱煡鍏憡", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysNotice notice) - { - notice.setUpdateBy(SecurityUtils.getUsername()); + public R<Void> edit(@Validated @RequestBody SysNotice notice) { return toAjax(noticeService.updateNotice(notice)); } /** * 鍒犻櫎閫氱煡鍏憡 + * + * @param noticeIds 鍏憡ID涓� */ - @PreAuthorize("@ss.hasPermi('system:notice:remove')") + @SaCheckPermission("system:notice:remove") @Log(title = "閫氱煡鍏憡", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") - public AjaxResult remove(@PathVariable Long[] noticeIds) - { + public R<Void> remove(@PathVariable Long[] noticeIds) { return toAjax(noticeService.deleteNoticeByIds(noticeIds)); } } -- Gitblit v1.9.3