From 695cb6d76b838b1e4cb161bae335faa948dca12a Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 27 十月 2021 13:16:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into satoken

---
 ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
index 649d1dc..55c93d8 100644
--- a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
+++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
@@ -1,5 +1,6 @@
 package com.ruoyi.generator.controller;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.convert.Convert;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
@@ -15,7 +16,6 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.io.IOUtils;
 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.*;
 
@@ -44,7 +44,7 @@
      * 鏌ヨ浠g爜鐢熸垚鍒楄〃
      */
     @ApiOperation("鏌ヨ浠g爜鐢熸垚鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
+    @SaCheckPermission("tool:gen:list")
     @GetMapping("/list")
     public TableDataInfo<GenTable> genList(GenTable genTable) {
         return genTableService.selectPageGenTableList(genTable);
@@ -54,7 +54,7 @@
      * 淇敼浠g爜鐢熸垚涓氬姟
      */
     @ApiOperation("淇敼浠g爜鐢熸垚涓氬姟")
-    @PreAuthorize("@ss.hasPermi('tool:gen:query')")
+    @SaCheckPermission("tool:gen:query")
     @GetMapping(value = "/{talbleId}")
     public AjaxResult<Map<String, Object>> getInfo(@PathVariable Long talbleId) {
         GenTable table = genTableService.selectGenTableById(talbleId);
@@ -71,7 +71,7 @@
      * 鏌ヨ鏁版嵁搴撳垪琛�
      */
     @ApiOperation("鏌ヨ鏁版嵁搴撳垪琛�")
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
+    @SaCheckPermission("tool:gen:list")
     @GetMapping("/db/list")
     public TableDataInfo<GenTable> dataList(GenTable genTable) {
         return genTableService.selectPageDbTableList(genTable);
@@ -81,7 +81,7 @@
      * 鏌ヨ鏁版嵁琛ㄥ瓧娈靛垪琛�
      */
     @ApiOperation("鏌ヨ鏁版嵁琛ㄥ瓧娈靛垪琛�")
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
+    @SaCheckPermission("tool:gen:list")
     @GetMapping(value = "/column/{talbleId}")
     public TableDataInfo<GenTableColumn> columnList(Long tableId) {
         TableDataInfo<GenTableColumn> dataInfo = new TableDataInfo<>();
@@ -95,7 +95,7 @@
      * 瀵煎叆琛ㄧ粨鏋勶紙淇濆瓨锛�
      */
     @ApiOperation("瀵煎叆琛ㄧ粨鏋勶紙淇濆瓨锛�")
-    @PreAuthorize("@ss.hasPermi('tool:gen:import')")
+    @SaCheckPermission("tool:gen:import")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.IMPORT)
     @PostMapping("/importTable")
     public AjaxResult<Void> importTableSave(String tables) {
@@ -110,7 +110,7 @@
      * 淇敼淇濆瓨浠g爜鐢熸垚涓氬姟
      */
     @ApiOperation("淇敼淇濆瓨浠g爜鐢熸垚涓氬姟")
-    @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
+    @SaCheckPermission("tool:gen:edit")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult<Void> editSave(@Validated @RequestBody GenTable genTable) {
@@ -123,7 +123,7 @@
      * 鍒犻櫎浠g爜鐢熸垚
      */
     @ApiOperation("鍒犻櫎浠g爜鐢熸垚")
-    @PreAuthorize("@ss.hasPermi('tool:gen:remove')")
+    @SaCheckPermission("tool:gen:remove")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.DELETE)
     @DeleteMapping("/{tableIds}")
     public AjaxResult<Void> remove(@PathVariable Long[] tableIds) {
@@ -135,7 +135,7 @@
      * 棰勮浠g爜
      */
     @ApiOperation("棰勮浠g爜")
-    @PreAuthorize("@ss.hasPermi('tool:gen:preview')")
+    @SaCheckPermission("tool:gen:preview")
     @GetMapping("/preview/{tableId}")
     public AjaxResult<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
         Map<String, String> dataMap = genTableService.previewCode(tableId);
@@ -146,7 +146,7 @@
      * 鐢熸垚浠g爜锛堜笅杞芥柟寮忥級
      */
     @ApiOperation("鐢熸垚浠g爜锛堜笅杞芥柟寮忥級")
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
+    @SaCheckPermission("tool:gen:code")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.GENCODE)
     @GetMapping("/download/{tableName}")
     public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
@@ -158,7 +158,7 @@
      * 鐢熸垚浠g爜锛堣嚜瀹氫箟璺緞锛�
      */
     @ApiOperation("鐢熸垚浠g爜锛堣嚜瀹氫箟璺緞锛�")
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
+    @SaCheckPermission("tool:gen:code")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
     public AjaxResult<Void> genCode(@PathVariable("tableName") String tableName) {
@@ -170,7 +170,7 @@
      * 鍚屾鏁版嵁搴�
      */
     @ApiOperation("鍚屾鏁版嵁搴�")
-    @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
+    @SaCheckPermission("tool:gen:edit")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.UPDATE)
     @GetMapping("/synchDb/{tableName}")
     public AjaxResult<Void> synchDb(@PathVariable("tableName") String tableName) {
@@ -182,7 +182,7 @@
      * 鎵归噺鐢熸垚浠g爜
      */
     @ApiOperation("鎵归噺鐢熸垚浠g爜")
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
+    @SaCheckPermission("tool:gen:code")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.GENCODE)
     @GetMapping("/batchGenCode")
     public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
@@ -203,4 +203,4 @@
         response.setContentType("application/octet-stream; charset=UTF-8");
         IOUtils.write(data, response.getOutputStream());
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3