Skip to content

Commit

Permalink
Merge pull request #33 from Tave-13th-Project-Team-4-Fiurinee/feature…
Browse files Browse the repository at this point in the history
…/anniversary

Feature/anniversary d-day 반환 시 기념일 이름 추가
  • Loading branch information
qormoon authored Jun 26, 2024
2 parents 1e2a0f1 + 830e020 commit 7fb621e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
@Builder
public class AnniversaryResponseDTO {
private Long id;
private String name;
private String anniversaryDate;
private String type;
private List<Map<String, Integer>> dDays;

public static AnniversaryResponseDTO of(Anniversary anniversary, List<Map<String, Integer>> dDays) {
return AnniversaryResponseDTO.builder()
.id(anniversary.getId())
.name(anniversary.getName())
.anniversaryDate(anniversary.getAnniversaryDate().toString())
.type(anniversary.getType().name())
.dDays(dDays)
Expand All @@ -37,6 +39,7 @@ public static AnniversaryResponseDTO empty() {

return AnniversaryResponseDTO.builder()
.id(null)
.name(null)
.anniversaryDate(null)
.type(null)
.dDays(dDays)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static MemberResponseDTO of(Member member) {
.anniversaries(member.getAnniversaries().stream()
.map(anniversary -> Map.<String, Object>of(
"id", anniversary.getId(),
"name", anniversary.getName(),
"anniversaryDate", anniversary.getAnniversaryDate().toString(),
"type", anniversary.getType().name(),
"d-day", anniversaryService.calculateDDay(anniversary)
Expand Down

0 comments on commit 7fb621e

Please sign in to comment.