mirror of https://github.com/hykilpikonna/AquaDX
[O] Don't expose all fields
parent
94c1974d2f
commit
2a10471e0b
|
@ -76,6 +76,16 @@ class AquaNetUser(
|
||||||
var keychipSessions: MutableList<KeychipSession> = mutableListOf(),
|
var keychipSessions: MutableList<KeychipSession> = mutableListOf(),
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
val computedName get() = displayName.ifEmpty { username }
|
val computedName get() = displayName.ifEmpty { username }
|
||||||
|
|
||||||
|
val publicFields get() = mapOf(
|
||||||
|
"username" to username,
|
||||||
|
"displayName" to displayName,
|
||||||
|
"country" to country,
|
||||||
|
"regTime" to regTime,
|
||||||
|
"profileLocation" to profileLocation,
|
||||||
|
"profileBio" to profileBio,
|
||||||
|
"profilePicture" to profilePicture,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Repository("AquaNetUserRepository")
|
@Repository("AquaNetUserRepository")
|
||||||
|
|
|
@ -2,7 +2,6 @@ package icu.samnyan.aqua.net.games
|
||||||
|
|
||||||
import ext.API
|
import ext.API
|
||||||
import ext.RP
|
import ext.RP
|
||||||
import icu.samnyan.aqua.net.db.AquaNetUser
|
|
||||||
import icu.samnyan.aqua.net.utils.IGenericGamePlaylog
|
import icu.samnyan.aqua.net.utils.IGenericGamePlaylog
|
||||||
|
|
||||||
data class TrendOut(val date: String, val rating: Int, val plays: Int)
|
data class TrendOut(val date: String, val rating: Int, val plays: Int)
|
||||||
|
@ -13,7 +12,7 @@ data class GenericGameSummary(
|
||||||
val name: String,
|
val name: String,
|
||||||
val iconId: Int,
|
val iconId: Int,
|
||||||
|
|
||||||
val aquaUser: AquaNetUser?,
|
val aquaUser: Map<String, Any?>?,
|
||||||
|
|
||||||
val serverRank: Long,
|
val serverRank: Long,
|
||||||
val accuracy: Double,
|
val accuracy: Double,
|
||||||
|
|
|
@ -105,7 +105,7 @@ fun genericUserSummary(
|
||||||
return GenericGameSummary(
|
return GenericGameSummary(
|
||||||
name = user.userName,
|
name = user.userName,
|
||||||
iconId = user.iconId,
|
iconId = user.iconId,
|
||||||
aquaUser = card.aquaUser,
|
aquaUser = card.aquaUser?.publicFields,
|
||||||
serverRank = userDataRepo.getRanking(user.playerRating),
|
serverRank = userDataRepo.getRanking(user.playerRating),
|
||||||
accuracy = plays.acc(),
|
accuracy = plays.acc(),
|
||||||
rating = user.playerRating,
|
rating = user.playerRating,
|
||||||
|
|
Loading…
Reference in New Issue