Skip to content

Commit

Permalink
벌금 계산에 하루에 풀어야하는 개수를 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
gidskql6671 committed May 28, 2024
1 parent 95b5738 commit 95bd90f
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,19 @@ class FineService(
val userDto = user.toUserDto()

if (problemsOfUsers.containsKey(user.id)) {
val solvedDates = problemsOfUsers[user.id]!!.map { it.solvedDate }.toSet()
val solvedDates = problemsOfUsers[user.id]!!
.groupingBy { it.solvedDate }.eachCount()

result[userDto] = targetDates.count { !solvedDates.contains(it) } * group.fine
myLogger.error { solvedDates }
myLogger.error { targetDates }
result[userDto] = targetDates.count {
if (solvedDates.containsKey(it)) {
solvedDates[it]!! < group.goalSolveCount
}
else {
true
}
} * group.fine
}
else {
result[userDto] = targetDates.size * group.fine
Expand Down

0 comments on commit 95bd90f

Please sign in to comment.