diff --git a/src/main/java/com/example/bigbrotherbe/global/file/entity/File.java b/src/main/java/com/example/bigbrotherbe/global/file/entity/File.java index a8f6a90..3f2e8ec 100644 --- a/src/main/java/com/example/bigbrotherbe/global/file/entity/File.java +++ b/src/main/java/com/example/bigbrotherbe/global/file/entity/File.java @@ -63,8 +63,9 @@ public class File extends BaseTimeEntity { private CampusNotice campusNotice; - public void update(String url) { + public void update(String url, String fileName) { this.url = url; + this.fileName = fileName; } public void linkMeeting(Meetings meetings) { diff --git a/src/main/java/com/example/bigbrotherbe/global/file/service/FileServiceImpl.java b/src/main/java/com/example/bigbrotherbe/global/file/service/FileServiceImpl.java index 254cb9c..ceb3b45 100644 --- a/src/main/java/com/example/bigbrotherbe/global/file/service/FileServiceImpl.java +++ b/src/main/java/com/example/bigbrotherbe/global/file/service/FileServiceImpl.java @@ -65,8 +65,10 @@ public List updateFile(FileUpdateDTO fileUpdateDTO) { multipartFileList.forEach(file -> { String url = s3Util.uploadFile(file, fileType); + String fileName = file.getOriginalFilename(); + files.forEach(fileEntity -> { - fileEntity.update(url); + fileEntity.update(url, fileName); updatedFiles.add(fileEntity); }); });