From c0144e9d03472072f6c9eecef3f4347520b8328e Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期五, 19 四月 2024 10:47:51 +0800 Subject: [PATCH] 接口权限精确到按钮补充 --- ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java b/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java index 7bdf1b4..1260ea4 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/YwPointController.java @@ -36,55 +36,63 @@ @PostMapping @ApiOperation(value = "娣诲姞", notes = "娣诲姞") + @PreAuthorize("@ss.hasPermi('point:add')") public Result add(@RequestBody @Validated(Add.class) YwPointForm form) { return ywPointService.add(form); } @PostMapping("/batch") @ApiOperation(value = "鎵归噺娣诲姞", notes = "鎵归噺娣诲姞") + @PreAuthorize("@ss.hasPermi('point:add')") public Result batchAdd(@RequestBody @NotEmpty(message = "鏁版嵁涓嶈兘涓虹┖") List<YwPointForm> form) { return ywPointService.batchAdd(form); } @PutMapping @ApiOperation(value = "淇敼", notes = "淇敼") + @PreAuthorize("@ss.hasPermi('point:edit')") public Result update(@RequestBody @Validated(Update.class) YwPointForm form) { return ywPointService.update(form); } @PutMapping("/batch") @ApiOperation(value = "鎵归噺淇敼杩愮淮鍗曚綅", notes = "鎵归噺淇敼杩愮淮鍗曚綅") + @PreAuthorize("@ss.hasPermi('point:edit')") public Result batchEdit(@RequestBody @Validated BatchEditPointForm form) { return ywPointService.batchEdit(form); } @DeleteMapping("/{id}") @ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎") + @PreAuthorize("@ss.hasPermi('point:remove')") public Result removeById(@PathVariable("id") String id) { return ywPointService.removeById(id); } @DeleteMapping("/batch") @ApiOperation(value = "鎵归噺鍒犻櫎", notes = "鎵归噺鍒犻櫎") + @PreAuthorize("@ss.hasPermi('point:remove')") public Result remove(@RequestBody @NotEmpty(message = "璇烽�夋嫨鏁版嵁") List<String> ids) { return ywPointService.remove(ids); } -// @PreAuthorize("@ss.hasPermi('point:page')") @GetMapping("/page") @ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉") + @PreAuthorize("@ss.hasPermi('point:page')") public Result page(YwPointQuery query) { return ywPointService.page(query); } @GetMapping("/{id}") @ApiOperation(value = "璇︽儏", notes = "璇︽儏") + @PreAuthorize("@ss.hasPermi('point:query')") public Result detail(@PathVariable("id") String id) { return ywPointService.detail(id); } @GetMapping("/list") @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃") + @PreAuthorize("@ss.hasPermi('point:list')") public Result list() { return ywPointService.all(); } -- Gitblit v1.8.0