add votes to article

This commit is contained in:
2019-09-18 01:06:40 +02:00
parent a5b55c2d87
commit acc6ecf114
8 changed files with 52 additions and 3 deletions

View File

@@ -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()
}

View 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()