Authored by zhaoqing

回滚

@@ -2,7 +2,6 @@ package com.yoho.activity.queue.restapi; @@ -2,7 +2,6 @@ package com.yoho.activity.queue.restapi;
2 2
3 import com.yoho.activity.queue.ApiResponse; 3 import com.yoho.activity.queue.ApiResponse;
4 import com.yoho.activity.queue.service.IProductLimitUserHelpService; 4 import com.yoho.activity.queue.service.IProductLimitUserHelpService;
5 -import com.yoho.core.rest.annotation.ServiceDesc;  
6 import com.yoho.service.model.activity.drawline.request.LimitProductHelpUserRequestBO; 5 import com.yoho.service.model.activity.drawline.request.LimitProductHelpUserRequestBO;
7 import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserListBO; 6 import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserListBO;
8 import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserRespBO; 7 import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserRespBO;
@@ -19,7 +18,6 @@ import java.util.List; @@ -19,7 +18,6 @@ import java.util.List;
19 * Created by qing.zhao on 2018/6/14. 18 * Created by qing.zhao on 2018/6/14.
20 */ 19 */
21 @Controller 20 @Controller
22 -@ServiceDesc("activity")  
23 public class ProductLimitUserHelpRest { 21 public class ProductLimitUserHelpRest {
24 22
25 private static Logger logger = LoggerFactory.getLogger(ProductLimitUserHelpRest.class); 23 private static Logger logger = LoggerFactory.getLogger(ProductLimitUserHelpRest.class);
@@ -27,18 +25,34 @@ public class ProductLimitUserHelpRest { @@ -27,18 +25,34 @@ public class ProductLimitUserHelpRest {
27 @Autowired 25 @Autowired
28 private IProductLimitUserHelpService iProductLimitUserHelpService; 26 private IProductLimitUserHelpService iProductLimitUserHelpService;
29 27
30 - @RequestMapping(value = "/queryHelpInfo") 28 + @RequestMapping(params = "method=app.limitProduct.queryHelpInfo")
31 @ResponseBody 29 @ResponseBody
32 public ApiResponse queryHelpInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) { 30 public ApiResponse queryHelpInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
33 logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO); 31 logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO);
  32 + if (null == limitProductHelpUserRequestBO){
  33 + logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO);
  34 + return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
  35 + }
  36 + if(null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode()){
  37 + return new ApiResponse.ApiResponseBuilder().code(400).message("用户Id或限定商品Code不可为空").build();
  38 + }
34 LimitProductHelpUserListBO limitProductHelpUserList = iProductLimitUserHelpService.queryHelpInfo(limitProductHelpUserRequestBO); 39 LimitProductHelpUserListBO limitProductHelpUserList = iProductLimitUserHelpService.queryHelpInfo(limitProductHelpUserRequestBO);
  40 +
35 return new ApiResponse.ApiResponseBuilder().code(200).data(limitProductHelpUserList).message("获取助力用户信息成功").build(); 41 return new ApiResponse.ApiResponseBuilder().code(200).data(limitProductHelpUserList).message("获取助力用户信息成功").build();
36 } 42 }
37 43
38 - @RequestMapping(value = "/addHelpUserInfo") 44 + @RequestMapping(params = "method=app.limitProduct.addHelpUserInfo")
39 @ResponseBody 45 @ResponseBody
40 public ApiResponse addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) { 46 public ApiResponse addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
41 logger.info("ProductLimitUserHelpRest addHelpUserInfo params is{}", limitProductHelpUserRequestBO); 47 logger.info("ProductLimitUserHelpRest addHelpUserInfo params is{}", limitProductHelpUserRequestBO);
  48 + if (null == limitProductHelpUserRequestBO){
  49 + logger.info("ProductLimitUserHelpRest addHelpUserInfo result can not null");
  50 + return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
  51 + }
  52 + if (null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode() || null == limitProductHelpUserRequestBO.getHelpUserId()){
  53 + logger.info("ProductLimitUserHelpRest addHelpUserInfo missing params ");
  54 + return new ApiResponse.ApiResponseBuilder().code(400).message("入参不完整,缺少入参").build();
  55 + }
42 //判断用户是否已经助力 56 //判断用户是否已经助力
43 Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO); 57 Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO);
44 if (flag){ 58 if (flag){
@@ -50,10 +64,19 @@ public class ProductLimitUserHelpRest { @@ -50,10 +64,19 @@ public class ProductLimitUserHelpRest {
50 return new ApiResponse.ApiResponseBuilder().code(200).message("用户助力成功").build(); 64 return new ApiResponse.ApiResponseBuilder().code(200).message("用户助力成功").build();
51 } 65 }
52 66
53 - @RequestMapping(value = "/addShareInfo") 67 + @RequestMapping(params = "method=app.limitProduct.addShareInfo")
54 @ResponseBody 68 @ResponseBody
55 public ApiResponse addShareInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) { 69 public ApiResponse addShareInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
56 logger.info("ProductLimitUserHelpRest addShareInfo params is{}", limitProductHelpUserRequestBO); 70 logger.info("ProductLimitUserHelpRest addShareInfo params is{}", limitProductHelpUserRequestBO);
  71 + if (null == limitProductHelpUserRequestBO){
  72 + logger.info("ProductLimitUserHelpRest addShareInfo params can not null");
  73 + return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
  74 + }
  75 + if (null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode() || null == limitProductHelpUserRequestBO.getIsShare()){
  76 + logger.info("ProductLimitUserHelpRest addShareInfo missing params ");
  77 + return new ApiResponse.ApiResponseBuilder().code(400).message("入参不完整,缺少入参").build();
  78 + }
  79 +
57 iProductLimitUserHelpService.addShareInfo(limitProductHelpUserRequestBO); 80 iProductLimitUserHelpService.addShareInfo(limitProductHelpUserRequestBO);
58 logger.info("ProductLimitUserHelpRest addShareInfo success"); 81 logger.info("ProductLimitUserHelpRest addShareInfo success");
59 return new ApiResponse.ApiResponseBuilder().code(200).message("用户增加是否分享信息成功").build(); 82 return new ApiResponse.ApiResponseBuilder().code(200).message("用户增加是否分享信息成功").build();