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

This commit is contained in:
Clansty
2025-02-12 00:39:54 +08:00
parent 56fe553870
commit 519f67071d
2 changed files with 20 additions and 2 deletions

View File

@@ -54,13 +54,29 @@ class BotController(
// 1. Check if the card exist // 1. Check if the card exist
var cards = listOfNotNull( var cards = listOfNotNull(
us.cardRepo.findByExtId(cardId.long)(),
us.cardRepo.findByLuid(cardId)(), us.cardRepo.findByLuid(cardId)(),
us.cardRepo.findById(cardId.long)(),
).mut ).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 { cards += cards.flatMap {
(it.aquaUser?.cards ?: emptyList()) + listOfNotNull(it.aquaUser?.ghostCard) (it.aquaUser?.cards ?: emptyList()) + listOfNotNull(it.aquaUser?.ghostCard)
} }
cards = cards.distinctBy { it.id }.mut cards = cards.distinctBy { it.id }.mut
return cards.map { card -> return cards.map { card ->

View File

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