diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyDetailService.java b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyDetailService.java index 19d36b67e..69af3d44f 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyDetailService.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/application/MentorStudyDetailService.java @@ -131,7 +131,7 @@ public StudyStatisticsResponse getStudyStatistics(Long studyId) { studyValidator.validateStudyMentor(currentMember, study); List studyHistories = studyHistoryRepository.findAllByStudyId(studyId); - long wholeStudentCount = studyHistories.size(); + long totalStudentCount = studyHistories.size(); long studyCompleteStudentCount = studyHistories.stream().filter(StudyHistory::isComplete).count(); @@ -141,14 +141,14 @@ public StudyStatisticsResponse getStudyStatistics(Long studyId) { .count(); List studyWeekStatisticsResponses = - calculateStudyWeekStatistics(studyDetails, wholeStudentCount); + calculateStudyWeekStatistics(studyDetails, totalStudentCount); long averageAttendanceRate = calculateAverageWeekAttendanceRate(studyWeekStatisticsResponses, openedWeekCount); long averageAssignmentSubmitRate = calculateAverageWeekAssignmentSubmitRate(studyWeekStatisticsResponses, openedWeekCount); return StudyStatisticsResponse.of( - wholeStudentCount, + totalStudentCount, studyCompleteStudentCount, averageAttendanceRate, averageAssignmentSubmitRate, @@ -156,7 +156,7 @@ public StudyStatisticsResponse getStudyStatistics(Long studyId) { } private List calculateStudyWeekStatistics( - List studyDetails, Long wholeStudentCount) { + List studyDetails, Long totalStudentCount) { return studyDetails.stream() .map((studyDetail -> { @@ -164,7 +164,7 @@ private List calculateStudyWeekStatistics( return StudyWeekStatisticsResponse.createCanceledWeekStatistics(studyDetail.getWeek()); } - if (wholeStudentCount == 0) { + if (totalStudentCount == 0) { return StudyWeekStatisticsResponse.createOpenedWeekStatistics(studyDetail.getWeek(), 0L, 0L); } @@ -174,8 +174,8 @@ private List calculateStudyWeekStatistics( return StudyWeekStatisticsResponse.createOpenedWeekStatistics( studyDetail.getWeek(), - Math.round(attendanceCount / (double) wholeStudentCount * 100), - Math.round(assignmentCount / (double) wholeStudentCount * 100)); + Math.round(attendanceCount / (double) totalStudentCount * 100), + Math.round(assignmentCount / (double) totalStudentCount * 100)); })) .toList(); }