SQL functions find_comments_* now return VotesAggregates
create Votable Interface remove usless "resourceTarget" argument for SQL function "count_vote"
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
9
src/main/kotlin/fr/dcproject/entity/Votable.kt
Normal file
9
src/main/kotlin/fr/dcproject/entity/Votable.kt
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user