add votes to article
This commit is contained in:
@@ -19,6 +19,9 @@ class Article(
|
||||
EntityCreatedAt by EntityCreatedAtImp(),
|
||||
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy),
|
||||
EntityDeletedAt by EntityDeletedAtImp() {
|
||||
|
||||
val votes = VoteAggregation(0,0,0)
|
||||
|
||||
init {
|
||||
tags = tags.distinct()
|
||||
}
|
||||
|
||||
10
src/main/kotlin/fr/dcproject/entity/VoteAggregation.kt
Normal file
10
src/main/kotlin/fr/dcproject/entity/VoteAggregation.kt
Normal file
@@ -0,0 +1,10 @@
|
||||
package fr.dcproject.entity
|
||||
|
||||
import fr.postgresjson.entity.EntityUpdatedAt
|
||||
import fr.postgresjson.entity.EntityUpdatedAtImp
|
||||
|
||||
open class VoteAggregation (
|
||||
val up: Int,
|
||||
val neutral: Int,
|
||||
val down: Int
|
||||
): EntityUpdatedAt by EntityUpdatedAtImp()
|
||||
Reference in New Issue
Block a user