diff --git a/src/main/java/space/space_spring/dto/pay/dto/TotalPayInfoDto.java b/src/main/java/space/space_spring/dto/pay/dto/TotalPayInfoDto.java index 5a2de372..944fb01a 100644 --- a/src/main/java/space/space_spring/dto/pay/dto/TotalPayInfoDto.java +++ b/src/main/java/space/space_spring/dto/pay/dto/TotalPayInfoDto.java @@ -3,6 +3,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -28,4 +29,6 @@ public class TotalPayInfoDto { private boolean isComplete; + private LocalDateTime createdAt; // 정산 생성일 정보 + } diff --git a/src/main/java/space/space_spring/dto/space/GetSpaceJoinDto.java b/src/main/java/space/space_spring/dto/space/GetSpaceJoinDto.java index 30d1c06d..0e335fa6 100644 --- a/src/main/java/space/space_spring/dto/space/GetSpaceJoinDto.java +++ b/src/main/java/space/space_spring/dto/space/GetSpaceJoinDto.java @@ -22,7 +22,7 @@ public static class Response { private String spaceName; - private String createdAt; // 스페이스 개설일의 정보를 yyyy년 mm월 dd일 형식으로 변환한 문자열 + private LocalDateTime createdAt; private int memberNum; } diff --git a/src/main/java/space/space_spring/service/PayService.java b/src/main/java/space/space_spring/service/PayService.java index 307edde5..5e6af708 100644 --- a/src/main/java/space/space_spring/service/PayService.java +++ b/src/main/java/space/space_spring/service/PayService.java @@ -15,6 +15,8 @@ import space.space_spring.util.space.SpaceUtils; import space.space_spring.util.user.UserUtils; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -181,7 +183,8 @@ public TotalPayInfoDto getTotalPayInfo(Long spaceId, Long payRequestId) { payRequestInfoDto.getTotalTargetNum(), payRequestInfoDto.getReceiveTargetNum(), payTargetInfoDtoList, - payRequestById.isComplete() + payRequestById.isComplete(), + payRequestById.getCreatedAt().atZone(ZoneId.of("Asia/Seoul")).toLocalDateTime() ); } diff --git a/src/main/java/space/space_spring/service/SpaceService.java b/src/main/java/space/space_spring/service/SpaceService.java index 5cda5445..e4b47b77 100644 --- a/src/main/java/space/space_spring/service/SpaceService.java +++ b/src/main/java/space/space_spring/service/SpaceService.java @@ -21,6 +21,7 @@ import space.space_spring.util.user.UserUtils; import space.space_spring.util.userSpace.UserSpaceUtils; +import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Optional; @@ -75,15 +76,11 @@ public GetSpaceJoinDto.Response findSpaceJoin(Long spaceId) { // TODO 3. 해당 스페이스의 멤버 수 get int memberNum = userSpaceDao.calculateSpaceMemberNum(spaceBySpaceId); - // TODO 4. 스페이스 생성일 형식 'yyyy년 mm월 dd일' 로 변경 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy년 MM월 dd일"); - String spaceCreatedDate = getSpaceJoinDto.getCreatedAt().format(formatter); - - // TODO 5. return + // TODO 4. return return new GetSpaceJoinDto.Response( getSpaceJoinDto.getSpaceProfileImg(), getSpaceJoinDto.getSpaceName(), - spaceCreatedDate, + spaceBySpaceId.getCreatedAt().atZone(ZoneId.of("Asia/Seoul")).toLocalDateTime(), memberNum ); }