Skip to content

Commit

Permalink
[hotfix]: 자료집 수정 api 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
qogustj committed Oct 13, 2024
1 parent 7434070 commit a752761
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ public ResponseEntity<ApiResponse<?>> createBoardPostFile(@Parameter(hidden = tr
@PostMapping(value = "/data/files/{fileType}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ApiResponse<?>> createBoardDataPostFile(@Parameter(hidden = true) @UserId Long userId,
@PathVariable(name = "boardCode") String boardCode,
@RequestPart(value = "files", required = false) MultipartFile[] files,
@PathVariable(name = "fileType") String fileType) {
return ApiResponse.success(postManageService.createBoardDataPostFile(userId, boardCode, files, fileType));
return ApiResponse.success(postManageService.createBoardDataPostFile(userId, files, fileType));
}

@Operation(summary = "게시물 단건 조회 후 파일 혹은 이미지 삭제 api", description = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public PostFileListResponse createBoardPostFile(Long userId, String boardCode, M
return PostFileListResponse.of(thumbnailUrl, postFileResponses);
}
@Transactional
public PostFileListResponse createBoardDataPostFile(Long userId, String boardCode, MultipartFile[] files, String fileType){
PostFileMediatorResponse response = s3utils.uploadDataFileWithPath(userId, boardCode, files, fileType);
public PostFileListResponse createBoardDataPostFile(Long userId, MultipartFile[] files, String fileType){
PostFileMediatorResponse response = s3utils.uploadDataFileWithPath(userId, BoardCode.DATA.getStringBoardCode(), files, fileType);
List<PostFile> postFiles = convertUrlsToPostFiles(response);
List<PostFile> afterSaveList = postFileAppender.saveAllPostFile(postFiles);

Expand Down

0 comments on commit a752761

Please sign in to comment.