From ee9f604388a3e77d3f4654e326f3976552e7f532 Mon Sep 17 00:00:00 2001 From: Jay <csj123456> Date: 星期一, 25 十一月 2024 13:40:07 +0800 Subject: [PATCH] 测点启用和禁用 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.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/opcua/controller/admin/ChannelOPCUADeviceController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.java index fe43eee..6495268 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.java @@ -7,6 +7,7 @@ import com.iailab.module.data.channel.opcua.service.ChannelOPCUADeviceService; import com.iailab.module.data.channel.opcua.vo.OpcUaDevicePageReqVO; import com.iailab.module.data.channel.opcua.vo.OpcUaDeviceRespVO; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -27,32 +28,37 @@ @Resource private ChannelOPCUADeviceService channelOPCUADeviceService; + @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')") @GetMapping("page") public CommonResult<PageResult<OpcUaDeviceRespVO>> list(@Valid OpcUaDevicePageReqVO reqVO) { PageResult<ChannelOPCUADeviceEntity> page = channelOPCUADeviceService.queryPage(reqVO); return success(BeanUtils.toBean(page, OpcUaDeviceRespVO.class)); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')") @GetMapping("/info/{id}") public CommonResult<ChannelOPCUADeviceEntity> info(@PathVariable("id") String id) { ChannelOPCUADeviceEntity info = channelOPCUADeviceService.info(id); return success(info); } - @PostMapping("/add") - public CommonResult<Boolean> add(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) { + @PreAuthorize("@ss.hasPermission('data:channel-opcua:create')") + @PostMapping("/create") + public CommonResult<Boolean> create(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) { String id = UUID.randomUUID().toString(); channelOPCUADeviceEntity.setId(id); channelOPCUADeviceService.add(channelOPCUADeviceEntity); return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:update')") @PutMapping("/update") public CommonResult<Boolean> update(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) { channelOPCUADeviceService.update(channelOPCUADeviceEntity); return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:delete')") @DeleteMapping("/delete") public CommonResult<Boolean> delete(@RequestParam("id") String id) { channelOPCUADeviceService.delete(id); -- Gitblit v1.9.3