-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from tukcomCD2024/feat/treasure_summary_B-#492
feat : 보물 캡슐 요약 조회 기능 개발 및 보물 찾기 기능 응답 값 수정
- Loading branch information
Showing
9 changed files
with
203 additions
and
6 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
14 changes: 14 additions & 0 deletions
14
...ecapsulearchive/core/domain/capsule/treasure_capsule/data/dto/TreasureCapsuleOpenDto.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 |
---|---|---|
@@ -0,0 +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); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...psulearchive/core/domain/capsule/treasure_capsule/data/dto/TreasureCapsuleSummaryDto.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.dto; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.function.Function; | ||
import lombok.Builder; | ||
import site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.response.TreasureCapsuleSummaryResponse; | ||
|
||
@Builder | ||
public record TreasureCapsuleSummaryDto( | ||
String skinUrl, | ||
ZonedDateTime dueDate, | ||
String address, | ||
String roadName | ||
|
||
) { | ||
|
||
public TreasureCapsuleSummaryResponse toResponse(final Function<String, String> s3PreSignedUrlForGet) { | ||
final String treasureSkinUrl = s3PreSignedUrlForGet.apply(skinUrl); | ||
|
||
return TreasureCapsuleSummaryResponse.builder() | ||
.skinUrl(treasureSkinUrl) | ||
.dueDate(dueDate) | ||
.address(address) | ||
.roadName(roadName) | ||
.build(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...chive/core/domain/capsule/treasure_capsule/data/response/TreasureCapsuleOpenResponse.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.function.Function; | ||
import site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.dto.TreasureCapsuleOpenDto; | ||
|
||
@Schema(name = "보물 캡슐 개봉 응답") | ||
public record TreasureCapsuleOpenResponse( | ||
@Schema(name = "보물 이미지 URL") | ||
String treasureImageUrl | ||
) { | ||
|
||
public static TreasureCapsuleOpenResponse createOf( | ||
final TreasureCapsuleOpenDto dto, | ||
final Function<String, String> s3PreSignedUrlForGet | ||
) { | ||
return dto.toResponse(s3PreSignedUrlForGet); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...ve/core/domain/capsule/treasure_capsule/data/response/TreasureCapsuleSummaryResponse.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.ZonedDateTime; | ||
import java.util.function.Function; | ||
import lombok.Builder; | ||
import site.timecapsulearchive.core.domain.capsule.treasure_capsule.data.dto.TreasureCapsuleSummaryDto; | ||
|
||
@Schema(description = "보물 캡슐 요약 정보") | ||
@Builder | ||
public record TreasureCapsuleSummaryResponse( | ||
|
||
@Schema(description = "보물 캡슐 스킨 url") | ||
String skinUrl, | ||
|
||
@Schema(description = "개봉일") | ||
ZonedDateTime dueDate, | ||
|
||
@Schema(description = "캡슐 생성 주소") | ||
String address, | ||
|
||
@Schema(description = "캡슐 생성 도로 이름") | ||
String roadName | ||
|
||
) { | ||
|
||
public static TreasureCapsuleSummaryResponse createOf( | ||
final TreasureCapsuleSummaryDto dto, | ||
final Function<String, String> s3PreSignedUrlForGet | ||
) { | ||
return dto.toResponse(s3PreSignedUrlForGet); | ||
} | ||
} |
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