Skip to content

Commit

Permalink
feat: fileForContentResponse fileName 필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gusah009 committed May 14, 2024
1 parent bbce420 commit 15759c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public ResponseEntity<FileForContentResponse> uploadFileForContent(
log.info("member \"{}\" uploaded file. memberId: {}, fileId: {}", member.getRealName(), member.getId(),
fileEntity.getId());
return ResponseEntity.status(HttpStatus.CREATED)
.body(FileForContentResponse.from("posts/files/" + fileEntity.getFileUUID()));
.body(FileForContentResponse.of("posts/files/" + fileEntity.getFileUUID(), file.getName()));
}

@GetMapping("/files/{fileUUID}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
public class FileForContentResponse {

private String filePath;
private String fileName;

public static FileForContentResponse from(String filePath) {
public static FileForContentResponse of(String filePath, String fileName) {
return FileForContentResponse.builder()
.filePath(filePath)
.fileName(fileName)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,8 @@ class UploadFileForContent {
partWithName("file").description("게시글의 본문에 넣을 파일")
),
responseFields(
fieldWithPath("filePath").description("저장된 파일을 불러올 수 있는 file의 hash값과 url입니다.")
fieldWithPath("filePath").description("저장된 파일을 불러올 수 있는 file의 hash값과 url입니다."),
fieldWithPath("fileName").description("저장된 파일의 파일명.")
)));
}
}
Expand Down

0 comments on commit 15759c3

Please sign in to comment.