Skip to content

Commit

Permalink
release: 1.5.8 (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored Mar 3, 2025
2 parents f56ca32 + e264609 commit 12308b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.gitanimals.rank.app
import org.gitanimals.rank.domain.RankQueryRepository
import org.gitanimals.rank.domain.UserContributionRankService
import org.gitanimals.rank.domain.response.RankResponse
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component

@Component
Expand All @@ -11,9 +12,13 @@ class GetRankByUsernameFacade(
private val rankQueryRepository: RankQueryRepository,
) {

private val logger = LoggerFactory.getLogger(this::class.simpleName)

fun invoke(username: String): RankResponse {
val userContributionRank = userContributionRankService.findUserRankByUsername(username)

logger.info("userContributionRank: $userContributionRank")

checkNotNull(userContributionRank) {
"UserContributionRank is null username: $username"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class UserContributionRankService(
}

fun findAllByRankIds(rankWithId: Map<Int, Long>): List<RankResponse> {
val rankIds = rankWithId.values
val rankIds = rankWithId.values.toList()
logger.info("rankIds: $rankIds")
val idWithRank = rankWithId.map { it.value to it.key }.toMap()

return userContributionRankRepository.findAllById(rankIds).map {
Expand Down

0 comments on commit 12308b4

Please sign in to comment.