Skip to content

Commit b3f3538

Browse files
committed
[FIX] 내댓글 목록 불러오기
1 parent 9f6cfb8 commit b3f3538

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎src/main/java/com/example/dplus/repository/post/comment/PostCommentRepositoryImpl.java‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.example.dplus.repository.post.comment;
22

3-
import com.example.dplus.dto.response.AccountResponseDto;
4-
import com.example.dplus.dto.response.PostResponseDto;
3+
import com.example.dplus.dto.response.AccountResponseDto.MyComment;
4+
import com.example.dplus.dto.response.PostResponseDto.PostComment;
55
import com.querydsl.core.types.Projections;
66
import com.querydsl.jpa.impl.JPAQueryFactory;
77
import lombok.RequiredArgsConstructor;
@@ -20,9 +20,9 @@ public class PostCommentRepositoryImpl implements PostCommentRepositoryCustom{
2020
private final JPAQueryFactory jpaQueryFactory;
2121

2222
@Override
23-
public List<PostResponseDto.PostComment> findPostCommentByPostId(Long postId) {
23+
public List<PostComment> findPostCommentByPostId(Long postId) {
2424
return jpaQueryFactory
25-
.select(Projections.constructor(PostResponseDto.PostComment.class,
25+
.select(Projections.constructor(PostComment.class,
2626
postComment.account.id,
2727
postComment.account.nickname,
2828
postComment.account.profileImg,
@@ -41,9 +41,9 @@ public List<PostResponseDto.PostComment> findPostCommentByPostId(Long postId) {
4141

4242
// 나의 댓글
4343
@Override
44-
public List<AccountResponseDto.MyComment> findPostCommentByAccountId(Long accountId, Pageable pageable) {
44+
public List<MyComment> findPostCommentByAccountId(Long accountId, Pageable pageable) {
4545
return jpaQueryFactory
46-
.select(Projections.constructor(AccountResponseDto.MyComment.class,
46+
.select(Projections.constructor(MyComment.class,
4747
postComment.id,
4848
postComment.content,
4949
postCommentLikes.count(),
@@ -54,8 +54,8 @@ public List<AccountResponseDto.MyComment> findPostCommentByAccountId(Long accoun
5454
post.title
5555
))
5656
.from(postComment)
57-
.join(postComment.account, account).on(account.id.eq(accountId))
58-
.join(postComment.post, post).on(post.account.id.eq(accountId))
57+
//.join(postComment.account, account).on(account.id.eq(accountId))
58+
//.join(postComment.post, post).on(post.account.id.eq(accountId))
5959
.leftJoin(postCommentLikes).on(postComment.id.eq(postCommentLikes.postComment.id))
6060
.offset(pageable.getOffset())
6161
.limit(pageable.getPageSize())

0 commit comments

Comments
 (0)