mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-11 23:04:33 -05:00
save sources list
This commit is contained in:
@@ -31,7 +31,22 @@ data class ExtensionDataClass(
|
||||
val lang: String,
|
||||
val isNsfw: Boolean,
|
||||
val apkName: String,
|
||||
val iconUrl : String,
|
||||
val iconUrl: String,
|
||||
val installed: Boolean,
|
||||
val classFQName: String,
|
||||
)
|
||||
|
||||
class ExtensionEntity(id: EntityID<Int>) : IntEntity(id) {
|
||||
companion object : IntEntityClass<ExtensionEntity>(ExtensionsTable)
|
||||
|
||||
var name by ExtensionsTable.name
|
||||
var pkgName by ExtensionsTable.pkgName
|
||||
var versionName by ExtensionsTable.versionName
|
||||
var versionCode by ExtensionsTable.versionCode
|
||||
var lang by ExtensionsTable.lang
|
||||
var isNsfw by ExtensionsTable.isNsfw
|
||||
var apkName by ExtensionsTable.apkName
|
||||
var iconUrl by ExtensionsTable.iconUrl
|
||||
var installed by ExtensionsTable.installed
|
||||
var classFQName by ExtensionsTable.classFQName
|
||||
}
|
||||
|
||||
@@ -1,26 +1,48 @@
|
||||
package ir.armor.tachidesk.database.model
|
||||
|
||||
import org.jetbrains.exposed.dao.Entity
|
||||
import org.jetbrains.exposed.dao.IntEntity
|
||||
import org.jetbrains.exposed.dao.IntEntityClass
|
||||
import org.jetbrains.exposed.dao.*
|
||||
import org.jetbrains.exposed.dao.id.EntityID
|
||||
import org.jetbrains.exposed.dao.id.IdTable
|
||||
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||
import org.jetbrains.exposed.sql.Column
|
||||
import org.jetbrains.exposed.sql.Table
|
||||
|
||||
object SourcesTable : Table() {
|
||||
val id: Column<Long> = long("id")
|
||||
val name: Column<String> = varchar("name", 128)
|
||||
object SourcesTable : IntIdTable() {
|
||||
val sourceId = long("source_id")
|
||||
val name= varchar("name", 128)
|
||||
val lang= varchar("lang", 5)
|
||||
val extension = reference("extension", ExtensionsTable)
|
||||
override val primaryKey = PrimaryKey(id)
|
||||
val partOfFactorySource = bool("part_of_factory_source").default(false)
|
||||
val positionInFactorySource = integer("position_in_factory_source").nullable()
|
||||
}
|
||||
|
||||
//class Source : Entity() {
|
||||
// companion object : Entity<Source>(SourcesTable)
|
||||
class SourceEntity(id: EntityID<Int>) : IntEntity(id) {
|
||||
companion object : IntEntityClass<SourceEntity>(SourcesTable)
|
||||
|
||||
var sourceId by SourcesTable.sourceId
|
||||
var name by SourcesTable.name
|
||||
var lang by SourcesTable.lang
|
||||
var extension by ExtensionEntity referencedOn SourcesTable.extension
|
||||
var partOfFactorySource by SourcesTable.partOfFactorySource
|
||||
var positionInFactorySource by SourcesTable.positionInFactorySource
|
||||
}
|
||||
|
||||
|
||||
//object SourcesTable : IdTable<Long>() {
|
||||
// override val id = long("id").entityId()
|
||||
// val name= varchar("name", 128)
|
||||
// val extension = reference("extension", ExtensionsTable)
|
||||
// val partOfFactorySource = bool("part_of_factory_source").default(false)
|
||||
// val positionInFactorySource = integer("position_in_factory_source").nullable()
|
||||
//
|
||||
// val name by ExtensionsTable.name
|
||||
// val pkgName by ExtensionsTable.pkgName
|
||||
// val versionName by ExtensionsTable.versionName
|
||||
// val versionCode by ExtensionsTable.versionCode
|
||||
// val lang by ExtensionsTable.lang
|
||||
// val isNsfw by ExtensionsTable.isNsfw
|
||||
//}
|
||||
// override val primaryKey = PrimaryKey(id)
|
||||
//}
|
||||
//
|
||||
//class SourceEntity(id: EntityID<Long>) : LongEntity(id) {
|
||||
// companion object : LongEntityClass<SourceEntity>(SourcesTable)
|
||||
//
|
||||
// var name by SourcesTable.name
|
||||
// var extension by SourcesTable.extension
|
||||
// var partOfFactorySource by SourcesTable.partOfFactorySource
|
||||
// var positionInFactorySource by SourcesTable.positionInFactorySource
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user