mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix chusan user creation
parent
91ea0c9c8e
commit
b52916e62c
|
@ -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(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue