-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[merge] S3 presignedUrl 적용해서 createdRecord 수정
[refactor] S3 presignedUrl 적용해서 createdRecord 수정
- Loading branch information
Showing
14 changed files
with
86 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
package org.recordy.server.record.domain; | ||
|
||
import org.springframework.web.multipart.MultipartFile; | ||
public record File ( | ||
String videoUrl, | ||
String thumbnailUrl) { | ||
|
||
import java.util.UUID; | ||
|
||
public record File( | ||
MultipartFile video, | ||
MultipartFile thumbnail | ||
) { | ||
|
||
public static File of(MultipartFile video, MultipartFile thumbnail) { | ||
return new File(video, thumbnail); | ||
public File(String videoUrl, String thumbnailUrl) { | ||
this.videoUrl = videoUrl; | ||
this.thumbnailUrl = thumbnailUrl; | ||
} | ||
|
||
public String generateFileName(MultipartFile file) { | ||
String originalFilename = file.getOriginalFilename(); | ||
String extension = originalFilename.substring(originalFilename.lastIndexOf('.')); | ||
return UUID.randomUUID() + extension; | ||
public String getVideoUrl() { | ||
return videoUrl; | ||
} | ||
|
||
public String getVideoFileName() { | ||
return generateFileName(video); | ||
public String getThumbnailUrl() { | ||
return thumbnailUrl; | ||
} | ||
|
||
public String getThumbnailFileName() { | ||
return generateFileName(thumbnail); | ||
public static File of(String videoUrl, String thumbnailUrl) { | ||
return new File(videoUrl, thumbnailUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/org/recordy/server/record/service/dto/FileUrl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package org.recordy.server.record.service.dto; | ||
|
||
import jakarta.persistence.Column; | ||
|
||
public record FileUrl( | ||
String videoUrl, | ||
String thumbnailUrl | ||
) { | ||
public static FileUrl of(String videoUrl, String thumbnailUrl) { | ||
return new FileUrl(videoUrl, thumbnailUrl); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/test/java/org/recordy/server/mock/record/FakeFileService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters