Skip to content

Commit 2c21b47

Browse files
[EA3-183] refactor : incrementStats 메서드 제거 (recalculateStats 방식으로 통일)
1 parent 9e45ed0 commit 2c21b47

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/main/java/grep/neogulcoder/domain/timevote/service/stat/TimeVoteStatService.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,6 @@ public TimeVoteStatResponse getStats(Long studyId, Long userId) {
4545
return TimeVoteStatResponse.from(context.period(), stats);
4646
}
4747

48-
public void incrementStats(Long periodId, List<LocalDateTime> timeSlots) {
49-
log.info("[TimeVoteStatService] 투표 통계 계산 시작: periodId={}, timeSlots={}", periodId, timeSlots);
50-
TimeVotePeriod period = timeVoteStatValidator.getValidTimeVotePeriodByPeriodId(periodId);
51-
52-
Map<LocalDateTime, Long> countMap = timeSlots.stream()
53-
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
54-
55-
try {
56-
for (Map.Entry<LocalDateTime, Long> entry : countMap.entrySet()) {
57-
timeVoteStatRepository.upsertVoteStat( period.getPeriodId(), entry.getKey(), entry.getValue());
58-
}
59-
log.info("[TimeVoteStatService] 투표 통계 반영 완료: periodId={}, 총 {}개의 슬롯", periodId, countMap.size());
60-
} catch (Exception e) {
61-
log.error("[TimeVoteStatService] 통계 반영 실패: periodId={}, 원인={}", periodId, e.getMessage(), e);
62-
throw new BusinessException(TIME_VOTE_STAT_FATAL);
63-
}
64-
}
65-
6648
public void recalculateStats(Long periodId) {
6749
log.info("[TimeVoteStatService] 투표 통계 재계산 시작: periodId={}", periodId);
6850
TimeVotePeriod period = timeVoteStatValidator.getValidTimeVotePeriodByPeriodId(periodId);

0 commit comments

Comments
 (0)