Move vote to component

This commit is contained in:
2021-01-22 21:45:02 +01:00
parent c92d0b5640
commit c1b8b508ac
29 changed files with 263 additions and 187 deletions

View File

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

View File

@@ -1,11 +0,0 @@
package fr.dcproject.dto
import fr.dcproject.entity.Votable
class VoteAggregation(parent: Votable) {
val up: Int = parent.votes.up
val neutral: Int = parent.votes.neutral
val down: Int = parent.votes.down
val total: Int = parent.votes.total
val score: Int = parent.votes.score
}