forked from Cookies_Github_mirror/AquaDX
[+] Allow querying card user ids
This commit is contained in:
@@ -19,25 +19,25 @@ class Chusan(
|
||||
val userGeneralDataRepository: UserGeneralDataRepository
|
||||
): GameApiController
|
||||
{
|
||||
override fun trend(@RP username: Str): List<TrendOut> = us.byName(username) { u ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
override fun trend(@RP username: Str): List<TrendOut> = us.cardByName(username) { card ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(card.extId)
|
||||
.map { TrendLog(it.playDate.toString(), it.playerRating) })
|
||||
}
|
||||
|
||||
// Only show > AAA rank
|
||||
private val shownRanks = chu3Scores.filter { it.first >= 95 * 10000 }
|
||||
|
||||
override fun userSummary(@RP username: Str) = us.byName(username) { u ->
|
||||
override fun userSummary(@RP username: Str) = us.cardByName(username) { card ->
|
||||
// Summary values: total plays, player rating, server-wide ranking
|
||||
// number of each rank, max combo, number of full combo, number of all perfect
|
||||
val extra = userGeneralDataRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
val extra = userGeneralDataRepository.findByUser_Card_ExtId(card.extId)
|
||||
.associate { it.propertyKey to it.propertyValue }
|
||||
|
||||
val ratingComposition = mapOf(
|
||||
"recent" to (extra["recent_rating_list"] ?: ""),
|
||||
)
|
||||
|
||||
genericUserSummary(u, userDataRepository, userPlaylogRepository, shownRanks, ratingComposition)
|
||||
genericUserSummary(card, userDataRepository, userPlaylogRepository, shownRanks, ratingComposition)
|
||||
}
|
||||
|
||||
override fun ranking() = genericRanking(userDataRepository, userPlaylogRepository)
|
||||
|
||||
@@ -19,16 +19,16 @@ class Maimai2(
|
||||
val userGeneralDataRepository: UserGeneralDataRepository
|
||||
): GameApiController
|
||||
{
|
||||
override fun trend(@RP username: Str): List<TrendOut> = us.byName(username) { u ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
override fun trend(@RP username: Str): List<TrendOut> = us.cardByName(username) { card ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(card.extId)
|
||||
.map { TrendLog(it.playDate, it.afterRating) })
|
||||
}
|
||||
|
||||
// Only show > S rank
|
||||
private val shownRanks = mai2Scores.filter { it.first >= 97 * 10000 }
|
||||
|
||||
override fun userSummary(@RP username: Str) = us.byName(username) { u ->
|
||||
val extra = userGeneralDataRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
override fun userSummary(@RP username: Str) = us.cardByName(username) { card ->
|
||||
val extra = userGeneralDataRepository.findByUser_Card_ExtId(card.extId)
|
||||
.associate { it.propertyKey to it.propertyValue }
|
||||
|
||||
val ratingComposition = mapOf(
|
||||
@@ -36,7 +36,7 @@ class Maimai2(
|
||||
"best15" to (extra["recent_rating_new"] ?: "")
|
||||
)
|
||||
|
||||
genericUserSummary(u, userDataRepository, userPlaylogRepository, shownRanks, ratingComposition)
|
||||
genericUserSummary(card, userDataRepository, userPlaylogRepository, shownRanks, ratingComposition)
|
||||
}
|
||||
|
||||
override fun ranking() = genericRanking(userDataRepository, userPlaylogRepository)
|
||||
|
||||
@@ -16,20 +16,20 @@ class Ongeki(
|
||||
val userDataRepository: UserDataRepository,
|
||||
val userGeneralDataRepository: UserGeneralDataRepository
|
||||
): GameApiController {
|
||||
override fun trend(username: String) = us.byName(username) { u ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
override fun trend(username: String) = us.cardByName(username) { card ->
|
||||
findTrend(userPlaylogRepository.findByUser_Card_ExtId(card.extId)
|
||||
.map { TrendLog(it.playDate, it.playerRating) })
|
||||
}
|
||||
|
||||
private val shownRanks = ongekiScores.filter { it.first >= 950000 }
|
||||
|
||||
override fun userSummary(username: String) = us.byName(username) { u ->
|
||||
override fun userSummary(username: String) = us.cardByName(username) { card ->
|
||||
// val extra = userGeneralDataRepository.findByUser_Card_ExtId(u.ghostCard.extId)
|
||||
// .associate { it.propertyKey to it.propertyValue }
|
||||
|
||||
// TODO: Rating composition
|
||||
|
||||
genericUserSummary(u, userDataRepository, userPlaylogRepository, shownRanks, mapOf())
|
||||
genericUserSummary(card, userDataRepository, userPlaylogRepository, shownRanks, mapOf())
|
||||
}
|
||||
|
||||
override fun ranking() = genericRanking(userDataRepository, userPlaylogRepository)
|
||||
|
||||
Reference in New Issue
Block a user