Diploma-1 Main CRUD operations
This commit is contained in:
22
src/main/kotlin/modules/admin/Entity.kt
Normal file
22
src/main/kotlin/modules/admin/Entity.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
package cc.essaenko.modules.admin
|
||||
|
||||
import org.ktorm.entity.Entity
|
||||
import org.ktorm.schema.*
|
||||
import java.time.LocalDateTime
|
||||
|
||||
interface AdminEntity : Entity<AdminEntity> {
|
||||
companion object : Entity.Factory<AdminEntity>()
|
||||
var id: Long
|
||||
var username: String
|
||||
var password: String
|
||||
var createdAt: LocalDateTime
|
||||
var lastLoginAt: LocalDateTime?
|
||||
}
|
||||
|
||||
object AdminUsers : Table<AdminEntity>("admin_user") {
|
||||
val id = long("id").primaryKey().bindTo { it.id }
|
||||
val username = varchar("username").bindTo { it.username }
|
||||
val password = varchar("password_hash").bindTo { it.password }
|
||||
val createdAt = datetime("created_at").bindTo { it.createdAt }
|
||||
val lastLoginAt = datetime("last_login_at").bindTo { it.lastLoginAt }
|
||||
}
|
||||
Reference in New Issue
Block a user