release- 报名结束时间必须在开奖时间之前5min以上

release-2024-04-25
huangyawei 1 month ago
parent 69c7c004b4
commit be37284df7

@ -63,6 +63,7 @@ public class ErrorConstants {
public static final String POINT_NOT_ENOUGH = "积分不足";
public static final String ONLY_ONE_CITY = "只能填写一个城市";
public static final String SHIPPING_ADDRESS_IS_REQUIRED = "请先填写收货地址再参与抽奖";
public static final String APPLY_END_TIME_MUST_BE_MORE_THAN_5_MINUTES_BEFORE_DRAW_TIME = "报名结束时间必须在开奖时间之前5min以上";
// 积分部分
public static final String DAILY_SIGN_ALREADY = "今日已签到";

@ -127,6 +127,10 @@ public class LotteryService {
if (lottery.getApplyEndTime().isBefore(lottery.getApplyStartTime())) {
throw new BizException(ErrorConstants.APPLY_END_TIME_CANNOT_BE_BEFORE_APPLY_START_TIME);
}
// 报名结束时间必须在开奖时间之前5min以上
if (lottery.getDrawTime().minusMinutes(5).isBefore(lottery.getApplyEndTime())) {
throw new BizException(ErrorConstants.APPLY_END_TIME_MUST_BE_MORE_THAN_5_MINUTES_BEFORE_DRAW_TIME);
}
StringBuilder regionCode = new StringBuilder();
StringBuilder regionName = new StringBuilder();
@ -197,6 +201,10 @@ public class LotteryService {
if (lottery.getApplyEndTime().isBefore(lottery.getApplyStartTime())) {
throw new BizException(ErrorConstants.APPLY_END_TIME_CANNOT_BE_BEFORE_APPLY_START_TIME);
}
// 报名结束时间必须在开奖时间之前5min以上
if (lottery.getDrawTime().minusMinutes(5).isBefore(lottery.getApplyEndTime())) {
throw new BizException(ErrorConstants.APPLY_END_TIME_MUST_BE_MORE_THAN_5_MINUTES_BEFORE_DRAW_TIME);
}
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);

Loading…
Cancel
Save