diff --git a/src/main/java/com/gg/server/domain/rank/dto/RankDto.java b/src/main/java/com/gg/server/domain/rank/dto/RankDto.java index 15fb4b42c..07edd2ede 100644 --- a/src/main/java/com/gg/server/domain/rank/dto/RankDto.java +++ b/src/main/java/com/gg/server/domain/rank/dto/RankDto.java @@ -1,6 +1,7 @@ package com.gg.server.domain.rank.dto; import com.gg.server.domain.rank.redis.RankRedis; +import com.gg.server.domain.user.data.User; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -19,14 +20,14 @@ public class RankDto { private String textColor; - public static RankDto from(RankRedis rankRedis, int rank) { + public static RankDto from(User user, RankRedis rankRedis, Integer rank) { RankDto dto = RankDto.builder() - .intraId(rankRedis.getIntraId()) + .intraId(user.getIntraId()) .rank(rank) .ppp(rankRedis.getPpp()) .statusMessage(rankRedis.getStatusMessage()) .tierImageUri(rankRedis.getTierImageUri()) - .textColor(rankRedis.getTextColor()) + .textColor(user.getTextColor()) .build(); return dto; } diff --git a/src/main/java/com/gg/server/domain/rank/service/RankService.java b/src/main/java/com/gg/server/domain/rank/service/RankService.java index 1abd82f1a..9ea316d56 100644 --- a/src/main/java/com/gg/server/domain/rank/service/RankService.java +++ b/src/main/java/com/gg/server/domain/rank/service/RankService.java @@ -118,9 +118,14 @@ private List createRankList(int startRank, int endRank, Season season) List userRanks = redisRepository.findRanksByUserIds(hashKey, userIds); List rankList = new ArrayList<>(); - for (RankRedis userRank : userRanks) { - rankList.add(RankDto.from(userRank, ++startRank)); + for (int i = 0; i < userRanks.size(); i++) { + User user = userRepository.findById(userIds.get(i)).orElseThrow(UserNotFoundException::new); + rankList.add(RankDto.from(user, userRanks.get(i), ++startRank)); } +// for (RankRedis userRank : userRanks) { +// rankList.add(RankDto.from()) +// rankList.add(RankDto.from(userRank, ++startRank)); +// } return rankList; } } \ No newline at end of file