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,