Move vote to component
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user