@@ -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