Skip to content

Commit 6d56afd

Browse files
committed
feat: Added SimpleProfile
1 parent b2f4815 commit 6d56afd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/main/java/dcom/homepage/api/domain/users/dto/UserResponseDto.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ public static List<Profile> of(List<User> userProfileDtoList) {
4444
}
4545
}
4646

47+
@ApiModel(value = "유저 프로필 정보")
48+
@Builder
49+
@Getter
50+
@Setter
51+
@RequiredArgsConstructor
52+
public static class SimpleProfile {
53+
private final String userId;
54+
private final Integer admissionYear;
55+
private final String realName;
56+
57+
public static SimpleProfile of(User user) {
58+
return SimpleProfile.builder()
59+
.userId(user.getUserId())
60+
.admissionYear(user.getAdmissionYear())
61+
.realName(user.getRealName())
62+
.build();
63+
}
64+
65+
public static List<SimpleProfile> of(List<User> userSimpleProfileDtoList) {
66+
return userSimpleProfileDtoList.stream()
67+
.map(SimpleProfile::of)
68+
.collect(Collectors.toList());
69+
}
70+
}
71+
4772
@ApiModel(value = "유저 회원 가입 정보")
4873
@Builder
4974
@Getter @Setter

0 commit comments

Comments
 (0)