[F] Fix key mismatch

pull/108/head
Azalea 2025-01-11 21:23:12 -05:00
parent 64827ec0fc
commit 111304481f
1 changed files with 17 additions and 17 deletions

View File

@ -16,12 +16,12 @@ fun Maimai2ServletController.initApis() {
} }
"GetUserExtend" { mapOf( "GetUserExtend" { mapOf(
"uid" to uid, "userId" to uid,
"userExtend" to (db.userExtend.findSingleByUser_Card_ExtId(uid)() ?: (404 - "User not found")) "userExtend" to (db.userExtend.findSingleByUser_Card_ExtId(uid)() ?: (404 - "User not found"))
) } ) }
"GetUserData" { mapOf( "GetUserData" { mapOf(
"uid" to uid, "userId" to uid,
"userData" to (db.userData.findByCardExtId(uid)() ?: (404 - "User not found")), "userData" to (db.userData.findByCardExtId(uid)() ?: (404 - "User not found")),
"banState" to 0 "banState" to 0
) } ) }
@ -38,7 +38,7 @@ fun Maimai2ServletController.initApis() {
} }
"GetUserFavorite" { mapOf( "GetUserFavorite" { mapOf(
"uid" to uid, "userId" to uid,
"userFavorite" to db.userFavorite.findByUser_Card_ExtIdAndItemKind(uid, data["itemKind"] as Int) "userFavorite" to db.userFavorite.findByUser_Card_ExtIdAndItemKind(uid, data["itemKind"] as Int)
) } ) }
@ -61,7 +61,7 @@ fun Maimai2ServletController.initApis() {
// rivalId should store and fetch with the id column of table rather than card_ext_id // rivalId should store and fetch with the id column of table rather than card_ext_id
// or user will be able to get others' ext_id by setting them as rival // or user will be able to get others' ext_id by setting them as rival
mapOf( mapOf(
"uid" to uid, "userId" to uid,
"userRivalData" to mapOf( "userRivalData" to mapOf(
"rivalId" to rivalId, "rivalId" to rivalId,
"rivalName" to (db.userData.findById(rivalId)()?.userName ?: "") "rivalName" to (db.userData.findById(rivalId)()?.userName ?: "")
@ -70,7 +70,7 @@ fun Maimai2ServletController.initApis() {
} }
"GetUserOption" { mapOf( "GetUserOption" { mapOf(
"uid" to uid, "userId" to uid,
"userOption" to (db.userOption.findSingleByUser_Card_ExtId(uid)() ?: (404 - "User not found")) "userOption" to (db.userOption.findSingleByUser_Card_ExtId(uid)() ?: (404 - "User not found"))
) } ) }
@ -98,7 +98,7 @@ fun Maimai2ServletController.initApis() {
"CMGetUserPreview" { db.userData.findByCardExtId(uid)()?.let { "CMGetUserPreview" { db.userData.findByCardExtId(uid)()?.let {
mapOf( mapOf(
"uid" to uid, "userId" to uid,
"userName" to it.userName, "userName" to it.userName,
"rating" to it.playerRating, "rating" to it.playerRating,
"lastDataVersion" to it.lastDataVersion, "lastDataVersion" to it.lastDataVersion,
@ -112,7 +112,7 @@ fun Maimai2ServletController.initApis() {
val option = db.userOption.findSingleByUser_Card_ExtId(uid)() val option = db.userOption.findSingleByUser_Card_ExtId(uid)()
mapOf( mapOf(
"uid" to uid, "userId" to uid,
"userName" to d.userName, "userName" to d.userName,
"isLogin" to false, "isLogin" to false,
"lastGameId" to d.lastGameId, "lastGameId" to d.lastGameId,
@ -140,7 +140,7 @@ fun Maimai2ServletController.initApis() {
val shopItemIdList = data["shopItemIdList"] as List<*> val shopItemIdList = data["shopItemIdList"] as List<*>
mapOf( mapOf(
"uid" to uid, "userId" to uid,
"userShopStockList" to shopItemIdList.map { mapOf( "userShopStockList" to shopItemIdList.map { mapOf(
"shopItemId" to it, "shopItemId" to it,
"tradeCount" to 0 "tradeCount" to 0
@ -173,21 +173,21 @@ fun Maimai2ServletController.initApis() {
// Empty List Handlers // Empty List Handlers
"GetUserRecommendRateMusic" { mapOf( "GetUserRecommendRateMusic" { mapOf(
"uid" to uid, "userId" to uid,
"userRecommendRateMusicIdList" to empty "userRecommendRateMusicIdList" to empty
) } ) }
"GetUserRecommendSelectMusic" { mapOf( "GetUserRecommendSelectMusic" { mapOf(
"uid" to uid, "userId" to uid,
"userRecommendSelectionMusicIdList" to empty "userRecommendSelectionMusicIdList" to empty
) } ) }
"GetUserRegion".unpaged { empty } "GetUserRegion".unpaged { empty }
"GetUserGhost".unpaged { empty } "GetUserGhost".unpaged { empty }
"GetUserFriendBonus" { mapOf("uid" to uid, "returnCode" to 0, "getMiles" to 0) } "GetUserFriendBonus" { mapOf("userId" to uid, "returnCode" to 0, "getMiles" to 0) }
"GetUserIntimate" { mapOf("uid" to uid, "length" to 0, "userIntimateList" to empty) } "GetUserIntimate" { mapOf("userId" to uid, "length" to 0, "userIntimateList" to empty) }
"GetTransferFriend" { mapOf("uid" to uid, "transferFriendList" to empty) } "GetTransferFriend" { mapOf("userId" to uid, "transferFriendList" to empty) }
"GetUserKaleidxScope" { mapOf("uid" to uid, "userKaleidxScopeList" to empty) } "GetUserKaleidxScope" { mapOf("userId" to uid, "userKaleidxScopeList" to empty) }
"GetUserNewItem" { mapOf("uid" to uid, "itemKind" to 0, "itemId" to 0) } "GetUserNewItem" { mapOf("userId" to uid, "itemKind" to 0, "itemId" to 0) }
"GetUserNewItemList" { mapOf("uid" to uid, "userItemList" to empty) } "GetUserNewItemList" { mapOf("userId" to uid, "userItemList" to empty) }
"GetUserCardPrintError" static { mapOf("length" to 0, "userPrintDetailList" to empty) } "GetUserCardPrintError" static { mapOf("length" to 0, "userPrintDetailList" to empty) }
"GetUserFriendCheck" static { mapOf("returnCode" to 0) } "GetUserFriendCheck" static { mapOf("returnCode" to 0) }
@ -253,7 +253,7 @@ fun Maimai2ServletController.initApis() {
) } ) }
"GetUserMissionData" { mapOf( "GetUserMissionData" { mapOf(
"uid" to uid, "userId" to uid,
"userWeeklyData" to mapOf ( "userWeeklyData" to mapOf (
"lastLoginWeek" to "", "lastLoginWeek" to "",
"beforeLoginWeek" to "", "beforeLoginWeek" to "",