Skip to content

Commit f364aec

Browse files
committed
♻️ refactor: 리뷰 반영 수정
1 parent 947d935 commit f364aec

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/GameService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.f1.backend.domain.quiz.entity.Quiz;
1414
import io.f1.backend.domain.user.dto.UserPrincipal;
1515
import io.f1.backend.global.exception.CustomException;
16+
import io.f1.backend.global.exception.errorcode.GameErrorCode;
1617
import io.f1.backend.global.exception.errorcode.RoomErrorCode;
1718

1819
import lombok.RequiredArgsConstructor;
@@ -68,7 +69,7 @@ private void validateRoomStart(Room room, UserPrincipal principal) {
6869
}
6970

7071
if (!validateReadyStatus(room)) {
71-
throw new CustomException(RoomErrorCode.PLAYER_NOT_READY);
72+
throw new CustomException(GameErrorCode.PLAYER_NOT_READY);
7273
}
7374

7475
if (room.getState() == RoomState.PLAYING) {
@@ -77,7 +78,7 @@ private void validateRoomStart(Room room, UserPrincipal principal) {
7778
}
7879

7980
// 라운드 수만큼 랜덤 Question 추출
80-
public List<Question> prepareQuestions(Room room, Quiz quiz) {
81+
private List<Question> prepareQuestions(Room room, Quiz quiz) {
8182
Long quizId = quiz.getId();
8283
Integer round = room.getGameSetting().getRound();
8384
return quizService.getRandomQuestionsWithoutAnswer(quizId, round);

backend/src/main/java/io/f1/backend/global/exception/errorcode/GameErrorCode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
@Getter
99
@RequiredArgsConstructor
1010
public enum GameErrorCode implements ErrorCode {
11-
GAME_SETTING_CONFLICT("E409002", HttpStatus.CONFLICT, "게임 설정이 맞지 않습니다.");
11+
GAME_SETTING_CONFLICT("E409002", HttpStatus.CONFLICT, "게임 설정이 맞지 않습니다."),
12+
PLAYER_NOT_READY("E403004", HttpStatus.FORBIDDEN, "게임 시작을 위한 준비 상태가 아닙니다.");
1213

1314
private final String code;
1415

backend/src/main/java/io/f1/backend/global/exception/errorcode/RoomErrorCode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
public enum RoomErrorCode implements ErrorCode {
1111
ROOM_USER_LIMIT_REACHED("E403002", HttpStatus.FORBIDDEN, "정원이 모두 찼습니다."),
1212
ROOM_GAME_IN_PROGRESS("E403003", HttpStatus.FORBIDDEN, "게임이 진행 중 입니다."),
13-
PLAYER_NOT_READY("E403004", HttpStatus.FORBIDDEN, "게임 시작을 위한 준비 상태가 아닙니다."),
1413
ROOM_NOT_FOUND("E404005", HttpStatus.NOT_FOUND, "존재하지 않는 방입니다."),
1514
WRONG_PASSWORD("E401006", HttpStatus.UNAUTHORIZED, "비밀번호가 일치하지않습니다."),
1615
PLAYER_NOT_FOUND("E404007", HttpStatus.NOT_FOUND, "존재하지 않는 플레이어입니다."),

0 commit comments

Comments
 (0)