mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 03:37:27 +08:00
[F] Fix chusan user creation
This commit is contained in:
@@ -42,8 +42,7 @@ val chusanInit: ChusanController.() -> Unit = {
|
|||||||
|
|
||||||
// User handlers
|
// User handlers
|
||||||
"GetUserData" {
|
"GetUserData" {
|
||||||
val user = db.userData.findByCard_ExtId(uid)() ?: (400 - "User not found")
|
db.userData.findByCard_ExtId(uid)()?.let{ u -> mapOf("userId" to uid, "userData" to u) }
|
||||||
mapOf("userId" to uid, "userData" to user)
|
|
||||||
}
|
}
|
||||||
"GetUserOption" {
|
"GetUserOption" {
|
||||||
val userGameOption = db.userGameOption.findSingleByUser_Card_ExtId(uid)() ?: (400 - "User not found")
|
val userGameOption = db.userGameOption.findSingleByUser_Card_ExtId(uid)() ?: (400 - "User not found")
|
||||||
@@ -123,8 +122,8 @@ val chusanInit: ChusanController.() -> Unit = {
|
|||||||
val userPreviewKeys = ("userName,reincarnationNum,level,exp,playerRating,lastGameId,lastRomVersion," +
|
val userPreviewKeys = ("userName,reincarnationNum,level,exp,playerRating,lastGameId,lastRomVersion," +
|
||||||
"lastDataVersion,trophyId,classEmblemMedal,classEmblemBase,battleRankId").split(',').toSet()
|
"lastDataVersion,trophyId,classEmblemMedal,classEmblemBase,battleRankId").split(',').toSet()
|
||||||
|
|
||||||
"GetUserPreview" {
|
"GetUserPreview" api@ {
|
||||||
val user = db.userData.findByCard_ExtId(uid)() ?: (400 - "User not found")
|
val user = db.userData.findByCard_ExtId(uid)() ?: return@api null
|
||||||
val chara = db.userCharacter.findByUserAndCharacterId(user, user.characterId)
|
val chara = db.userCharacter.findByUserAndCharacterId(user, user.characterId)
|
||||||
val option = db.userGameOption.findSingleByUser(user)()
|
val option = db.userGameOption.findSingleByUser(user)()
|
||||||
val userDict = user.toJson().jsonMap().filterKeys { it in userPreviewKeys }
|
val userDict = user.toJson().jsonMap().filterKeys { it in userPreviewKeys }
|
||||||
|
|||||||
@@ -103,6 +103,3 @@ class ChusanController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user