Authored by bblu

返回码,修改

... ... @@ -49,7 +49,7 @@ public class DrawlineUserActivityInfoServiceImpl implements IDrawlineUserActivit
// 2、构建默认返回结果
int uid = userActivityInfoReqBO.getUid();
Byte userType = userActivityInfoReqBO.getUserType();
Byte userType = (byte) 1;
int activityId = userActivityInfoReqBO.getActivityId();
DlUserActivityInfoRespBO userActivityInfoRespBO = this.buildRespBOWithDefault(uid, userType, activityId);
... ... @@ -57,7 +57,7 @@ public class DrawlineUserActivityInfoServiceImpl implements IDrawlineUserActivit
DrawlineActivity drawlineActivity = drawlineActivityDAO.selectByPrimaryKey(activityId);
if (drawlineActivity == null) {
logger.warn("getUserActivityInfo: drawlineActivity not exists. activityId is {}", activityId);
throw new ServiceException(500, "drawlineActivity不存在");
throw new ServiceException(900001003, "活动不存在");
}
// 4、查看是否排队(如果未排队,则不可能中奖,直接返回)
... ... @@ -83,7 +83,7 @@ public class DrawlineUserActivityInfoServiceImpl implements IDrawlineUserActivit
logger.debug("getUserActivityInfo: drawlinePrizeSettingDAO.selectByActivityId.activityId is {}", activityId);
if (drawlinePrizeSetting == null) {
logger.warn("getUserActivityInfo: drawlinePrizeSetting not exists. activityId is {}", activityId);
throw new ServiceException(500, "drawlinePrizeSetting不存在");
throw new ServiceException(900001011, "未设置活动奖品");
}
userActivityInfoRespBO.setIsLucky(1);
userActivityInfoRespBO.setPrizeType(Integer.valueOf(drawlinePrizeSetting.getPrizeType()));
... ... @@ -118,15 +118,11 @@ public class DrawlineUserActivityInfoServiceImpl implements IDrawlineUserActivit
private void checkDrawlineUserActivityInfoReqBO(DlUserActivityInfoReqBO userActivityInfoReqBO) throws ServiceException {
Integer uid = userActivityInfoReqBO.getUid();
if (uid == null || uid <= 0) {
throw new ServiceException(500, "请输入uid");
}
Byte userType = userActivityInfoReqBO.getUserType();
if (userType == null || userType <= 0) {
throw new ServiceException(500, "请输入userType");
throw new ServiceException(900001001, "请传参uid");
}
Integer activityId = userActivityInfoReqBO.getActivityId();
if (activityId == null || activityId <= 0) {
throw new ServiceException(500, "请输入activityId");
throw new ServiceException(900001002, "请传参activityId");
}
}
... ...
... ... @@ -54,18 +54,18 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
DrawlineActivity drawlineActivity = drawlineActivityDAO.selectByPrimaryKey(activityId);
if (null == drawlineActivity) {
logger.warn("addDrawlineUserQueue: drawlineActivity is not exists");
throw new ServiceException(500, "活动已不存在");
throw new ServiceException(900001003, "活动已不存在");
}
int beginTime = null == drawlineActivity.getBeginTime() ? 0 : drawlineActivity.getBeginTime().intValue();
int endTime = null == drawlineActivity.getEndTime() ? 0 : drawlineActivity.getEndTime().intValue();
int currentTime = (int) (System.currentTimeMillis() / 1000);
if (0 < beginTime && currentTime < beginTime) {
logger.warn("addDrawlineUserQueue: drawlineActivity is not begin");
throw new ServiceException(500, "活动尚未开始");
throw new ServiceException(900001004, "活动尚未开始");
}
if (0 < endTime && currentTime > endTime) {
logger.warn("addDrawlineUserQueue: drawlineActivity is already end");
throw new ServiceException(501, "OOPS!您来晚啦,下次早点哦!");
throw new ServiceException(900001005, "活动已结束");
}
// (4)判断是否已经参加排队
... ... @@ -74,7 +74,7 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
drawlineUserQueue);
if (null != drawlineUserQueue) {
logger.warn("addDrawlineUserQueue: drawlineUserQueue is exists already");
throw new ServiceException(500, "您已经参加过排队,无需再次排队");
throw new ServiceException(900001006, "您已经参加过排队,无需再次排队");
}
// (5)组装数据,新增排队
... ... @@ -83,7 +83,7 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
logger.debug("addDrawlineUserQueue: drawlineUserQueueDAO.insertAutoSort. drawlineUserQueue is {}, rows is {}", drawlineUserQueue, rows);
if (1 > rows) {
logger.warn("addDrawlineUserQueue: fail to addDrawlineUserQueue. uid is {}, activityId is {}, userType is {}", uid, activityId, userType);
throw new ServiceException(500, "参加活动排队失败");
throw new ServiceException(900001007, "参加活动排队失败");
}
// (6)查询排队序号
... ... @@ -111,7 +111,7 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
// (2)校验
if (1 > activityId) {
logger.warn("getDrawlineUserQueueList: param activityId is null.");
throw new ServiceException(500, "请传参activityId");
throw new ServiceException(900001002, "请传参activityId");
}
// (3)查询条件下,总记录数
... ... @@ -126,7 +126,7 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
logger.debug("getDrawlineUserQueueList: drawlineUserQueueDAO.selectBy. activityId is {}, sort is {}, limit is {}, drawlineUserQueueList is {}", activityId, sort, limit, drawlineUserQueueList);
if (null == drawlineUserQueueList || 0 == drawlineUserQueueList.size()) {
logger.warn("getDrawlineUserQueueList: drawlineUserQueueList is null.");
throw new ServiceException(500, "无人参与活动排队");
throw new ServiceException(900001008, "无人参与活动排队");
}
// (5)组装uids
... ... @@ -165,11 +165,11 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
private void validAddDrawlineUserQueue(int uid, int activityId) {
if (1 > uid) {
logger.warn("validAddDrawlineUserQueue: param uid is null.");
throw new ServiceException(500, "请传参uid");
throw new ServiceException(900001001, "请传参uid");
}
if (1 > activityId) {
logger.warn("validAddDrawlineUserQueue: param activityId is null.");
throw new ServiceException(500, "请传参activityId");
throw new ServiceException(900001002, "请传参activityId");
}
}
... ...