sources API done

This commit is contained in:
Aria Moradi
2020-12-25 06:15:52 +03:30
parent 2f2b0fae7f
commit 7baca45d52
2 changed files with 55 additions and 3 deletions

View File

@@ -9,13 +9,21 @@ import org.jetbrains.exposed.sql.Table
object SourcesTable : IntIdTable() {
val sourceId = long("source_id")
val name= varchar("name", 128)
val lang= varchar("lang", 5)
val name = varchar("name", 128)
val lang = varchar("lang", 5)
val extension = reference("extension", ExtensionsTable)
val partOfFactorySource = bool("part_of_factory_source").default(false)
val positionInFactorySource = integer("position_in_factory_source").nullable()
}
data class SourceDataClass(
val id: Long,
val name: String,
val lang: String,
val iconUrl: String,
val supportsLatest: Boolean
)
class SourceEntity(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<SourceEntity>(SourcesTable)