-
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 #475 from tukcomCD2024/fix/group_capsule_open-B-#470
fix : 그룹 캡슐 개봉 로직 수정
- Loading branch information
Showing
17 changed files
with
480 additions
and
106 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
14 changes: 14 additions & 0 deletions
14
...site/timecapsulearchive/core/domain/capsule/group_capsule/data/dto/CapsuleOpenStatus.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.group_capsule.data.dto; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum CapsuleOpenStatus { | ||
OPEN("캡슐이 개봉되었습니다."), NOT_OPEN("캡슐이 개봉되지 않았습니다."); | ||
|
||
private final String statusMessage; | ||
|
||
CapsuleOpenStatus(String statusMessage) { | ||
this.statusMessage = statusMessage; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...mecapsulearchive/core/domain/capsule/group_capsule/data/dto/GroupCapsuleOpenStateDto.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,23 @@ | ||
package site.timecapsulearchive.core.domain.capsule.group_capsule.data.dto; | ||
|
||
import site.timecapsulearchive.core.domain.capsule.group_capsule.data.response.GroupCapsuleOpenStateResponse; | ||
|
||
public record GroupCapsuleOpenStateDto( | ||
CapsuleOpenStatus capsuleOpenStatus | ||
) { | ||
|
||
public static GroupCapsuleOpenStateDto opened() { | ||
return new GroupCapsuleOpenStateDto(CapsuleOpenStatus.OPEN); | ||
} | ||
|
||
public static GroupCapsuleOpenStateDto notOpened() { | ||
return new GroupCapsuleOpenStateDto(CapsuleOpenStatus.NOT_OPEN); | ||
} | ||
|
||
public GroupCapsuleOpenStateResponse toResponse() { | ||
return new GroupCapsuleOpenStateResponse( | ||
capsuleOpenStatus, | ||
capsuleOpenStatus.getStatusMessage() | ||
); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...rchive/core/domain/capsule/group_capsule/data/response/GroupCapsuleOpenStateResponse.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,10 @@ | ||
package site.timecapsulearchive.core.domain.capsule.group_capsule.data.response; | ||
|
||
import site.timecapsulearchive.core.domain.capsule.group_capsule.data.dto.CapsuleOpenStatus; | ||
|
||
public record GroupCapsuleOpenStateResponse( | ||
CapsuleOpenStatus capsuleOpenStatus, | ||
String statusMessage | ||
) { | ||
|
||
} |
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: 0 additions & 3 deletions
3
...psulearchive/core/domain/capsule/group_capsule/repository/GroupCapsuleOpenRepository.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,12 +1,9 @@ | ||
package site.timecapsulearchive.core.domain.capsule.group_capsule.repository; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.repository.Repository; | ||
import site.timecapsulearchive.core.domain.capsule.entity.GroupCapsuleOpen; | ||
|
||
public interface GroupCapsuleOpenRepository extends Repository<GroupCapsuleOpen, Long> { | ||
|
||
void save(GroupCapsuleOpen groupCapsuleOpen); | ||
|
||
Optional<GroupCapsuleOpen> findByMemberIdAndCapsuleId(Long memberId, Long capsuleId); | ||
} |
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
.../main/java/site/timecapsulearchive/core/global/common/supplier/ZonedDateTimeSupplier.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.global.common.supplier; | ||
|
||
import java.time.ZoneId; | ||
import java.time.ZonedDateTime; | ||
import java.util.function.Supplier; | ||
|
||
public class ZonedDateTimeSupplier { | ||
|
||
private static final String TIME_ZONE = "UTC"; | ||
|
||
public static Supplier<ZonedDateTime> utc() { | ||
return () -> ZonedDateTime.now(ZoneId.of(TIME_ZONE)); | ||
} | ||
} |
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.