File tree Expand file tree Collapse file tree
backend/src/main/java/com/example/Piroin/project/domain/question Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616@ RequiredArgsConstructor
1717public 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments