Skip to content

Commit

Permalink
Merge pull request #116 from DEPthes/develop
Browse files Browse the repository at this point in the history
V.4.2.2 Deploy && [FIX]: 스크랩 목록 조회 시 작성자 아바타 응답 추가
  • Loading branch information
phonil authored Aug 21, 2024
2 parents 1223c91 + 6bf37f2 commit 516e543
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import mvp.deplog.domain.member.domain.Member;
import mvp.deplog.domain.member.domain.repository.MemberRepository;
import mvp.deplog.domain.member.dto.Avatar;
import mvp.deplog.domain.post.domain.Post;
import mvp.deplog.domain.post.domain.repository.PostRepository;
import mvp.deplog.domain.post.dto.response.PostListRes;
Expand Down Expand Up @@ -80,12 +81,21 @@ public SuccessResponse<PageResponse> getScrapPosts(Long memberId, int page, int

Page<PostListRes> scrapPostList = scrapPosts.map(scrap -> {
Post post = scrap.getPost();
Member writer = post.getMember();
return PostListRes.builder()
.id(post.getId())
.title(post.getTitle())
.previewContent(post.getPreviewContent())
.previewImage(post.getPreviewImage())
.createdDate(post.getCreatedDate().toLocalDate())
.avatar(Avatar.builder()
.avatarFace(writer.getAvatarFace())
.avatarBody(writer.getAvatarBody())
.avatarEyes(writer.getAvatarEyes())
.avatarNose(writer.getAvatarNose())
.avatarMouth(writer.getAvatarMouth())
.build()
)
.name(post.getMember().getName())
.viewCount(post.getViewCount())
.likeCount(post.getLikeCount())
Expand Down

0 comments on commit 516e543

Please sign in to comment.