22
33import com .example .ai_tutor .domain .note .application .ProfessorNoteService ;
44import com .example .ai_tutor .domain .note .dto .request .NoteCreateReq ;
5+ import com .example .ai_tutor .domain .note .dto .response .NoteAccessRes ;
56import com .example .ai_tutor .domain .note .dto .response .NoteCodeRes ;
67import com .example .ai_tutor .domain .note .dto .response .NoteListRes ;
78import com .example .ai_tutor .domain .practice .dto .request .SavePracticeListReq ;
89import com .example .ai_tutor .domain .summary .application .SummaryService ;
10+ import com .example .ai_tutor .domain .summary .dto .response .SummaryRes ;
911import com .example .ai_tutor .global .config .security .token .UserPrincipal ;
1012import com .example .ai_tutor .global .payload .ErrorResponse ;
1113import com .example .ai_tutor .global .payload .Message ;
@@ -42,7 +44,7 @@ public class NoteController {
4244 description = "새 비어있는 강의 노트를 생성하는 API입니다. 특정 folder ID에 title(강의 제목) 값만 요청하면 됩니다. 이때 폴더 ID 는 로그인한 회원이 생성한 폴더만 노트가 생성 가능합니다. (타인 계정으로 불가능)"
4345 )
4446 @ ApiResponses (value = {
45- @ ApiResponse (responseCode = "200" , description = "강의 노트 생성 성공" , content = { @ Content (mediaType = "application/json" , schema = @ Schema (implementation = Message .class ) ) } ),
47+ @ ApiResponse (responseCode = "200" , description = "강의 노트 생성 성공" , content = { @ Content (mediaType = "application/json" , schema = @ Schema (implementation = NoteAccessRes .class ) ) } ),
4648 @ ApiResponse (responseCode = "400" , description = "강의 노트 생성 실패" , content = { @ Content (mediaType = "application/json" , schema = @ Schema (implementation = ErrorResponse .class ) ) } ),
4749 })
4850 @ PostMapping ()
@@ -115,7 +117,7 @@ public ResponseEntity<?> convertSpeechToText(
115117 @ Parameter (description = "노트 ID" , required = true ) @ PathVariable Long noteId ,
116118 @ Parameter (description = "STT 변환을 위한 강의 영상 파일" , required = true ,
117119 schema = @ Schema (type = "string" , format = "binary" ))
118- @ RequestPart MultipartFile file
120+ @ RequestPart ( "file" ) MultipartFile file
119121 ) {
120122 try {
121123 boolean success = professorNoteService .convertSpeechToText (noteId , file );
@@ -134,29 +136,26 @@ public ResponseEntity<?> convertSpeechToText(
134136 // ===============================
135137 // 📑 노트 요약 생성 & 조회
136138 // ===============================
137-
138139 @ Operation (summary = "노트 요약 생성" , security = { @ SecurityRequirement (name = "BearerAuth" ) }, description = "저장된 STT 데이터를 기반으로 노트 요약을 생성합니다." )
139140 @ ApiResponses ({
140141 @ ApiResponse (responseCode = "200" , description = "노트 요약 생성 성공" ,
141- content = @ Content (mediaType = "application/json" , schema = @ Schema (implementation = String .class ))),
142+ content = @ Content (mediaType = "application/json" , schema = @ Schema (implementation = SummaryRes .class ))),
142143 @ ApiResponse (responseCode = "400" , description = "노트 요약 생성 실패" ,
143144 content = @ Content (mediaType = "application/json" ))
144145 })
145146 @ PreAuthorize ("isAuthenticated()" )
146147 @ PostMapping ("/{noteId}/summaries" )
147- public Mono <ResponseEntity <String >> createSummary (
148+ public Mono <ResponseEntity <SummaryRes >> createSummary (
148149 @ Parameter (description = "note id를 입력해주세요" , required = true ) @ PathVariable Long noteId ,
149150 @ Parameter (description = "folder의 id를 입력해주세요" , required = true ) @ PathVariable Long folderId ,
150151 @ RequestParam (required = false ) String keywords ,
151152 @ RequestParam (required = false ) String requirement ) {
152153
153154 return summaryService .processSummaryFromSavedStt (noteId , keywords , requirement )
154155 .map (ResponseEntity ::ok )
155- .onErrorResume (error -> {
156- return Mono .just (ResponseEntity
157- .badRequest ()
158- .body (error .getMessage ()));
159- });
156+ .onErrorResume (error -> Mono .just (ResponseEntity
157+ .badRequest ()
158+ .build ()));
160159 }
161160
162161
0 commit comments