From 1601fd405548c816116f6aaf99697dd08b052dca Mon Sep 17 00:00:00 2001 From: Dev Uni Date: Mon, 4 Dec 2023 04:37:27 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20config=20hotfix=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=20(#249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/config b/src/main/resources/config index 5f96fbef..6c56ec63 160000 --- a/src/main/resources/config +++ b/src/main/resources/config @@ -1 +1 @@ -Subproject commit 5f96fbef563e071fa0ef89925e27086f8a25b1fb +Subproject commit 6c56ec639c26b593ae2ea4ba98c4db1f4c0cf83c From 06a36ad97ad95c163b240d7095c6b27948d10069 Mon Sep 17 00:00:00 2001 From: parksey Date: Mon, 4 Dec 2023 17:25:15 +0900 Subject: [PATCH 2/2] =?UTF-8?q?hotfix:=20=EB=9E=AD=ED=82=B9=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/moabam/api/application/ranking/RankingMapper.java | 2 +- .../com/moabam/api/application/ranking/RankingService.java | 6 +++--- src/main/resources/config | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moabam/api/application/ranking/RankingMapper.java b/src/main/java/com/moabam/api/application/ranking/RankingMapper.java index 817ccdc8..5d17e5d1 100644 --- a/src/main/java/com/moabam/api/application/ranking/RankingMapper.java +++ b/src/main/java/com/moabam/api/application/ranking/RankingMapper.java @@ -25,7 +25,7 @@ public static TopRankingInfo topRankingResponse(int rank, long score, RankingInf public static TopRankingInfo topRankingResponse(int rank, UpdateRanking updateRanking) { return TopRankingInfo.builder() - .rank(rank + 1) + .rank(rank) .score(updateRanking.score()) .nickname(updateRanking.rankingInfo().nickname()) .image(updateRanking.rankingInfo().image()) diff --git a/src/main/java/com/moabam/api/application/ranking/RankingService.java b/src/main/java/com/moabam/api/application/ranking/RankingService.java index 651093f4..4b7b1e9e 100644 --- a/src/main/java/com/moabam/api/application/ranking/RankingService.java +++ b/src/main/java/com/moabam/api/application/ranking/RankingService.java @@ -51,17 +51,17 @@ public void removeRanking(RankingInfo rankingInfo) { public TopRankingResponse getMemberRanking(UpdateRanking myRankingInfo) { List topRankings = getTopRankings(); - Long myRanking = zSetRedisRepository.reverseRank(RANKING, myRankingInfo.rankingInfo()); + long myRanking = zSetRedisRepository.reverseRank(RANKING, myRankingInfo.rankingInfo()) + 1; Optional myTopRanking = topRankings.stream() .filter(topRankingInfo -> Objects.equals(topRankingInfo.memberId(), myRankingInfo.rankingInfo().memberId())) .findFirst(); if (myTopRanking.isPresent()) { - myRanking = (long)myTopRanking.get().rank(); + myRanking = myTopRanking.get().rank(); } - TopRankingInfo myRankingInfoResponse = RankingMapper.topRankingResponse(myRanking.intValue(), myRankingInfo); + TopRankingInfo myRankingInfoResponse = RankingMapper.topRankingResponse((int)myRanking, myRankingInfo); return RankingMapper.topRankingResponses(myRankingInfoResponse, topRankings); } diff --git a/src/main/resources/config b/src/main/resources/config index 6c56ec63..05316d99 160000 --- a/src/main/resources/config +++ b/src/main/resources/config @@ -1 +1 @@ -Subproject commit 6c56ec639c26b593ae2ea4ba98c4db1f4c0cf83c +Subproject commit 05316d99c521b3a26772206d4063cc069e08c848