[+] More work on import feature (TODO)

This commit is contained in:
Azalea
2024-03-20 18:52:11 -04:00
parent ac18234e29
commit fc8ecb7470
7 changed files with 86 additions and 59 deletions

View File

@@ -1,15 +1,15 @@
package icu.samnyan.aqua.net.games
import com.fasterxml.jackson.annotation.JsonIgnore
import icu.samnyan.aqua.sega.general.model.Card
import jakarta.persistence.*
import kotlinx.serialization.Serializable
import org.springframework.context.annotation.Import
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.NoRepositoryBean
import java.util.*
import kotlin.system.measureTimeMillis
data class TrendOut(val date: String, val rating: Int, val plays: Int)
@@ -98,6 +98,22 @@ interface IGenericGamePlaylog {
val isAllPerfect: Boolean
}
@MappedSuperclass
open class BaseEntity(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonIgnore
var id: Long = 0
)
@MappedSuperclass
open class UserMappedEntity<T : IGenericUserData> : BaseEntity() {
@JsonIgnore
@ManyToOne
@JoinColumn(name = "user_id")
open var user: T? = null
}
@NoRepositoryBean
interface GenericUserDataRepo<T : IGenericUserData> : JpaRepository<T, Long> {
fun findByCard(card: Card): T?