-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
121 additions
and
12 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
29 changes: 29 additions & 0 deletions
29
...a/goorm/kgu/familynote/domain/family/family/presentation/response/FamilyListResponse.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,29 @@ | ||
package goorm.kgu.familynote.domain.family.family.presentation.response; | ||
|
||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import goorm.kgu.familynote.domain.family.family.domain.Family; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record FamilyListResponse( | ||
@Schema( | ||
description = "가족 그룹 목록", | ||
example = "[{\"familyId\": 1, \"familyName\": \"행복한 우리집\", \"myName\": \"이한음\", \"familyMembers\": [{\"familyMemberId\": 1, \"nickName\": \"이한음\"}, {\"familyMemberId\": 2, \"nickName\": \"전민주\"}]}]", | ||
requiredMode = REQUIRED | ||
) | ||
List<FamilyResponse> contents | ||
) { | ||
public static FamilyListResponse of(List<Family> familyList, String myName) { | ||
return FamilyListResponse.builder() | ||
.contents(familyList.stream() | ||
.map(family -> FamilyResponse.of(family, myName)) | ||
.collect(Collectors.toList()) | ||
) | ||
.build(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.../java/goorm/kgu/familynote/domain/family/family/presentation/response/FamilyResponse.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
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