Authored by zhaoqing

代码回滚

... ... @@ -115,6 +115,22 @@ public class DrawlineUserQueueRest {
}
return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build();
}
@RequestMapping("/getMyQueueList")
@ResponseBody
public ApiResponse getMyQueueList(@RequestBody DrawlineUserQueueReqBO drawlineUserQueueReqBO) {
logger.info("Enter getMyQueueList. param drawlineUserQueueReqBO is {}", drawlineUserQueueReqBO);
int code = 200;
String message = "";
DrawlineUserQueueRespBO[] data = new DrawlineUserQueueRespBO[0];
try {
data = drawlineUserQueueService.getMyDrawlineUserQueueList(drawlineUserQueueReqBO);
} catch (ServiceException e) {
code = e.getCode();
message = e.getErrorMessage();
}
return new ApiResponse.ApiResponseBuilder().code(code).message(message).data(data).build();
}
///////////////////////////////////////////////////////////////////////////////////////////////
... ...
... ... @@ -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();
... ...
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 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;
/**
* Created by qing.zhao on 2018/6/14.
*/
@Controller
@ServiceDesc("activity")
public class ProductLimitUserHelpRestCopy {
private static Logger logger = LoggerFactory.getLogger(ProductLimitUserHelpRestCopy.class);
@Autowired
private IProductLimitUserHelpService iProductLimitUserHelpService;
@RequestMapping(value = "/queryHelpInfoCopy")
@ResponseBody
public ApiResponse queryHelpInfoCopy(@RequestBody LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
logger.info("ProductLimitUserHelpRest queryHelpInfo params is{}", limitProductHelpUserRequestBO);
LimitProductHelpUserListBO limitProductHelpUserList = iProductLimitUserHelpService.queryHelpInfo(limitProductHelpUserRequestBO);
return new ApiResponse.ApiResponseBuilder().code(200).data(limitProductHelpUserList).message("获取助力用户信息成功").build();
}
@RequestMapping(value = "/addHelpUserInfoCopy")
@ResponseBody
public ApiResponse addHelpUserInfoCopy(@RequestBody LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
logger.info("ProductLimitUserHelpRest addHelpUserInfo params is{}", limitProductHelpUserRequestBO);
//判断用户是否已经助力
Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO);
if (flag){
logger.info("ProductLimitUserHelpRest addHelpUserInfo can not help repeat");
return new ApiResponse.ApiResponseBuilder().code(401).message("用户已经助力过,不可重复助力").build();
}
iProductLimitUserHelpService.addHelpUserInfo(limitProductHelpUserRequestBO);
logger.info("ProductLimitUserHelpRest addHelpUserInfo success");
return new ApiResponse.ApiResponseBuilder().code(200).message("用户助力成功").build();
}
@RequestMapping(value = "/addShareInfoCopy")
@ResponseBody
public ApiResponse addShareInfoCopy(@RequestBody LimitProductHelpUserRequestBO limitProductHelpUserRequestBO) {
logger.info("ProductLimitUserHelpRest addShareInfo params is{}", limitProductHelpUserRequestBO);
iProductLimitUserHelpService.addShareInfo(limitProductHelpUserRequestBO);
logger.info("ProductLimitUserHelpRest addShareInfo success");
return new ApiResponse.ApiResponseBuilder().code(200).message("用户增加是否分享信息成功").build();
}
}