Skip to content

Commit

Permalink
Merge pull request #122 from KUIT-Space/hotfix/#121/정산-현황-상세조회-api-시간…
Browse files Browse the repository at this point in the history
…정보추가

HotFix : 정산 상제조회 api response에 생성일 정보 추가
  • Loading branch information
seongjunnoh authored Aug 18, 2024
2 parents 9080b49 + 70eb210 commit cb97805
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -28,4 +29,6 @@ public class TotalPayInfoDto {

private boolean isComplete;

private LocalDateTime createdAt; // 정산 생성일 정보

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class Response {

private String spaceName;

private String createdAt; // 스페이스 개설일의 정보를 yyyy년 mm월 dd일 형식으로 변환한 문자열
private LocalDateTime createdAt;

private int memberNum;
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/space/space_spring/service/PayService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
);
}

Expand Down
9 changes: 3 additions & 6 deletions src/main/java/space/space_spring/service/SpaceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
);
}
Expand Down

0 comments on commit cb97805

Please sign in to comment.