mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-11 18:17:28 +08:00
[+] Wacca NET controller (incomplete)
This commit is contained in:
41
src/main/java/icu/samnyan/aqua/net/games/wacca/Wacca.kt
Normal file
41
src/main/java/icu/samnyan/aqua/net/games/wacca/Wacca.kt
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package icu.samnyan.aqua.net.games.wacca
|
||||||
|
|
||||||
|
import ext.API
|
||||||
|
import ext.minus
|
||||||
|
import icu.samnyan.aqua.net.db.AquaUserServices
|
||||||
|
import icu.samnyan.aqua.net.games.GameApiController
|
||||||
|
import icu.samnyan.aqua.net.games.GenericGameSummary
|
||||||
|
import icu.samnyan.aqua.net.games.TrendOut
|
||||||
|
import icu.samnyan.aqua.net.games.USERNAME_CHARS
|
||||||
|
import icu.samnyan.aqua.net.utils.AquaNetProps
|
||||||
|
import icu.samnyan.aqua.sega.wacca.model.db.WaccaRepos
|
||||||
|
import icu.samnyan.aqua.sega.wacca.model.db.WaccaUser
|
||||||
|
import icu.samnyan.aqua.sega.wacca.model.db.WcUserPlayLogRepo
|
||||||
|
import icu.samnyan.aqua.sega.wacca.model.db.WcUserRepo
|
||||||
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@API("api/v2/game/wacca")
|
||||||
|
class Wacca(
|
||||||
|
override val us: AquaUserServices,
|
||||||
|
override val playlogRepo: WcUserPlayLogRepo,
|
||||||
|
override val userDataRepo: WcUserRepo,
|
||||||
|
val repos: WaccaRepos,
|
||||||
|
val netProps: AquaNetProps,
|
||||||
|
): GameApiController<WaccaUser>("wacca", WaccaUser::class) {
|
||||||
|
override val settableFields: Map<String, (WaccaUser, String) -> Unit> by lazy { mapOf(
|
||||||
|
"userName" to { u, v -> u.userName = v
|
||||||
|
if (!v.all { it in USERNAME_CHARS }) { 400 - "Invalid character in username" }
|
||||||
|
},
|
||||||
|
) }
|
||||||
|
|
||||||
|
override suspend fun trend(username: String): List<TrendOut> {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun userSummary(username: String): GenericGameSummary {
|
||||||
|
TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
override val shownRanks: List<Pair<Int, String>> = emptyList()
|
||||||
|
}
|
||||||
@@ -105,10 +105,18 @@ val waccaRatingMult = linkedMapOf(
|
|||||||
960_000 to 3.25,
|
960_000 to 3.25,
|
||||||
950_000 to 3.0,
|
950_000 to 3.0,
|
||||||
940_000 to 2.75,
|
940_000 to 2.75,
|
||||||
930_000 to 2.5,
|
920_000 to 2.5,
|
||||||
920_000 to 2.25,
|
900_000 to 2.0,
|
||||||
910_000 to 2.0,
|
850_000 to 1.5,
|
||||||
900_000 to 1.0,
|
800_000 to 1.0,
|
||||||
|
700_000 to 0.8,
|
||||||
|
600_000 to 0.7,
|
||||||
|
500_000 to 0.6,
|
||||||
|
400_000 to 0.5,
|
||||||
|
300_000 to 0.4,
|
||||||
|
200_000 to 0.3,
|
||||||
|
100_000 to 0.2,
|
||||||
|
1 to 0.1,
|
||||||
0 to 0.0
|
0 to 0.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package icu.samnyan.aqua.sega.wacca.model.db
|
package icu.samnyan.aqua.sega.wacca.model.db
|
||||||
|
|
||||||
import icu.samnyan.aqua.net.games.GenericPlaylogRepo
|
import icu.samnyan.aqua.net.games.GenericPlaylogRepo
|
||||||
|
import icu.samnyan.aqua.net.games.GenericUserDataRepo
|
||||||
import jakarta.transaction.Transactional
|
import jakarta.transaction.Transactional
|
||||||
import org.springframework.data.jpa.repository.JpaRepository
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
import org.springframework.data.jpa.repository.Query
|
import org.springframework.data.jpa.repository.Query
|
||||||
import org.springframework.data.repository.NoRepositoryBean
|
import org.springframework.data.repository.NoRepositoryBean
|
||||||
import org.springframework.stereotype.Component
|
import org.springframework.stereotype.Component
|
||||||
|
|
||||||
interface WcUserRepo : JpaRepository<WaccaUser, Long> {
|
interface WcUserRepo : JpaRepository<WaccaUser, Long>, GenericUserDataRepo<WaccaUser> {
|
||||||
fun findByCardExtId(extId: Long): WaccaUser?
|
fun findByCardExtId(extId: Long): WaccaUser?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user