forked from Cookies_Github_mirror/AquaDX
[+] Minato migration
This commit is contained in:
@@ -5,6 +5,26 @@ import icu.samnyan.aqua.net.db.AquaNetUser
|
||||
import jakarta.persistence.*
|
||||
import java.time.LocalDateTime
|
||||
|
||||
enum class CardStatus {
|
||||
NORMAL,
|
||||
|
||||
// Reserved for future use
|
||||
NORMAL_RESERVED_1,
|
||||
NORMAL_RESERVED_2,
|
||||
NORMAL_RESERVED_3,
|
||||
NORMAL_RESERVED_4,
|
||||
NORMAL_RESERVED_5,
|
||||
NORMAL_RESERVED_6,
|
||||
NORMAL_RESERVED_7,
|
||||
NORMAL_RESERVED_8,
|
||||
NORMAL_RESERVED_9,
|
||||
|
||||
// Deleted statuses
|
||||
OVERWRITTEN,
|
||||
DELETED,
|
||||
MIGRATED_TO_MINATO,
|
||||
}
|
||||
|
||||
/**
|
||||
* @author samnyan (privateamusement@protonmail.com)
|
||||
*/
|
||||
@@ -44,6 +64,9 @@ class Card(
|
||||
// Unfortunately some people decide to cheat and upload all perfect scores :(
|
||||
// This will not affect gameplay behavior, but will hide the user from ranking
|
||||
var rankingBanned: Boolean = false,
|
||||
|
||||
@Enumerated(EnumType.ORDINAL)
|
||||
var status: CardStatus = CardStatus.NORMAL,
|
||||
) {
|
||||
@Suppress("unused") // Used by serialization
|
||||
val isLinked get() = aquaUser != null
|
||||
|
||||
@@ -31,16 +31,6 @@ class CardService(val cardRepo: CardRepository)
|
||||
*/
|
||||
fun getCardByExtId(extId: Long?): Optional<Card> = cardRepo.findByExtId(extId)
|
||||
|
||||
/**
|
||||
* Find a card by its access code
|
||||
*
|
||||
* @param accessCode String represent of an access code
|
||||
* @return Optional of a Card
|
||||
*/
|
||||
fun getCardByAccessCode(accessCode: String?): Optional<Card> = Optional.ofNullable(
|
||||
cardRepo.findByLuid(accessCode).getOrNull()
|
||||
)
|
||||
|
||||
/**
|
||||
* Register a new card with access code
|
||||
* @param accessCode String represent of an access code
|
||||
|
||||
Reference in New Issue
Block a user