Skip to content

Commit

Permalink
Merge pull request #71 from SWM-SMART/feat/#70
Browse files Browse the repository at this point in the history
id 추출 문제 해결
  • Loading branch information
noparamin authored Nov 21, 2023
2 parents ad2912b + 1948e99 commit bb9e4ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class AudioFileController {

@PostMapping("/{documentID}/audio")
public ResponseEntity<?> uploadAudioFile(@PathVariable(value = "documentID") long documentId, @RequestParam("audio") MultipartFile audioFile, @RequestHeader("Authorization") String accessToken) throws UnsupportedAudioFileException, IOException, DocumentException {
Optional<Long> id = jwtService.extractUserId(accessToken);
String extractedAccessToken = jwtService.extractAccessToken(accessToken);
Optional<Long> id = jwtService.extractUserId(extractedAccessToken);
Long userId = id.orElse(null);

// s3에 오디오 파일 저장
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class LearningFileController {

@PostMapping("/{documentID}/pdf")
public ResponseEntity<?> uploadLearningFile(@PathVariable(value = "documentID") long documentId, @RequestParam("pdf") MultipartFile pdfFile, @RequestHeader("Authorization") String accessToken) throws UnsupportedAudioFileException, IOException {
Optional<Long> id = jwtService.extractUserId(accessToken);
String extractedAccessToken = jwtService.extractAccessToken(accessToken);
Optional<Long> id = jwtService.extractUserId(extractedAccessToken);
Long userId = id.orElse(null);

if (!checkPageLimit(countPdfPage(pdfFile))) {
Expand All @@ -47,16 +48,9 @@ public ResponseEntity<?> uploadLearningFile(@PathVariable(value = "documentID")

S3Dto s3Dto = new S3Dto(pdfFile, documentId, userId, "pdf");
String path = awsS3Uploader.uploadFile(s3Dto);
//sseService.notifyKeywords(documentId, path);
//sseService.notifySummary(documentId, path);
// ResponseEntity<KeywordsBodyDto> responseEntity = requestService.requestPdfKeywords(path);
// keywordService.createKeywords(responseEntity, documentId);
//
// ResponseEntity<SummaryDto> summary = requestService.requestPdfSummary(path);
// summaryService.createSummary(documentId, summary.getBody().getSummary());

whiteboardService.setDataType(documentId, "pdf");

//return new ResponseEntity<>(responseEntity.getBody(), HttpStatus.OK);
return new ResponseEntity<>(HttpStatus.OK);
}

Expand Down

0 comments on commit bb9e4ab

Please sign in to comment.