Refactor: 내 게시글/댓글/북마크 목록 조회 QueryDSL 기반 개선 (#245) #261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 개요
🔨 작업 내용
1. 내 게시글 목록 조회 개선 (
PostRepositoryImpl)findAllByUserId()→findPostsByUserId()(QueryDSL 기반)User,UserProfile조인을 통해 작성자 정보 즉시 조회createdAt,likeCount,bookmarkCount)2. 내 댓글 목록 조회 개선 (
CommentRepositoryImpl)findAllByUserId) 제거 →findCommentsByUserId()추가Comment,Post,Parent Comment를 조인하여 단일 쿼리로 댓글 및 상위 댓글 정보 조회3. 내 북마크 게시글 목록 조회 개선 (
PostRepositoryImpl)PostBookmarkRepository직접 접근 제거findBookmarkedPostsByUserId()추가Post,User,UserProfile조인 조회4. DTO 및 Service 정리
PostListResponse,MyCommentResponse의 정적 팩토리 제거 →@QueryProjection기반 생성자 사용UserService내 관련 메서드(getMyPosts,getMyComments,getMyBookmarks)에서 QueryDSL 기반 메서드 호출로 교체5. 테스트
🔗 관련 이슈
Closes #{이슈 번호}
📝 참고 사항
QPostListResponse,QMyCommentResponse)로 변경되어 IDE 빌드 시 Q타입 재생성 필요✅ 체크리스트