mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-26 12:32:40 +00:00
[+] Backend card linking
This commit is contained in:
parent
1d4e1a8be2
commit
eccdd73908
@ -33,10 +33,17 @@ class CardService(val cardRepo: CardRepository)
|
||||
|
||||
/**
|
||||
* Find a card by its access code
|
||||
*
|
||||
* If the card is linked to a user, return the user's ghost card instead
|
||||
*
|
||||
* @param accessCode String represent of an access code
|
||||
* @return Optional of a Card
|
||||
*/
|
||||
fun getCardByAccessCode(accessCode: String?): Optional<Card> = cardRepo.findByLuid(accessCode)
|
||||
fun getCardByAccessCode(accessCode: String?): Optional<Card> = Optional.ofNullable(
|
||||
cardRepo.findByLuid(accessCode).getOrNull()?.let {
|
||||
it.aquaUser?.ghostCard ?: it
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* Register a new card with access code
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user