From 58c9a2995d3608b171e43d2e6ba937f58e8484d4 Mon Sep 17 00:00:00 2001 From: ronger Date: Thu, 21 Mar 2024 09:28:46 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=AE=8C=E5=96=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rymcu/forest/web/api/product/ProductController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/rymcu/forest/web/api/product/ProductController.java b/src/main/java/com/rymcu/forest/web/api/product/ProductController.java index f54dfa0..9e84980 100644 --- a/src/main/java/com/rymcu/forest/web/api/product/ProductController.java +++ b/src/main/java/com/rymcu/forest/web/api/product/ProductController.java @@ -26,6 +26,7 @@ import javax.annotation.Resource; */ @RestController @RequestMapping("/api/v1/product") +@RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public class ProductController { @Resource @@ -38,14 +39,12 @@ public class ProductController { } @PostMapping("/post") - @RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public GlobalResult add(@RequestBody ProductDTO product) { Product newProduct = productService.postProduct(product); return GlobalResultGenerator.genSuccessResult(newProduct); } @PutMapping("/post") - @RequiresRoles(value = {"blog_admin", "admin"}, logical = Logical.OR) public GlobalResult update(@RequestBody ProductDTO product) { if (product.getIdProduct() == null || product.getIdProduct() == 0) { throw new IllegalArgumentException("产品主键参数异常!");