Skip to content

Commit

Permalink
refact : 보물 캡슐 개봉 응답 흐름 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Jun 14, 2024
1 parent adedd1a commit 551e778
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.dto;

import java.util.function.Function;
import site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.response.TreasureCapsuleOpenResponse;

public record TreasureCapsuleOpenDto(
String treasureImageUrl
) {

public TreasureCapsuleOpenResponse toResponse(final Function<String, String> s3PreSignedUrlForGet) {
String imageUrl = s3PreSignedUrlForGet.apply(treasureImageUrl);
return new TreasureCapsuleOpenResponse(imageUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public static TreasureCapsuleOpenResponse createOf(
final TreasureCapsuleOpenDto dto,
final Function<String, String> s3PreSignedUrlForGet
) {
final String treasureImageUrl = s3PreSignedUrlForGet.apply(dto.treasureImageUrl());

return new TreasureCapsuleOpenResponse(treasureImageUrl);
return dto.toResponse(s3PreSignedUrlForGet);
}

}

0 comments on commit 551e778

Please sign in to comment.