File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/main/kotlin/org/gitanimals/rank/app Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class GetRankByUsernameFacade(
2525
2626 return RankResponse (
2727 id = userContributionRank.userId.toString(),
28- rank = rankQueryResponse.rank,
28+ rank = rankQueryResponse.rank + 1 ,
2929 image = userContributionRank.image,
3030 name = userContributionRank.username,
3131 contributions = userContributionRank.weeklyContributions,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class RankQueryFacade(
2727 ): List <RankResponse > {
2828 require(size > 1 ) { " Size must be lager than 1. size: $size " }
2929 require(size <= 20 ) { " Maximum request size is 20. size: $size " }
30- require(rank > 0 ) { " Rank must be larger than 0. rank: $rank " }
30+ require(rank >= 0 ) { " Rank must be larger than 0. rank: $rank " }
3131
3232 val rankWithIds = rankQueryRepository.findAllRank(
3333 rankStartedAt = rank,
@@ -38,7 +38,7 @@ class RankQueryFacade(
3838 return when (rankType) {
3939 WEEKLY_GUILD_CONTRIBUTIONS -> guildContributionRankService.findAllByRankIds(rankWithIds)
4040 WEEKLY_USER_CONTRIBUTIONS -> userContributionRankService.findAllByRankIds(rankWithIds)
41- }.map { it.copy(contributions = max(0 , it.contributions)) }
41+ }.map { it.copy(rank = it.rank + 1 , contributions = max(0 , it.contributions)) }
4242 }
4343
4444 @Cacheable(cacheNames = [" rankTotalCountCacheManager" ], key = " #rankType" )
You can’t perform that action at this time.
0 commit comments