-
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.
Revert "refact : 캡슐 공통 dto, response 통일 #479"
- Loading branch information
1 parent
889f189
commit e8118e7
Showing
20 changed files
with
246 additions
and
63 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
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
30 changes: 30 additions & 0 deletions
30
...te/timecapsulearchive/core/domain/capsule/public_capsule/data/dto/MyPublicCapsuleDto.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,30 @@ | ||
package site.timecapsulearchive.core.domain.capsule.public_capsule.data.dto; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.function.Function; | ||
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType; | ||
import site.timecapsulearchive.core.domain.capsule.public_capsule.data.response.MyPublicCapsuleResponse; | ||
|
||
public record MyPublicCapsuleDto( | ||
Long capsuleId, | ||
String skinUrl, | ||
ZonedDateTime dueDate, | ||
ZonedDateTime createdAt, | ||
String title, | ||
Boolean isOpened, | ||
CapsuleType capsuleType | ||
) { | ||
|
||
public MyPublicCapsuleResponse toResponse( | ||
final Function<String, String> singlePreSignUrlFunction) { | ||
return MyPublicCapsuleResponse.builder() | ||
.capsuleId(capsuleId) | ||
.skinUrl(singlePreSignUrlFunction.apply(skinUrl)) | ||
.dueDate(dueDate) | ||
.createdAt(createdAt) | ||
.title(title) | ||
.isOpened(isOpened) | ||
.capsuleType(capsuleType) | ||
.build(); | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
...sulearchive/core/domain/capsule/public_capsule/data/response/MyPublicCapsuleResponse.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,44 @@ | ||
package site.timecapsulearchive.core.domain.capsule.public_capsule.data.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.time.ZonedDateTime; | ||
import lombok.Builder; | ||
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType; | ||
import site.timecapsulearchive.core.global.common.response.ResponseMappingConstant; | ||
|
||
@Builder | ||
@Schema(description = "사용자가 만든 공개 캡슐") | ||
public record MyPublicCapsuleResponse( | ||
|
||
@Schema(description = "캡슐 아이디") | ||
Long capsuleId, | ||
|
||
@Schema(description = "스킨 url") | ||
String skinUrl, | ||
|
||
@Schema(description = "개봉일") | ||
ZonedDateTime dueDate, | ||
|
||
@Schema(description = "생성일") | ||
ZonedDateTime createdAt, | ||
|
||
@Schema(description = "제목") | ||
String title, | ||
|
||
@Schema(description = "캡슐 개봉 여부") | ||
Boolean isOpened, | ||
|
||
@Schema(description = "캡슐 타입") | ||
CapsuleType capsuleType | ||
) { | ||
|
||
public MyPublicCapsuleResponse { | ||
if (dueDate != null) { | ||
dueDate = dueDate.withZoneSameInstant(ResponseMappingConstant.ZONE_ID); | ||
} | ||
|
||
if (createdAt != null) { | ||
createdAt = createdAt.withZoneSameInstant(ResponseMappingConstant.ZONE_ID); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.