mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-04 18:07:26 +08:00
[+] Mai2 add query for owned items
This commit is contained in:
@@ -6,7 +6,6 @@ import icu.samnyan.aqua.net.games.*
|
|||||||
import icu.samnyan.aqua.net.utils.*
|
import icu.samnyan.aqua.net.utils.*
|
||||||
import icu.samnyan.aqua.sega.maimai2.model.*
|
import icu.samnyan.aqua.sega.maimai2.model.*
|
||||||
import icu.samnyan.aqua.sega.maimai2.model.userdata.*
|
import icu.samnyan.aqua.sega.maimai2.model.userdata.*
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping
|
import org.springframework.web.bind.annotation.PostMapping
|
||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@@ -112,7 +111,7 @@ class Maimai2(
|
|||||||
mapOf("newName" to newNameFull)
|
mapOf("newName" to newNameFull)
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("get-login-bonus")
|
@API("get-login-bonus")
|
||||||
suspend fun getLoginBonus(@RP token: String) = us.jwt.auth(token) { u ->
|
suspend fun getLoginBonus(@RP token: String) = us.jwt.auth(token) { u ->
|
||||||
us.cardByName(u.username) { card ->
|
us.cardByName(u.username) { card ->
|
||||||
repos.userLoginBonus.findByUser_Card_ExtId(card.extId)
|
repos.userLoginBonus.findByUser_Card_ExtId(card.extId)
|
||||||
@@ -141,6 +140,13 @@ class Maimai2(
|
|||||||
SUCCESS
|
SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@API("owned-items")
|
||||||
|
suspend fun ownedItems(@RP token: String) = us.jwt.auth(token) { u ->
|
||||||
|
us.cardByName(u.username) { card ->
|
||||||
|
repos.userItem.findByUser_Card_ExtId(card.extId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("set-rival")
|
@PostMapping("set-rival")
|
||||||
suspend fun setRival(@RP token: String, @RP rivalUserName: String, @RP isAdd: Boolean) = us.jwt.auth(token) { u ->
|
suspend fun setRival(@RP token: String, @RP rivalUserName: String, @RP isAdd: Boolean) = us.jwt.auth(token) { u ->
|
||||||
us.cardByName(u.username) { myCard ->
|
us.cardByName(u.username) { myCard ->
|
||||||
|
|||||||
Reference in New Issue
Block a user