Commit 5e060bb51b1ad5c9945a2ede3ee7ae855652a830

Authored by boyang
1 parent f7eac94e

修改 shop中productcontroller,将postmapping改为getmapping

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