Skip to content

Commit

Permalink
feat: 전체 출석 통계 응답값 변경
Browse files Browse the repository at this point in the history
map -> list
  • Loading branch information
ddingmin committed May 23, 2024
1 parent cfcce50 commit 5ffd9e9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data class AttendanceStatsResponse(
val memberCount: Int,

@Schema(description = "출석한 팀 목록")
val teams: Map<Int, AttendanceStatsByTeamResponse>,
val teams: List<AttendanceStatsByTeamResponse>,
) {
data class AttendanceStatsByTeamResponse(
@Schema(description = "팀 번호", example = "1")
Expand Down Expand Up @@ -56,13 +56,13 @@ data class AttendanceStatsResponse(
attendancePercentage = output.attendancePercentage.toInt(),
attendanceCount = output.totalAttendance,
memberCount = output.totalMember,
teams = output.teamAttendances.mapValues { (teamId, teamAttendancesStats) ->
teams = output.teamAttendances.map { (teamId, teamAttendancesStats) ->
AttendanceStatsByTeamResponse.new(
teamNumber = teamId,
attendanceCount = teamAttendancesStats.attendanceCount,
memberCount = teamAttendancesStats.memberCount,
)
}
}.sortedBy { it.teamNumber }
)
}
}
Expand Down

0 comments on commit 5ffd9e9

Please sign in to comment.