Skip to content

Commit

Permalink
HOTFIX: 팔로우 목록 조회시 프로필 이미지 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 13, 2024
1 parent efe10f3 commit 1423ff6
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
package com.leets.X.domain.follow.dto.response;

import com.leets.X.domain.image.domain.Image;
import com.leets.X.domain.image.dto.request.ImageDto;
import com.leets.X.domain.post.dto.response.PostUserResponse;
import com.leets.X.domain.user.domain.User;
import lombok.Builder;

@Builder
public record FollowResponse(
Long id,
String name,
String customId,
String introduce
PostUserResponse response
// boolean followStatus
) {
public static FollowResponse from(User user) {
return FollowResponse.builder()
.id(user.getId())
.name(user.getName())
.customId(user.getCustomId())
.introduce(user.getIntroduce())
.response(toPostUserResponse(user))
.build();
}

public static PostUserResponse toPostUserResponse(User user) {
ImageDto dto = null;
Image image = user.getImage();
if(image != null){
dto = ImageDto.of(image.getName(), image.getUrl());
}
return PostUserResponse.from(user, dto);
}
}

0 comments on commit 1423ff6

Please sign in to comment.