SQL functions find_comments_* now return VotesAggregates

create Votable Interface
remove usless "resourceTarget" argument for SQL function "count_vote"
This commit is contained in:
2019-10-08 00:26:41 +02:00
parent f20964878f
commit c156e2a7b1
15 changed files with 37 additions and 22 deletions

View File

@@ -18,9 +18,8 @@ class Article(
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
EntityCreatedAt by EntityCreatedAtImp(),
EntityCreatedBy<Citizen> by EntityCreatedByImp(createdBy),
EntityDeletedAt by EntityDeletedAtImp() {
val votes = VoteAggregation(0,0,0)
EntityDeletedAt by EntityDeletedAtImp(),
Votable by VotableImp() {
init {
tags = tags.distinct()

View File

@@ -14,4 +14,5 @@ open class Comment <T: UuidEntity> (
val childrenCount: Int? = null
): Extra<T>(id, createdBy, target),
EntityUpdatedAt by EntityUpdatedAtImp(),
EntityDeletedAt by EntityDeletedAtImp()
EntityDeletedAt by EntityDeletedAtImp(),
Votable by VotableImp()

View File

@@ -0,0 +1,9 @@
package fr.dcproject.entity
interface Votable {
var votes: VoteAggregation
}
class VotableImp: Votable {
override var votes: VoteAggregation = VoteAggregation(0,0,0)
}