From 8c41fe94af2f3b94a913289c8f8c3d687037a00b Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期五, 20 九月 2024 09:39:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDADeviceController.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDADeviceController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDADeviceController.java
index 87693ea..c3331de 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDADeviceController.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDADeviceController.java
@@ -8,6 +8,7 @@
 import com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO;
 import com.iailab.module.data.channel.opcda.vo.OpcDaDeviceRespVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -28,20 +29,23 @@
     @Autowired
     private ChannelOPCDADeviceService channelOPCDADeviceService;
 
+    @PreAuthorize("@ss.hasPermission('data:channel-opcda:query')")
     @GetMapping("page")
     public CommonResult<PageResult<OpcDaDeviceRespVO>> list(@Valid OpcDaDevicePageReqVO reqVO) {
         PageResult<ChannelOPCDADeviceEntity> page = channelOPCDADeviceService.queryPage(reqVO);
         return success(BeanUtils.toBean(page, OpcDaDeviceRespVO.class));
     }
 
+    @PreAuthorize("@ss.hasPermission('data:channel-opcda:query')")
     @GetMapping("/info/{id}")
     public CommonResult<ChannelOPCDADeviceEntity> info(@PathVariable("id") String id) {
         ChannelOPCDADeviceEntity info = channelOPCDADeviceService.info(id);
         return success(info);
     }
 
-    @PostMapping("/add")
-    public CommonResult<Boolean> add(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
+    @PreAuthorize("@ss.hasPermission('data:channel-opcda:create')")
+    @PostMapping("/create")
+    public CommonResult<Boolean> create(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
         String id = UUID.randomUUID().toString();
         channelOPCDADeviceEntity.setId(id);
         channelOPCDADeviceEntity.setCreateTime(new Date());
@@ -49,6 +53,7 @@
         return success(true);
     }
 
+    @PreAuthorize("@ss.hasPermission('data:channel-opcda:update')")
     @PutMapping("/update")
     public CommonResult<Boolean> update(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
         channelOPCDADeviceEntity.setUpdateTime(new Date());
@@ -56,6 +61,7 @@
         return success(true);
     }
 
+    @PreAuthorize("@ss.hasPermission('data:channel-opcda:delete')")
     @DeleteMapping("/delete")
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         channelOPCDADeviceService.delete(id);

--
Gitblit v1.9.3