Commit 7aea020ccbc3781d2a3a759126c4a8920cf0b0bb
1 parent
5e060bb5
修改 shop中productcontroller,将postmapping改为getmapping,删除requestbody
Showing
1 changed file
with
8 additions
and
8 deletions
shop/src/main/java/com/canrd/shop/controller/ProductController.java
@@ -38,12 +38,12 @@ public class ProductController { | @@ -38,12 +38,12 @@ public class ProductController { | ||
38 | * @return | 38 | * @return |
39 | */ | 39 | */ |
40 | @GetMapping("/category") | 40 | @GetMapping("/category") |
41 | - public ServerResult category(@RequestBody ProductCategoryQueryVO productCategoryQueryVO){ | 41 | + public ServerResult category(ProductCategoryQueryVO productCategoryQueryVO){ |
42 | return productCategoryService.category(productCategoryQueryVO); | 42 | return productCategoryService.category(productCategoryQueryVO); |
43 | } | 43 | } |
44 | 44 | ||
45 | @GetMapping("/categorySearch") | 45 | @GetMapping("/categorySearch") |
46 | - public ServerResult categorySearch(@RequestBody ProductQueryVO productQueryVO){ | 46 | + public ServerResult categorySearch(ProductQueryVO productQueryVO){ |
47 | return productService.categorySearch(productQueryVO); | 47 | return productService.categorySearch(productQueryVO); |
48 | } | 48 | } |
49 | 49 | ||
@@ -54,7 +54,7 @@ public class ProductController { | @@ -54,7 +54,7 @@ public class ProductController { | ||
54 | * @return 查询结果 | 54 | * @return 查询结果 |
55 | */ | 55 | */ |
56 | @GetMapping("/list") | 56 | @GetMapping("/list") |
57 | - public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ProductQueryVO productQueryVO) { | 57 | + public ServerResult list(@Validated({OperateGroup.List.class}) ProductQueryVO productQueryVO) { |
58 | return productService.listBySimilar(productQueryVO); | 58 | return productService.listBySimilar(productQueryVO); |
59 | } | 59 | } |
60 | 60 | ||
@@ -65,7 +65,7 @@ public class ProductController { | @@ -65,7 +65,7 @@ public class ProductController { | ||
65 | * @return 单条数据 | 65 | * @return 单条数据 |
66 | */ | 66 | */ |
67 | @GetMapping("/detail") | 67 | @GetMapping("/detail") |
68 | - public ServerResult queryById(@RequestBody ProductQueryVO productQueryVO) { | 68 | + public ServerResult queryById(ProductQueryVO productQueryVO) { |
69 | return productService.queryById(productQueryVO); | 69 | return productService.queryById(productQueryVO); |
70 | } | 70 | } |
71 | 71 | ||
@@ -76,7 +76,7 @@ public class ProductController { | @@ -76,7 +76,7 @@ public class ProductController { | ||
76 | * @return 新增结果 | 76 | * @return 新增结果 |
77 | */ | 77 | */ |
78 | @GetMapping("/add") | 78 | @GetMapping("/add") |
79 | - public ServerResult add(@RequestBody ProductVO productVO) { | 79 | + public ServerResult add(ProductVO productVO) { |
80 | return productService.add(productVO); | 80 | return productService.add(productVO); |
81 | } | 81 | } |
82 | 82 | ||
@@ -87,7 +87,7 @@ public class ProductController { | @@ -87,7 +87,7 @@ public class ProductController { | ||
87 | * @return 编辑结果 | 87 | * @return 编辑结果 |
88 | */ | 88 | */ |
89 | @GetMapping("/edit") | 89 | @GetMapping("/edit") |
90 | - public ServerResult edit(@RequestBody ProductVO productVO) { | 90 | + public ServerResult edit(ProductVO productVO) { |
91 | return productService.edit(productVO); | 91 | return productService.edit(productVO); |
92 | } | 92 | } |
93 | 93 | ||
@@ -98,12 +98,12 @@ public class ProductController { | @@ -98,12 +98,12 @@ public class ProductController { | ||
98 | * @return 删除是否成功 | 98 | * @return 删除是否成功 |
99 | */ | 99 | */ |
100 | @GetMapping("/delete_by_id") | 100 | @GetMapping("/delete_by_id") |
101 | - public ServerResult deleteById(@RequestBody ProductQueryVO productQueryVO) { | 101 | + public ServerResult deleteById(ProductQueryVO productQueryVO) { |
102 | return productService.deleteById(productQueryVO); | 102 | return productService.deleteById(productQueryVO); |
103 | } | 103 | } |
104 | 104 | ||
105 | //@PostMapping("/chatgpt") | 105 | //@PostMapping("/chatgpt") |
106 | - public ServerResult chatgpt(@RequestBody ProductQueryVO productQueryVO){ | 106 | + public ServerResult chatgpt(ProductQueryVO productQueryVO){ |
107 | return productService.chatgpt(productQueryVO); | 107 | return productService.chatgpt(productQueryVO); |
108 | } | 108 | } |
109 | 109 |