Skip to content

Commit

Permalink
[FEAT]: Comment Response에 성별, 나이 추가 (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
injae-348 authored Sep 4, 2024
1 parent 504aa52 commit 3170ae3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/main/java/econo/buddybridge/comment/dto/AuthorDto.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand All @@ -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,
Expand Down

0 comments on commit 3170ae3

Please sign in to comment.