xiongzhu 3 år sedan
förälder
incheckning
ae6740299e
1 ändrade filer med 3 tillägg och 0 borttagningar
  1. 3 0
      src/main/java/com/izouma/yags/service/RoomService.java

+ 3 - 0
src/main/java/com/izouma/yags/service/RoomService.java

@@ -256,6 +256,9 @@ public class RoomService {
 
     public void uploadResult(Long userId, Long roomId, String screenShot, MultipartFile file) throws IOException {
         Room room = roomRepo.findById(roomId).orElseThrow(new BusinessException("房间无记录"));
+        if (LocalDateTime.now().isBefore(room.getStartAt().plusMinutes(10))) {
+            throw new BusinessException("比赛时间过短:10分钟");
+        }
         if (room.isNeedAudit()) {
             if (!(room.getStatus() == RoomStatus.GAMING || room.getStatus() == RoomStatus.AUDIT)) {
                 throw new BusinessException("当前房间状态无法上传截图");