mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 13:17:27 +08:00
[F] Mai2 music ranking fix (#108)
* Revert "[O] No blocking tasks on startup" This reverts commit9d05ef6808. * Revert "[O] Let json lib do its magic" This reverts commit5923987c7f. * Reapply "[O] No blocking tasks on startup" This reverts commite06e8b4cf0. --------- Co-authored-by: Azalea <22280294+hykilpikonna@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@ import kotlin.concurrent.Volatile
|
|||||||
class GetGameRankingHandler(
|
class GetGameRankingHandler(
|
||||||
private val queryFactory: JPAQueryFactory
|
private val queryFactory: JPAQueryFactory
|
||||||
) : BaseHandler {
|
) : BaseHandler {
|
||||||
private data class MusicRankingItem(val id: Int, val point: Long, val userName: String = "")
|
private data class MusicRankingItem(val musicId: Int, val weight: Long)
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var musicRankingCache: List<MusicRankingItem> = emptyList()
|
private var musicRankingCache: List<MusicRankingItem> = emptyList()
|
||||||
@@ -55,7 +55,7 @@ class GetGameRankingHandler(
|
|||||||
override fun handle(request: Map<String, Any>): Any = mapOf(
|
override fun handle(request: Map<String, Any>): Any = mapOf(
|
||||||
"type" to request["type"],
|
"type" to request["type"],
|
||||||
"gameRankingList" to when(request["type"]) {
|
"gameRankingList" to when(request["type"]) {
|
||||||
1 -> musicRankingCache
|
1 -> musicRankingCache.map { mapOf("id" to it.musicId, "point" to it.weight, "userName" to "") }
|
||||||
else -> emptyList()
|
else -> emptyList()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user