diff --git a/core-module/src/main/java/com/congress/coremodule/mypage/application/service/MyPageUseCase.java b/core-module/src/main/java/com/congress/coremodule/mypage/application/service/MyPageUseCase.java index 4a52a9e..ba27fcf 100644 --- a/core-module/src/main/java/com/congress/coremodule/mypage/application/service/MyPageUseCase.java +++ b/core-module/src/main/java/com/congress/coremodule/mypage/application/service/MyPageUseCase.java @@ -64,7 +64,7 @@ public List getMyLegislatorAttendance(String userId) { for (Long legislatorId : legislatorIds) { LegislateLaw law = lawQueryService.findLegislatorLaw(legislatorId); - Integer score = myPageQueryService.getLegislatorVoteScore(law.getId()); + Integer score = myPageQueryService.getLegislatorVoteScore(law.getId(), memberId); Integer totalScore = voteQueryService.getLegislatorTotalScore(law.getName()); MyPageLegislator myPageLegislator = MyPageLegislator.builder() diff --git a/core-module/src/main/java/com/congress/coremodule/mypage/domain/service/MyPageQueryService.java b/core-module/src/main/java/com/congress/coremodule/mypage/domain/service/MyPageQueryService.java index aaa6e2e..e48c11e 100644 --- a/core-module/src/main/java/com/congress/coremodule/mypage/domain/service/MyPageQueryService.java +++ b/core-module/src/main/java/com/congress/coremodule/mypage/domain/service/MyPageQueryService.java @@ -70,9 +70,9 @@ public Integer getVoteScore(Long lawId) { return (vote != null) ? vote.getScore() : 0; } - public Integer getLegislatorVoteScore(Long lawId) { + public Integer getLegislatorVoteScore(Long lawId, Long memberId) { - LegislateVote vote = legislateVoteRepository.findLegislateVoteByLegislateLawId(lawId); + LegislateVote vote = legislateVoteRepository.findLegislateVoteByLegislateLawIdAndMemberId(lawId, memberId); return vote.getScore(); } } diff --git a/core-module/src/main/java/com/congress/coremodule/vote/domain/repository/LegislateVoteRepository.java b/core-module/src/main/java/com/congress/coremodule/vote/domain/repository/LegislateVoteRepository.java index 1b639e7..6122a19 100644 --- a/core-module/src/main/java/com/congress/coremodule/vote/domain/repository/LegislateVoteRepository.java +++ b/core-module/src/main/java/com/congress/coremodule/vote/domain/repository/LegislateVoteRepository.java @@ -16,5 +16,5 @@ public interface LegislateVoteRepository extends JpaRepository findLegislateVotesByMemberId(Long memberId); - LegislateVote findLegislateVoteByLegislateLawId(Long lawId); + LegislateVote findLegislateVoteByLegislateLawIdAndMemberId(Long lawId, Long memberId); }