Skip to content

Commit 140d082

Browse files
committed
♻️ LocaldateTime -> Instant, lazy 예외 fix
1 parent 938f205 commit 140d082

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.f1.backend.domain.game.dto.request.RoomValidationRequest;
1616
import io.f1.backend.domain.game.dto.response.GameSettingResponse;
1717
import io.f1.backend.domain.game.dto.response.PlayerListResponse;
18-
import io.f1.backend.domain.game.dto.response.QuizResponse;
1918
import io.f1.backend.domain.game.dto.response.RoomCreateResponse;
2019
import io.f1.backend.domain.game.dto.response.RoomListResponse;
2120
import io.f1.backend.domain.game.dto.response.RoomResponse;
@@ -30,7 +29,7 @@
3029
import io.f1.backend.domain.game.store.RoomRepository;
3130
import io.f1.backend.domain.quiz.app.QuizService;
3231
import io.f1.backend.domain.quiz.entity.Quiz;
33-
import java.time.LocalDateTime;
32+
import java.time.Instant;
3433
import java.util.List;
3534
import java.util.Map;
3635
import java.util.Optional;
@@ -149,7 +148,7 @@ public RoomExitData exitRoom(Long roomId, String sessionId) {
149148
}
150149

151150
SystemNoticeResponse systemNoticeResponse = new SystemNoticeResponse(
152-
removedPlayer.getNickname() + "님이 퇴장하셨습니다.", LocalDateTime.now());
151+
removedPlayer.getNickname() + "님이 퇴장하셨습니다.", Instant.now());
153152

154153
PlayerListResponse playerListResponse = toPlayerListResponse(room);
155154

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.f1.backend.domain.game.dto.response;
22

3-
import java.time.LocalDateTime;
3+
import java.time.Instant;
44

5-
public record SystemNoticeResponse(String noticeMessage, LocalDateTime timestamp) {
5+
public record SystemNoticeResponse(String noticeMessage, Instant timestamp) {
66

77
}

backend/src/main/java/io/f1/backend/domain/quiz/app/QuizService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,16 @@ private String getExtension(String filename) {
8989
return filename.substring(filename.lastIndexOf(".") + 1);
9090
}
9191

92+
@Transactional(readOnly = true)
9293
public Quiz getQuizById(Long quizId) {
93-
return quizRepository
94+
Quiz quiz = quizRepository
9495
.findById(quizId)
9596
.orElseThrow(() -> new RuntimeException("E404002: 존재하지 않는 퀴즈입니다."));
97+
quiz.getQuestions().size();
98+
return quiz;
9699
}
97100

101+
@Transactional(readOnly = true)
98102
public Long getQuizMinId() {
99103
return quizRepository.getQuizMinId();
100104
}

0 commit comments

Comments
 (0)