diff --git a/src/main/java/icu/samnyan/aqua/net/games/wacca/Wacca.kt b/src/main/java/icu/samnyan/aqua/net/games/wacca/Wacca.kt new file mode 100644 index 00000000..cf869a00 --- /dev/null +++ b/src/main/java/icu/samnyan/aqua/net/games/wacca/Wacca.kt @@ -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("wacca", WaccaUser::class) { + override val settableFields: Map 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 { + TODO("Not yet implemented") + } + + override suspend fun userSummary(username: String): GenericGameSummary { + TODO("Not yet implemented") + } + + override val shownRanks: List> = emptyList() +} \ No newline at end of file diff --git a/src/main/java/icu/samnyan/aqua/sega/wacca/Constants.kt b/src/main/java/icu/samnyan/aqua/sega/wacca/Constants.kt index cb044938..ba1e4d52 100644 --- a/src/main/java/icu/samnyan/aqua/sega/wacca/Constants.kt +++ b/src/main/java/icu/samnyan/aqua/sega/wacca/Constants.kt @@ -105,10 +105,18 @@ val waccaRatingMult = linkedMapOf( 960_000 to 3.25, 950_000 to 3.0, 940_000 to 2.75, - 930_000 to 2.5, - 920_000 to 2.25, - 910_000 to 2.0, - 900_000 to 1.0, + 920_000 to 2.5, + 900_000 to 2.0, + 850_000 to 1.5, + 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 ) diff --git a/src/main/java/icu/samnyan/aqua/sega/wacca/model/db/Repos.kt b/src/main/java/icu/samnyan/aqua/sega/wacca/model/db/Repos.kt index 39d15865..dd7d8f2b 100644 --- a/src/main/java/icu/samnyan/aqua/sega/wacca/model/db/Repos.kt +++ b/src/main/java/icu/samnyan/aqua/sega/wacca/model/db/Repos.kt @@ -1,13 +1,14 @@ package icu.samnyan.aqua.sega.wacca.model.db import icu.samnyan.aqua.net.games.GenericPlaylogRepo +import icu.samnyan.aqua.net.games.GenericUserDataRepo import jakarta.transaction.Transactional import org.springframework.data.jpa.repository.JpaRepository import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.NoRepositoryBean import org.springframework.stereotype.Component -interface WcUserRepo : JpaRepository { +interface WcUserRepo : JpaRepository, GenericUserDataRepo { fun findByCardExtId(extId: Long): WaccaUser? }