forked from Cookies_Github_mirror/AquaDX
[M] Move files
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user