...
|
...
|
@@ -2,6 +2,7 @@ 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;
|
...
|
...
|
@@ -9,6 +10,7 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
...
|
...
|
@@ -18,6 +20,7 @@ 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);
|
...
|
...
|
@@ -25,34 +28,18 @@ public class ProductLimitUserHelpRest { |
|
|
@Autowired
|
|
|
private IProductLimitUserHelpService iProductLimitUserHelpService;
|
|
|
|
|
|
@RequestMapping(params = "method=app.limitProduct.queryHelpInfo")
|
|
|
@RequestMapping("/queryHelpInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse queryHelpInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
public ApiResponse queryHelpInfo(@RequestBody 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(params = "method=app.limitProduct.addHelpUserInfo")
|
|
|
@RequestMapping("/addHelpUserInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse addHelpUserInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
public ApiResponse addHelpUserInfo(@RequestBody 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 limitFlag = iProductLimitUserHelpService.judgeHelpUserNumMoreLimit(limitProductHelpUserRequestBO);
|
|
|
if (limitFlag){
|
...
|
...
|
@@ -70,19 +57,10 @@ public class ProductLimitUserHelpRest { |
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("用户助力成功").build();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(params = "method=app.limitProduct.addShareInfo")
|
|
|
@RequestMapping("/addShareInfo")
|
|
|
@ResponseBody
|
|
|
public ApiResponse addShareInfo(LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
|
|
|
public ApiResponse addShareInfo(@RequestBody 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();
|
...
|
...
|
|