✨ [no_ci] Add routes for inject,get and remove image of a user. Update pom.xml dependencies.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
3e198b7605
commit
e291e0064b
@ -0,0 +1,29 @@
|
||||
package allin.data.postgres.entities
|
||||
|
||||
import allin.model.UserImage
|
||||
import org.ktorm.database.Database
|
||||
import org.ktorm.entity.Entity
|
||||
import org.ktorm.entity.sequenceOf
|
||||
import org.ktorm.schema.Table
|
||||
import org.ktorm.schema.bytes
|
||||
import org.ktorm.schema.varchar
|
||||
|
||||
interface UserImageEntity : Entity<UserImageEntity> {
|
||||
companion object : Entity.Factory<UserImageEntity>()
|
||||
|
||||
var id: String
|
||||
var image: ByteArray
|
||||
|
||||
fun toUserImage() =
|
||||
UserImage(
|
||||
id = id,
|
||||
image = image,
|
||||
)
|
||||
}
|
||||
|
||||
object UsersImageEntity : Table<UserImageEntity>("userimage") {
|
||||
val id = varchar("user_id").primaryKey().bindTo { it.id }
|
||||
val image = bytes("image").bindTo { it.image }
|
||||
}
|
||||
|
||||
val Database.usersimage get() = this.sequenceOf(UsersImageEntity)
|
@ -1,4 +1,5 @@
|
||||
package allin
|
||||
|
||||
class ApplicationTest {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in new issue