Skip to content

Commit

Permalink
feat: 프로필 조회 시 image를 반환하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 11, 2024
1 parent 7a7c6e8 commit 8eede99
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.leets.X.domain.user.dto.response;

import com.leets.X.domain.image.dto.request.ImageDto;
import com.leets.X.domain.user.domain.User;
import lombok.Builder;

Expand All @@ -16,10 +17,11 @@ public record UserProfileResponse(
Long followingCount,
Boolean isFollowing,
LocalDateTime createdAt,
LocalDateTime updatedAt
LocalDateTime updatedAt,
ImageDto profileImage
) {
// 정적 팩토리 메서드
public static UserProfileResponse from(User user, Boolean isMyProfile, Boolean isFollowing) {
public static UserProfileResponse from(User user, Boolean isMyProfile, Boolean isFollowing, ImageDto image) {
return UserProfileResponse.builder()
.userId(user.getId())
.isMyProfile(isMyProfile)
Expand All @@ -31,6 +33,7 @@ public static UserProfileResponse from(User user, Boolean isMyProfile, Boolean i
.isFollowing(isFollowing)
.createdAt(user.getCreatedAt())
.updatedAt(user.getUpdatedAt())
.profileImage(image)
.build();
}
}

0 comments on commit 8eede99

Please sign in to comment.