From abba5418ce295904c82b6cceaad7ccf9c05fada3 Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期三, 18 九月 2024 17:49:24 +0800
Subject: [PATCH] 添加权限校验

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
index 57fd8c4..8ff66ab 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java
@@ -8,6 +8,7 @@
 import com.iailab.module.model.mcs.pre.vo.MmItemTypeRespVO;
 import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO;
 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.*;
 
@@ -19,7 +20,7 @@
  * @date 2021年04月22日 9:57
  */
 @RestController
-@RequestMapping("/pre/result-table")
+@RequestMapping("/model/pre/result-table")
 public class MmResultTableController {
 
     @Autowired
@@ -29,6 +30,7 @@
      * 结果存放列表
      */
     @GetMapping("/page")
+    @PreAuthorize("@ss.hasPermission('model:pre-result:query')")
     public CommonResult<PageResult<MmItemTypeRespVO>> page(@Validated MmResultTablePageReqVO reqVO) {
         PageResult<MmResultTableEntity> page = mmResultTableService.page(reqVO);
 
@@ -36,6 +38,7 @@
     }
 
     @GetMapping("/get/{id}")
+    @PreAuthorize("@ss.hasPermission('model:pre-result:query')")
     public CommonResult<MmResultTableEntity> info(@PathVariable("id") String id){
         MmResultTableEntity resultTable = mmResultTableService.selectById(id);
 
@@ -46,6 +49,7 @@
      * 保存结果存放
      */
     @PostMapping("/create")
+    @PreAuthorize("@ss.hasPermission('model:pre-result:create')")
     public CommonResult<Boolean> save(@RequestBody MmResultTableEntity resultTable){
         int count = mmResultTableService.check(resultTable);
         if (count > 0) {
@@ -59,6 +63,7 @@
      * 修改结果存放
      */
     @PutMapping("/update")
+    @PreAuthorize("@ss.hasPermission('model:pre-result:update')")
     public CommonResult<Boolean> update(@RequestBody MmResultTableEntity resultTable){
         int count = mmResultTableService.check(resultTable);
         if (count > 0) {
@@ -72,6 +77,7 @@
      * 删除结果存放
      */
     @DeleteMapping("/delete")
+    @PreAuthorize("@ss.hasPermission('model:pre-result:delete')")
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         mmResultTableService.deleteBatch(new String[]{id});
         return success(true);

--
Gitblit v1.9.3