[+] Add lookup by net username for debug-user-profile

pull/119/head
Clansty 2025-02-12 00:39:54 +08:00
parent 56fe553870
commit 519f67071d
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
2 changed files with 20 additions and 2 deletions

View File

@ -54,13 +54,29 @@ class BotController(
// 1. Check if the card exist
var cards = listOfNotNull(
us.cardRepo.findByExtId(cardId.long)(),
us.cardRepo.findByLuid(cardId)(),
us.cardRepo.findById(cardId.long)(),
).mut
cardId.toLongOrNull()?.let {
cards += listOfNotNull(
us.cardRepo.findById(it)(),
us.cardRepo.findByExtId(it)(),
)
cards += listOfNotNull(
us.userRepo.findByAuId(it)?.cards,
).flatten()
}
cards += listOfNotNull(
us.userRepo.findByEmailIgnoreCase(cardId)?.cards,
us.userRepo.findByUsernameIgnoreCase(cardId)?.cards,
).flatten()
cards += cards.flatMap {
(it.aquaUser?.cards ?: emptyList()) + listOfNotNull(it.aquaUser?.ghostCard)
}
cards = cards.distinctBy { it.id }.mut
return cards.map { card ->

View File

@ -90,6 +90,8 @@ class Maimai2(
"iconId" to userData.iconId,
"plateId" to userData.plateId,
"titleId" to userData.titleId,
"frameId" to userData.frameId,
"partnerId" to userData.partnerId,
"classRank" to userData.classRank,
"playerRating" to userData.playerRating,
"userName" to userData.userName,