...
|
...
|
@@ -2,7 +2,6 @@ package com.yoho.activity.queue.restapi; |
|
|
|
|
|
import com.yoho.activity.queue.ApiResponse;
|
|
|
import com.yoho.activity.queue.service.IProductLimitUserHelpService;
|
|
|
import com.yoho.core.rest.annotation.ServiceDesc;
|
|
|
import com.yoho.service.model.activity.drawline.request.LimitProductHelpUserRequestBO;
|
|
|
import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserListBO;
|
|
|
import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserRespBO;
|
...
|
...
|
@@ -19,7 +18,6 @@ import java.util.List; |
|
|
* Created by qing.zhao on 2018/6/14.
|
|
|
*/
|
|
|
@Controller
|
|
|
@ServiceDesc("activity")
|
|
|
public class ProductLimitUserHelpRest {
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(ProductLimitUserHelpRest.class);
|
...
|
...
|
@@ -27,18 +25,34 @@ public class ProductLimitUserHelpRest { |
|
|
@Autowired
|
|
|
private IProductLimitUserHelpService iProductLimitUserHelpService;
|
|
|
|
|
|
@RequestMapping(value = "/queryHelpInfo")
|
|
|
@RequestMapping(params = "method=app.limitProduct.queryHelpInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse queryHelpInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO);
|
|
|
if (null == limitProductHelpUserRequestBO){
|
|
|
logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO);
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
|
|
|
}
|
|
|
if(null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode()){
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("用户Id或限定商品Code不可为空").build();
|
|
|
}
|
|
|
LimitProductHelpUserListBO limitProductHelpUserList = iProductLimitUserHelpService.queryHelpInfo(limitProductHelpUserRequestBO);
|
|
|
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).data(limitProductHelpUserList).message("获取助力用户信息成功").build();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/addHelpUserInfo")
|
|
|
@RequestMapping(params = "method=app.limitProduct.addHelpUserInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
logger.info("ProductLimitUserHelpRest addHelpUserInfo params is{}", limitProductHelpUserRequestBO);
|
|
|
if (null == limitProductHelpUserRequestBO){
|
|
|
logger.info("ProductLimitUserHelpRest addHelpUserInfo result can not null");
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
|
|
|
}
|
|
|
if (null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode() || null == limitProductHelpUserRequestBO.getHelpUserId()){
|
|
|
logger.info("ProductLimitUserHelpRest addHelpUserInfo missing params ");
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("入参不完整,缺少入参").build();
|
|
|
}
|
|
|
//判断用户是否已经助力
|
|
|
Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO);
|
|
|
if (flag){
|
...
|
...
|
@@ -50,10 +64,19 @@ public class ProductLimitUserHelpRest { |
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("用户助力成功").build();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/addShareInfo")
|
|
|
@RequestMapping(params = "method=app.limitProduct.addShareInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse addShareInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
logger.info("ProductLimitUserHelpRest addShareInfo params is{}", limitProductHelpUserRequestBO);
|
|
|
if (null == limitProductHelpUserRequestBO){
|
|
|
logger.info("ProductLimitUserHelpRest addShareInfo params can not null");
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("入参不可为空").build();
|
|
|
}
|
|
|
if (null == limitProductHelpUserRequestBO.getUserId() || null == limitProductHelpUserRequestBO.getLimitProductCode() || null == limitProductHelpUserRequestBO.getIsShare()){
|
|
|
logger.info("ProductLimitUserHelpRest addShareInfo missing params ");
|
|
|
return new ApiResponse.ApiResponseBuilder().code(400).message("入参不完整,缺少入参").build();
|
|
|
}
|
|
|
|
|
|
iProductLimitUserHelpService.addShareInfo(limitProductHelpUserRequestBO);
|
|
|
logger.info("ProductLimitUserHelpRest addShareInfo success");
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("用户增加是否分享信息成功").build();
|
...
|
...
|
|