Skip to content

Commit

Permalink
refactor: 업데이트 시간 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 8, 2024
1 parent 5c2fffd commit 5ecbb18
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ public record UserProfileResponse(
String customId,
Long followerCount,
Long followingCount,
LocalDateTime createAt
Boolean isFollowing,
LocalDateTime createdAt,
LocalDateTime updatedAt
) {
// 정적 팩토리 메서드
public static UserProfileResponse from(User user, Boolean isMyProfile) {
public static UserProfileResponse from(User user, Boolean isMyProfile, Boolean isFollowing) {
return UserProfileResponse.builder()
.userId(user.getId())
.isMyProfile(isMyProfile)
.name(user.getName())
.customId(user.getCustomId())
.followerCount(user.getFollowerCount())
.followingCount(user.getFollowingCount())
.createAt(user.getCreatedAt())
.isFollowing(isFollowing)
.createdAt(user.getCreatedAt())
.updatedAt(user.getUpdatedAt())
.build();
}
}

0 comments on commit 5ecbb18

Please sign in to comment.