Skip to content

Commit e2a08d4

Browse files
author
lilyyang0077
committed
fix: 타 파트(Question) ID 타입 불일치 컴파일 에러 해결
1 parent 5fcdee5 commit e2a08d4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎backend/src/main/java/com/example/Piroin/project/domain/question/controller/QuestionController.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@RequiredArgsConstructor
1717
public class QuestionController {
1818
private final QuestionService questionService;
19-
19+
2020
// 질문 목록 + 이해도 조회
2121
// GET /api/sessions/{sessionId}/questions?understandingIndex=0
2222
@GetMapping("/{sessionId}/questions")
@@ -26,7 +26,7 @@ public ResponseEntity<ApiResponse<QuestionResDTO.QuestionRoomResponse>> getQuest
2626
) {
2727
QuestionResDTO.QuestionRoomResponse response =
2828
questionService.getQuestionRoom(sessionId, understandingIndex);
29-
29+
3030
return ResponseUtil.success(QuestionSuccessCode.QUESTION_ROOM_OK, response);
3131
}
3232

@@ -44,7 +44,7 @@ public ResponseEntity<ApiResponse<QuestionResDTO.UnderstandingResponseResult>> r
4444

4545
return ResponseUtil.success(QuestionSuccessCode.UNDERSTANDING_RESPONSE_OK, response);
4646
}
47-
47+
4848
// 질문 등록
4949
// POST /api/sessions/{sessionId}/questions
5050
@PostMapping("/{sessionId}/questions")
@@ -54,8 +54,8 @@ public ResponseEntity<ApiResponse<QuestionResDTO.CreateRes>> createQuestion(
5454
@AuthenticationPrincipal Integer userId
5555
) {
5656
QuestionResDTO.CreateRes response =
57-
questionService.createQuestion(sessionId, request, userId);
58-
57+
questionService.createQuestion(userId.longValue(), request, userId);
58+
5959
return ResponseUtil.success(QuestionSuccessCode.QUESTION_CREATED, response);
6060
}
6161
}

‎backend/src/main/java/com/example/Piroin/project/domain/question/service/QuestionService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private QuestionResDTO.UnderstandingResponseResult toUnderstandingResponseResult
171171
}
172172

173173
private StudySession findSession(Long sessionId) {
174-
return curriculumRepository.findById(Math.toIntExact(sessionId))
174+
return curriculumRepository.findById(Math.toIntExact(sessionId.intValue()))
175175
.orElseThrow(() -> new QuestionException(HttpStatus.NOT_FOUND, "세션을 찾을 수 없습니다."));
176176
}
177177

0 commit comments

Comments
 (0)