[M] Move files

This commit is contained in:
Azalea
2024-03-16 19:10:22 -04:00
parent 29566a6c93
commit 13b4af3734
15 changed files with 49 additions and 58 deletions

View File

@@ -4,8 +4,8 @@ import ext.*
import icu.samnyan.aqua.net.components.JWT
import icu.samnyan.aqua.net.db.AquaUserServices
import icu.samnyan.aqua.net.utils.AquaNetProps
import icu.samnyan.aqua.net.utils.GenericUserDataRepo
import icu.samnyan.aqua.net.utils.IGenericUserData
import icu.samnyan.aqua.net.games.GenericUserDataRepo
import icu.samnyan.aqua.net.games.IGenericUserData
import icu.samnyan.aqua.net.utils.SUCCESS
import icu.samnyan.aqua.sega.general.dao.CardRepository
import icu.samnyan.aqua.sega.general.model.Card

View File

@@ -1,14 +1,8 @@
package icu.samnyan.aqua.net.utils
package icu.samnyan.aqua.net.games
import ext.isoDate
import ext.minus
import icu.samnyan.aqua.net.games.GameApiController
import icu.samnyan.aqua.net.games.GenericGameSummary
import icu.samnyan.aqua.net.games.RankCount
import icu.samnyan.aqua.net.games.TrendOut
import icu.samnyan.aqua.sega.general.model.Card
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.repository.NoRepositoryBean
import java.time.LocalDate
import java.util.*
@@ -46,37 +40,6 @@ fun findTrend(log: List<TrendLog>): List<TrendOut> {
return trend
}
// Here are some interfaces to generalize across multiple games
interface IGenericUserData {
val userName: String
val iconId: Int
val playerRating: Int
val highestRating: Int
val firstPlayDate: Any
val lastPlayDate: Any
val lastRomVersion: String
val totalScore: Long
var card: Card?
}
@NoRepositoryBean
interface GenericUserDataRepo<T : IGenericUserData, ID> : JpaRepository<T, ID> {
fun findByCard(card: Card): T?
fun getRanking(rating: Int): Long
}
interface IGenericGamePlaylog {
val musicId: Int
val level: Int
val userPlayDate: Any
val achievement: Int
val maxCombo: Int
val isFullCombo: Boolean
val beforeRating: Int
val afterRating: Int
val isAllPerfect: Boolean
}
interface GenericPlaylogRepo {
fun findByUserCardExtId(extId: Long): List<IGenericGamePlaylog>
fun findById(id: Long): Optional<IGenericGamePlaylog>

View File

@@ -2,7 +2,10 @@ package icu.samnyan.aqua.net.games
import ext.*
import icu.samnyan.aqua.net.utils.*
import icu.samnyan.aqua.sega.general.model.Card
import kotlinx.serialization.Serializable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.repository.NoRepositoryBean
import kotlin.jvm.optionals.getOrNull
data class TrendOut(val date: String, val rating: Int, val plays: Int)
@@ -61,6 +64,37 @@ data class GenericNoteMeta(
val lvId: Int
)
// Here are some interfaces to generalize across multiple games
interface IGenericUserData {
val userName: String
val iconId: Int
val playerRating: Int
val highestRating: Int
val firstPlayDate: Any
val lastPlayDate: Any
val lastRomVersion: String
val totalScore: Long
var card: Card?
}
@NoRepositoryBean
interface GenericUserDataRepo<T : IGenericUserData, ID> : JpaRepository<T, ID> {
fun findByCard(card: Card): T?
fun getRanking(rating: Int): Long
}
interface IGenericGamePlaylog {
val musicId: Int
val level: Int
val userPlayDate: Any
val achievement: Int
val maxCombo: Int
val isFullCombo: Boolean
val beforeRating: Int
val afterRating: Int
val isAllPerfect: Boolean
}
abstract class GameApiController(name: String) {
val musicMapping: Map<Int, GenericMusicMeta> = GameApiController::class.java
.getResourceAsStream("/meta/$name/music.json")