Fix/#125 service code refactor#135
Merged
Merged
Conversation
- VoteServiceImplTest: 공백 제목, 포인트 지급/미지급, getVoteDetailById(비로그인/투표완료), updatePinStatus(권한없음/기존핀해제/핀해제) 케이스 추가 (9 → 17개) - ReportServiceImplTest: 중복 투표 신고, 존재하지 않는 대상 신고 케이스 추가 (5 → 7개) - CommentLikeServiceImplTest: 존재하지 않는 회원/댓글 좋아요 케이스 추가 (2 → 4개) - VoteControllerTest: GlobalExceptionHandler 응답 형식에 맞게 $.type 검증 제거
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
작업 내용
🔧 N+1 쿼리 제거
getHotIssueVote(),getTrendingVote()에서findAll()후 루프로save()하던 패턴 제거VoteRepositoryCustom에findHotIssueVote(),findTrendingVote()추가LEFT JOIN+COALESCE로 단일 쿼리로 개선totalVoteCount + commentGroup.totalCommentCount(점수 동일 시 최신순)🧹 코드 품질 개선
getVoteDetailById()내System.out.println디버그 로그 3개 제거getTrendingVote()불필요한@Transactional제거 (데이터 변경 없음)processVote()내[cite: image_...]잔존 주석 제거✅ 테스트 케이스 보강
VoteServiceImplTest: 9개 → 17개getVoteDetailById비로그인/투표완료 케이스updatePinStatus권한없음/기존핀해제/핀해제ReportServiceImplTest: 5개 → 7개CommentLikeServiceImplTest: 2개 → 4개VoteControllerTest:GlobalExceptionHandler응답 형식에 맞게$.type검증 제거변경 파일
VoteRepositoryCustom.java— 인터페이스 메서드 2개 추가VoteRepositoryImpl.java— QueryDSL 구현체 추가VoteServiceImpl.java— N+1 제거, 로그/주석 정리VoteServiceImplTest.java,ReportServiceImplTest.java,CommentLikeServiceImplTest.java,VoteControllerTest.java— 테스트 보강