From 3170ae313ab991ba7c4e515e3ad6f0a3b9608d69 Mon Sep 17 00:00:00 2001 From: JeongInJae <93825184+injae-348@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:13:01 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]:=20Comment=20Response=EC=97=90=20?= =?UTF-8?q?=EC=84=B1=EB=B3=84,=20=EB=82=98=EC=9D=B4=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#129)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../econo/buddybridge/comment/dto/AuthorDto.java | 5 ++++- .../comment/repository/CommentRepositoryImpl.java | 13 ++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/econo/buddybridge/comment/dto/AuthorDto.java b/src/main/java/econo/buddybridge/comment/dto/AuthorDto.java index 6ae57a3..01d9ce4 100644 --- a/src/main/java/econo/buddybridge/comment/dto/AuthorDto.java +++ b/src/main/java/econo/buddybridge/comment/dto/AuthorDto.java @@ -1,13 +1,16 @@ package econo.buddybridge.comment.dto; import com.querydsl.core.annotations.QueryProjection; +import econo.buddybridge.member.entity.Gender; import lombok.Builder; @Builder public record AuthorDto( Long memberId, String nickname, - String profileImg + String profileImg, + Gender gender, + Integer age ) { @QueryProjection diff --git a/src/main/java/econo/buddybridge/comment/repository/CommentRepositoryImpl.java b/src/main/java/econo/buddybridge/comment/repository/CommentRepositoryImpl.java index 0cdbea4..511dc03 100644 --- a/src/main/java/econo/buddybridge/comment/repository/CommentRepositoryImpl.java +++ b/src/main/java/econo/buddybridge/comment/repository/CommentRepositoryImpl.java @@ -1,8 +1,5 @@ package econo.buddybridge.comment.repository; -import static econo.buddybridge.comment.entity.QComment.comment; -import static org.springframework.data.domain.Sort.Order; - import com.querydsl.core.types.OrderSpecifier; import com.querydsl.core.types.Predicate; import com.querydsl.jpa.impl.JPAQueryFactory; @@ -11,10 +8,14 @@ import econo.buddybridge.comment.dto.QAuthorDto; import econo.buddybridge.comment.dto.QCommentResDto; import econo.buddybridge.post.entity.Post; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; +import java.util.List; + +import static econo.buddybridge.comment.entity.QComment.comment; +import static org.springframework.data.domain.Sort.Order; + @RequiredArgsConstructor public class CommentRepositoryImpl implements CommentRepositoryCustom { @@ -32,7 +33,9 @@ public CommentCustomPage findByPost(Post post, Long cursor, Pageable page) { new QAuthorDto( comment.author.id, comment.author.nickname, - comment.author.profileImageUrl + comment.author.profileImageUrl, + comment.author.gender, + comment.author.age ), comment.content, comment.createdAt,