|
1 | 1 | package io.f1.backend.domain.stat.dao; |
2 | 2 |
|
| 3 | +import static java.lang.Long.parseLong; |
3 | 4 | import static java.util.Objects.requireNonNull; |
4 | 5 |
|
5 | 6 | import io.f1.backend.domain.stat.dto.StatPageResponse; |
@@ -50,8 +51,8 @@ public void initialize(StatWithUserSummary stat) { |
50 | 51 |
|
51 | 52 | // stat:user:{id} |
52 | 53 | hashOps.put(statUserKey, "nickname", stat.nickname()); |
53 | | - hashOps.put(statUserKey, "totalGames", stat.totalGames()); |
54 | | - hashOps.put(statUserKey, "winningGames", stat.winningGames()); |
| 54 | + hashOps.put(statUserKey, "totalGames", String.valueOf(stat.totalGames())); |
| 55 | + hashOps.put(statUserKey, "winningGames", String.valueOf(stat.winningGames())); |
55 | 56 |
|
56 | 57 | // stat:rank |
57 | 58 | zSetOps.add(STAT_RANK, stat.userId(), stat.score()); |
@@ -135,8 +136,8 @@ private StatResponse convertToStatResponse(TypedTuple<Object> rank, int rankValu |
135 | 136 | return new StatResponse( |
136 | 137 | rankValue, |
137 | 138 | (String) statUserMap.get("nickname"), |
138 | | - (long) statUserMap.get("totalGames"), |
139 | | - (long) statUserMap.get("winningGames"), |
| 139 | + parseLong((String) statUserMap.get("totalGames")), |
| 140 | + parseLong((String) statUserMap.get("winningGames")), |
140 | 141 | requireNonNull(rank.getScore()).longValue()); |
141 | 142 | } |
142 | 143 |
|
@@ -166,8 +167,8 @@ public MyPageInfo getStatByUserId(long userId) { |
166 | 167 | return new MyPageInfo( |
167 | 168 | (String) statMap.get("nickname"), |
168 | 169 | rank + 1, |
169 | | - (long) statMap.get("totalGames"), |
170 | | - (long) statMap.get("winningGames"), |
| 170 | + parseLong((String) statMap.get("totalGames")), |
| 171 | + parseLong((String) statMap.get("winningGames")), |
171 | 172 | score.longValue()); |
172 | 173 | } |
173 | 174 | } |
0 commit comments