diff --git a/src/main/java/newCar/event_page/exception/FCFS/FCFSFinishedException.java b/src/main/java/newCar/event_page/exception/FCFS/FCFSFinishedException.java deleted file mode 100644 index 35317ed..0000000 --- a/src/main/java/newCar/event_page/exception/FCFS/FCFSFinishedException.java +++ /dev/null @@ -1,7 +0,0 @@ -package newCar.event_page.exception.FCFS; - -public class FCFSFinishedException extends RuntimeException{ - public FCFSFinishedException(String message) { - super(message); - } -} diff --git a/src/main/java/newCar/event_page/exception/GlobalExceptionHandler.java b/src/main/java/newCar/event_page/exception/GlobalExceptionHandler.java index e3df86a..1668120 100644 --- a/src/main/java/newCar/event_page/exception/GlobalExceptionHandler.java +++ b/src/main/java/newCar/event_page/exception/GlobalExceptionHandler.java @@ -1,6 +1,5 @@ package newCar.event_page.exception; -import newCar.event_page.exception.FCFS.FCFSFinishedException; import newCar.event_page.exception.FCFS.FCFSNotStartedYet; import newCar.event_page.exception.FCFS.FCFSNotYetConductedException; import org.springframework.http.HttpStatus; @@ -33,11 +32,6 @@ public ResponseEntity handleUnmodifiableFieldException(final RuntimeExce return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage()); } - @ExceptionHandler(FCFSFinishedException.class) - public ResponseEntity handleFCFSFinishedException(final RuntimeException e){ - return ResponseEntity.status(HttpStatus.GONE).body(e.getMessage()); - } - @ExceptionHandler(FCFSNotStartedYet.class) public ResponseEntity handleFCFSNotStartedException(final RuntimeException e){ return ResponseEntity.status(HttpStatus.FORBIDDEN).body(e.getMessage()); diff --git a/src/main/java/newCar/event_page/service/UserServiceImpl.java b/src/main/java/newCar/event_page/service/UserServiceImpl.java index d0728eb..f5623be 100644 --- a/src/main/java/newCar/event_page/service/UserServiceImpl.java +++ b/src/main/java/newCar/event_page/service/UserServiceImpl.java @@ -5,7 +5,6 @@ import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; import newCar.event_page.config.JwtConfig; -import newCar.event_page.exception.FCFS.FCFSFinishedException; import newCar.event_page.exception.FCFS.FCFSNotStartedYet; import newCar.event_page.exception.UserAlreadyHasTeamException; import newCar.event_page.exception.UserLoginFailException; @@ -110,11 +109,8 @@ public ResponseEntity getQuiz(Long quizEventId ) { throw new IndexOutOfBoundsException("이벤트 기간이 지났습니다"); } - if(!isQuizAvailable.get(todayQuiz.getId().intValue()-1)){ - throw new FCFSFinishedException("선착순 퀴즈가 마감되었습니다"); - }//오늘 퀴즈가 마감되었다면 - if(LocalDateTime.now(ZoneId.of("Asia/Seoul")).toLocalTime().isBefore(LocalTime.of(10, 15))){ + if(LocalDateTime.now(ZoneId.of("Asia/Seoul")).toLocalTime().isBefore(LocalTime.of(3, 15))){ throw new FCFSNotStartedYet("퀴즈가 아직 시작되지 않았습니다"); }//퀴즈가 아직 시작 안되었다면 @@ -360,9 +356,9 @@ private void quizBranch(Integer userAnswer, Long id, Map return; }//유저의 답변이 퀴즈 정답과 일치하지 않을 시 - int quizId = Integer.parseInt(todayQuiz.getId().toString()); + int quizId = Integer.parseInt(todayQuiz.getId().toString()) -1; - if(!isQuizAvailable.get(quizId-1)){ + if(!isQuizAvailable.get(quizId)){ map.put("status", UserQuizStatus.END); return; }//이미 마감되어 있다면