From 9c9321e1e8fa4c51a929e64ef72f3799a64aec64 Mon Sep 17 00:00:00 2001 From: kckc0608 Date: Tue, 15 Oct 2024 21:45:13 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B3=80=EC=88=98=EB=AA=85=20total?= =?UTF-8?q?=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/MentorStudyDetailService.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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(); }