增加校验

This commit is contained in:
wangw 2025-01-13 15:39:52 +08:00
parent 9e70bfd42e
commit 84089405d1
1 changed files with 3 additions and 0 deletions

View File

@ -233,6 +233,9 @@ public class DiscSpinningController {
if (source == 1 && sourceId == null) { if (source == 1 && sourceId == null) {
throw new CzgException("异常请求"); throw new CzgException("异常请求");
} }
if(sourceId == null){
return Result.error("请求失败,请联系管理员");
}
if (DataLimitUtil.isAllowed(RedisKeys.getDateKey("spinning:draw:") + sourceId, 120)) { if (DataLimitUtil.isAllowed(RedisKeys.getDateKey("spinning:draw:") + sourceId, 120)) {
DiscSpinningRecord draws = discSpinningService.draws(i == null ? 1 : i + 1, amount, sourceId, userId, source); DiscSpinningRecord draws = discSpinningService.draws(i == null ? 1 : i + 1, amount, sourceId, userId, source);
executor.schedule(() -> discSpinningService.receive1(draws), 4, TimeUnit.SECONDS); executor.schedule(() -> discSpinningService.receive1(draws), 4, TimeUnit.SECONDS);