Add Opinion entity and add opinions on article
This commit is contained in:
@@ -46,7 +46,8 @@ open class ArticleSimple(
|
||||
EntityCreatedBy<CitizenBasicI> by EntityCreatedByImp(createdBy),
|
||||
EntityDeletedAt by EntityDeletedAtImp(),
|
||||
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
||||
Votable by VotableImp()
|
||||
Votable by VotableImp(),
|
||||
Opinionable by OpinionableImp()
|
||||
|
||||
open class ArticleRef(
|
||||
id: UUID = UUID.randomUUID()
|
||||
|
||||
14
src/main/kotlin/fr/dcproject/entity/Opinion.kt
Normal file
14
src/main/kotlin/fr/dcproject/entity/Opinion.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package fr.dcproject.entity
|
||||
|
||||
import fr.postgresjson.entity.immutable.*
|
||||
import java.util.*
|
||||
|
||||
open class Opinion<T : TargetI>(
|
||||
id: UUID = UUID.randomUUID(),
|
||||
override val createdBy: CitizenBasic,
|
||||
override var target: T,
|
||||
var name: String
|
||||
) : ExtraI<T>,
|
||||
UuidEntity(id),
|
||||
EntityCreatedAt by EntityCreatedAtImp(),
|
||||
EntityCreatedBy<CitizenBasicI> by EntityCreatedByImp(createdBy)
|
||||
9
src/main/kotlin/fr/dcproject/entity/Opinionable.kt
Normal file
9
src/main/kotlin/fr/dcproject/entity/Opinionable.kt
Normal file
@@ -0,0 +1,9 @@
|
||||
package fr.dcproject.entity
|
||||
|
||||
interface Opinionable {
|
||||
val opinions: MutableMap<String, Int>
|
||||
}
|
||||
|
||||
class OpinionableImp : Opinionable {
|
||||
override val opinions: MutableMap<String, Int> = mutableMapOf()
|
||||
}
|
||||
Reference in New Issue
Block a user