Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id 추출 문제 해결 #71

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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