forked from Cookies_Github_mirror/AquaDX
[O] Let json lib do its magic
This commit is contained in:
@@ -18,7 +18,7 @@ import kotlin.concurrent.Volatile
|
||||
class GetGameRankingHandler(
|
||||
private val queryFactory: JPAQueryFactory
|
||||
) : BaseHandler {
|
||||
private data class MusicRankingItem(val musicId: Int, val weight: Long)
|
||||
private data class MusicRankingItem(val id: Int, val point: Long, val userName: String = "")
|
||||
|
||||
@Volatile
|
||||
private var musicRankingCache: List<MusicRankingItem> = emptyList()
|
||||
@@ -55,7 +55,7 @@ class GetGameRankingHandler(
|
||||
override fun handle(request: Map<String, Any>): Any = mapOf(
|
||||
"type" to request["type"],
|
||||
"gameRankingList" to when(request["type"]) {
|
||||
1 -> musicRankingCache.map { mapOf("id" to it.musicId, "point" to it.weight, "userName" to "") }
|
||||
1 -> musicRankingCache
|
||||
else -> emptyList()
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user