Authored by liangyi.chen@yoho.cn

Fix

@@ -27,17 +27,17 @@ public class GrassFindgoodsController { @@ -27,17 +27,17 @@ public class GrassFindgoodsController {
27 27
28 @RequestMapping("/deleteFindgoods") 28 @RequestMapping("/deleteFindgoods")
29 @ResponseBody 29 @ResponseBody
30 - public ApiResponse deleteFindgoods(@RequestParam("id") Integer id){  
31 - logger.info("enter deleteFindgoods.param is {}",id);  
32 - grassFindgoodsService.deleteFindgoods(id); 30 + public ApiResponse deleteFindgoods(@RequestBody GrassFindgoodsReq req){
  31 + logger.info("enter deleteFindgoods.param is {}",req.getId());
  32 + grassFindgoodsService.deleteFindgoods(req.getId());
33 return new ApiResponse.ApiResponseBuilder().build(); 33 return new ApiResponse.ApiResponseBuilder().build();
34 } 34 }
35 35
36 @RequestMapping("/updateOrderBy") 36 @RequestMapping("/updateOrderBy")
37 @ResponseBody 37 @ResponseBody
38 - public ApiResponse updateOrderBy(@RequestParam("id") Integer id,@RequestParam("orderBy") Integer orderBy){  
39 - logger.info("enter deleteFindgoods.param is {}",id);  
40 - grassFindgoodsService.updateOrderBy(id,orderBy); 38 + public ApiResponse updateOrderBy(@RequestBody GrassFindgoodsReq req){
  39 + logger.info("enter deleteFindgoods.param is {}",req.getId());
  40 + grassFindgoodsService.updateOrderBy(req.getId(),req.getOrderBy());
41 return new ApiResponse.ApiResponseBuilder().build(); 41 return new ApiResponse.ApiResponseBuilder().build();
42 } 42 }
43 43
@@ -79,12 +79,18 @@ public class GrassFindgoodsServiceImpl implements IGrassFindgoodsService { @@ -79,12 +79,18 @@ public class GrassFindgoodsServiceImpl implements IGrassFindgoodsService {
79 79
80 @Override 80 @Override
81 public void deleteFindgoods(Integer id) { 81 public void deleteFindgoods(Integer id) {
  82 + if(id == null){
  83 + return;
  84 + }
82 logger.info("enter deleteFindgoods, id is {}", id); 85 logger.info("enter deleteFindgoods, id is {}", id);
83 grassFindGoodsDAO.deleteById(id); 86 grassFindGoodsDAO.deleteById(id);
84 } 87 }
85 88
86 @Override 89 @Override
87 public void updateOrderBy(Integer id, Integer orderBy) { 90 public void updateOrderBy(Integer id, Integer orderBy) {
  91 + if(id == null || orderBy == null){
  92 + return;
  93 + }
88 grassFindGoodsDAO.updateOrderBy(id,orderBy); 94 grassFindGoodsDAO.updateOrderBy(id,orderBy);
89 } 95 }
90 } 96 }