Commit 5e060bb51b1ad5c9945a2ede3ee7ae855652a830
1 parent
f7eac94e
修改 shop中productcontroller,将postmapping改为getmapping
Showing
1 changed file
with
8 additions
and
11 deletions
shop/src/main/java/com/canrd/shop/controller/ProductController.java
@@ -9,10 +9,7 @@ import com.canrd.shop.service.ProductCategoryService; | @@ -9,10 +9,7 @@ import com.canrd.shop.service.ProductCategoryService; | ||
9 | import com.canrd.shop.service.ProductService; | 9 | import com.canrd.shop.service.ProductService; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
12 | -import org.springframework.web.bind.annotation.PostMapping; | ||
13 | -import org.springframework.web.bind.annotation.RequestBody; | ||
14 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
15 | -import org.springframework.web.bind.annotation.RestController; | 12 | +import org.springframework.web.bind.annotation.*; |
16 | 13 | ||
17 | import javax.annotation.Resource; | 14 | import javax.annotation.Resource; |
18 | 15 | ||
@@ -40,12 +37,12 @@ public class ProductController { | @@ -40,12 +37,12 @@ public class ProductController { | ||
40 | * @param productCategoryQueryVO | 37 | * @param productCategoryQueryVO |
41 | * @return | 38 | * @return |
42 | */ | 39 | */ |
43 | - @PostMapping("/category") | 40 | + @GetMapping("/category") |
44 | public ServerResult category(@RequestBody ProductCategoryQueryVO productCategoryQueryVO){ | 41 | public ServerResult category(@RequestBody ProductCategoryQueryVO productCategoryQueryVO){ |
45 | return productCategoryService.category(productCategoryQueryVO); | 42 | return productCategoryService.category(productCategoryQueryVO); |
46 | } | 43 | } |
47 | 44 | ||
48 | - @PostMapping("/categorySearch") | 45 | + @GetMapping("/categorySearch") |
49 | public ServerResult categorySearch(@RequestBody ProductQueryVO productQueryVO){ | 46 | public ServerResult categorySearch(@RequestBody ProductQueryVO productQueryVO){ |
50 | return productService.categorySearch(productQueryVO); | 47 | return productService.categorySearch(productQueryVO); |
51 | } | 48 | } |
@@ -56,7 +53,7 @@ public class ProductController { | @@ -56,7 +53,7 @@ public class ProductController { | ||
56 | * @param productQueryVO 查询条件 | 53 | * @param productQueryVO 查询条件 |
57 | * @return 查询结果 | 54 | * @return 查询结果 |
58 | */ | 55 | */ |
59 | - @PostMapping("/list") | 56 | + @GetMapping("/list") |
60 | public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ProductQueryVO productQueryVO) { | 57 | public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ProductQueryVO productQueryVO) { |
61 | return productService.listBySimilar(productQueryVO); | 58 | return productService.listBySimilar(productQueryVO); |
62 | } | 59 | } |
@@ -67,7 +64,7 @@ public class ProductController { | @@ -67,7 +64,7 @@ public class ProductController { | ||
67 | * @param productQueryVO 查询条件 | 64 | * @param productQueryVO 查询条件 |
68 | * @return 单条数据 | 65 | * @return 单条数据 |
69 | */ | 66 | */ |
70 | - @PostMapping("/detail") | 67 | + @GetMapping("/detail") |
71 | public ServerResult queryById(@RequestBody ProductQueryVO productQueryVO) { | 68 | public ServerResult queryById(@RequestBody ProductQueryVO productQueryVO) { |
72 | return productService.queryById(productQueryVO); | 69 | return productService.queryById(productQueryVO); |
73 | } | 70 | } |
@@ -78,7 +75,7 @@ public class ProductController { | @@ -78,7 +75,7 @@ public class ProductController { | ||
78 | * @param productVO 数据VO | 75 | * @param productVO 数据VO |
79 | * @return 新增结果 | 76 | * @return 新增结果 |
80 | */ | 77 | */ |
81 | - @PostMapping("/add") | 78 | + @GetMapping("/add") |
82 | public ServerResult add(@RequestBody ProductVO productVO) { | 79 | public ServerResult add(@RequestBody ProductVO productVO) { |
83 | return productService.add(productVO); | 80 | return productService.add(productVO); |
84 | } | 81 | } |
@@ -89,7 +86,7 @@ public class ProductController { | @@ -89,7 +86,7 @@ public class ProductController { | ||
89 | * @param productVO 数据VO | 86 | * @param productVO 数据VO |
90 | * @return 编辑结果 | 87 | * @return 编辑结果 |
91 | */ | 88 | */ |
92 | - @PostMapping("/edit") | 89 | + @GetMapping("/edit") |
93 | public ServerResult edit(@RequestBody ProductVO productVO) { | 90 | public ServerResult edit(@RequestBody ProductVO productVO) { |
94 | return productService.edit(productVO); | 91 | return productService.edit(productVO); |
95 | } | 92 | } |
@@ -100,7 +97,7 @@ public class ProductController { | @@ -100,7 +97,7 @@ public class ProductController { | ||
100 | * @param productQueryVO 查询条件 | 97 | * @param productQueryVO 查询条件 |
101 | * @return 删除是否成功 | 98 | * @return 删除是否成功 |
102 | */ | 99 | */ |
103 | - @PostMapping("/delete_by_id") | 100 | + @GetMapping("/delete_by_id") |
104 | public ServerResult deleteById(@RequestBody ProductQueryVO productQueryVO) { | 101 | public ServerResult deleteById(@RequestBody ProductQueryVO productQueryVO) { |
105 | return productService.deleteById(productQueryVO); | 102 | return productService.deleteById(productQueryVO); |
106 | } | 103 | } |