From 3e18d4bfbf2c657b08b21512c2d884cc9d59df7b Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期一, 14 十月 2024 16:29:49 +0800
Subject: [PATCH] 模型运行

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusDeviceController.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusDeviceController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusDeviceController.java
index a59347e..f11d797 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusDeviceController.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusDeviceController.java
@@ -8,9 +8,10 @@
 import com.iailab.module.data.channel.modbus.service.ChannelModbusDeviceService;
 
 import javax.annotation.Resource;
-import javax.validation.Valid;
 
 import com.iailab.module.data.channel.modbus.vo.ModBusDeviceRespVO;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.UUID;
@@ -34,8 +35,9 @@
      *
      * @param reqVO
      */
+    @PreAuthorize("@ss.hasPermission('data:channel-modbus:query')")
     @GetMapping("/page")
-    public CommonResult<PageResult<ModBusDeviceRespVO>> list(@Valid ModBusDevicePageReqVO reqVO) {
+    public CommonResult<PageResult<ModBusDeviceRespVO>> list(@Validated ModBusDevicePageReqVO reqVO) {
         PageResult<ChannelModBusDeviceEntity> page = channelModbusDeviceService.queryPage(reqVO);
 
         return success(BeanUtils.toBean(page, ModBusDeviceRespVO.class));
@@ -46,6 +48,7 @@
      *
      * @param id
      */
+    @PreAuthorize("@ss.hasPermission('data:channel-modbus:query')")
     @GetMapping("/info/{id}")
     public CommonResult<ChannelModBusDeviceEntity> info(@PathVariable("id") String id) {
         ChannelModBusDeviceEntity info = channelModbusDeviceService.info(id);
@@ -57,8 +60,9 @@
      *
      * @param channelModBusDeviceEntity
      */
-    @PostMapping("/add")
-    public CommonResult<Boolean> add(@RequestBody ChannelModBusDeviceEntity channelModBusDeviceEntity) {
+    @PreAuthorize("@ss.hasPermission('data:channel-modbus:create')")
+    @PostMapping("/create")
+    public CommonResult<Boolean> create(@RequestBody ChannelModBusDeviceEntity channelModBusDeviceEntity) {
         String id = UUID.randomUUID().toString();
         channelModBusDeviceEntity.setId(id);
         channelModbusDeviceService.add(channelModBusDeviceEntity);
@@ -70,6 +74,7 @@
      *
      * @param channelModBusDeviceEntity
      */
+    @PreAuthorize("@ss.hasPermission('data:channel-modbus:update')")
     @PutMapping("/update")
     public CommonResult<Boolean> update(@RequestBody ChannelModBusDeviceEntity channelModBusDeviceEntity) {
         channelModbusDeviceService.update(channelModBusDeviceEntity);
@@ -81,6 +86,7 @@
      *
      * @param id
      */
+    @PreAuthorize("@ss.hasPermission('data:channel-modbus:delete')")
     @DeleteMapping("/delete")
     public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         channelModbusDeviceService.delete(id);

--
Gitblit v1.9.3