[+] mai2: support adding rival

This commit is contained in:
Clansty
2024-08-05 20:37:18 +08:00
parent 94ba1f0b09
commit 473f4a4295
14 changed files with 88 additions and 20 deletions

View File

@@ -122,11 +122,13 @@ class Maimai2ServletController(
val getUserRivalData = UserReqHandler { req, userId ->
val rivalId = parsing { (req["rivalId"] as Number).toLong() }
// 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
mapOf(
"userId" to userId,
"userRivalData" to mapOf(
"rivalId" to rivalId,
"rivalName" to (repos.userData.findByCardExtId(rivalId)()?.userName ?: "")
"rivalName" to (repos.userData.findById(rivalId)()?.userName ?: "")
)
)
}