From a28ca3f36d0ace05966a8c0fac1e4b5fe921f882 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期三, 30 十月 2024 16:25:12 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java index 66a8a54..c014183 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java @@ -7,10 +7,12 @@ import com.iailab.module.data.channel.http.service.HttpTagService; import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO; import com.iailab.module.data.channel.http.vo.HttpTagRespVO; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Date; import java.util.List; import java.util.UUID; @@ -23,44 +25,51 @@ * @createTime 2024年08月27日 */ @RestController -@RequestMapping("/data/http/tag") +@RequestMapping("/data/channel/http/tag") public class HttpTagController { @Resource private HttpTagService tagService; + @PreAuthorize("@ss.hasPermission('data:channel-http:query')") @GetMapping("page") public CommonResult<PageResult<HttpTagRespVO>> page(@Valid HttpTagPageReqVO reqVO) { PageResult<HttpTagEntity> page = tagService.queryPage(reqVO); return success(BeanUtils.toBean(page, HttpTagRespVO.class)); } + @PreAuthorize("@ss.hasPermission('data:channel-http:query')") @GetMapping("list") public CommonResult<List<HttpTagEntity>> list(){ List<HttpTagEntity> list = tagService.list(); return new CommonResult<List<HttpTagEntity>>().setData(list); } + @PreAuthorize("@ss.hasPermission('data:channel-http:query')") @GetMapping("/info/{id}") public CommonResult<HttpTagEntity> info(@PathVariable("id") String id){ HttpTagEntity info= tagService.info(id); return success(info); } - @PostMapping("/add") - public CommonResult<Boolean> add(@RequestBody HttpTagEntity httpTagEntity){ - String id = UUID.randomUUID().toString(); - httpTagEntity.setId(id); + @PreAuthorize("@ss.hasPermission('data:channel-http:create')") + @PostMapping("/create") + public CommonResult<Boolean> create(@RequestBody HttpTagEntity httpTagEntity){ + httpTagEntity.setId(UUID.randomUUID().toString()); + httpTagEntity.setCreateTime(new Date()); tagService.add(httpTagEntity); return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-http:update')") @PutMapping("/update") public CommonResult<Boolean> update(@RequestBody HttpTagEntity httpTagEntity) { + httpTagEntity.setUpdateTime(new Date()); tagService.update(httpTagEntity); return success(true); } + @PreAuthorize("@ss.hasPermission('data:channel-http:delete')") @DeleteMapping("/delete") public CommonResult<Boolean> delete(@RequestParam("id") String id) { tagService.delete(id); -- Gitblit v1.9.3