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/ChannelOPCDATagController.java | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDATagController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDATagController.java index 77f35e7..2a6fb45 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDATagController.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/admin/ChannelOPCDATagController.java @@ -9,6 +9,7 @@ import com.iailab.module.data.channel.opcda.vo.OpcDaTagRespVO; import com.iailab.module.data.common.exception.RRException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -29,21 +30,24 @@ public class ChannelOPCDATagController { @Autowired private ChannelOPCDATagService channelOPCDATagService; - + + @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')") @GetMapping("page") public CommonResult<PageResult<OpcDaTagRespVO>> list(@Valid OpcDaTagPageReqVO reqVO) { PageResult<ChannelOPCDATagEntity> page = channelOPCDATagService.queryPage(reqVO); return success(BeanUtils.toBean(page, OpcDaTagRespVO.class)); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:query')") @GetMapping("/info/{id}") public CommonResult<ChannelOPCDATagEntity> info(@PathVariable("id") String id) { ChannelOPCDATagEntity info = channelOPCDATagService.info(id); return success(info); } - @PostMapping("/add") - public CommonResult<Boolean> add(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) { + @PreAuthorize("@ss.hasPermission('data:channel-opcua:create')") + @PostMapping("/create") + public CommonResult<Boolean> create(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) { String id = UUID.randomUUID().toString(); channelOPCDATagEntity.setId(id); channelOPCDATagEntity.setCreateTime(new Date()); @@ -51,6 +55,7 @@ return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:update')") @PutMapping("/update") public CommonResult<Boolean> update(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) { channelOPCDATagEntity.setUpdateTime(new Date()); @@ -58,11 +63,13 @@ return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-opcua:delete')") @DeleteMapping("/delete") public CommonResult<Boolean> delete(@RequestParam("id") String id) { channelOPCDATagService.delete(id); return success(true); } + @PostMapping("/import/{serverId}") public CommonResult<String> importTag(@PathVariable("serverId") String serverId, @RequestParam("file") MultipartFile file) { try { -- Gitblit v1.9.3