feature #7: Add routes for comment article
This commit is contained in:
17
src/main/kotlin/fr/dcproject/entity/Comment.kt
Normal file
17
src/main/kotlin/fr/dcproject/entity/Comment.kt
Normal file
@@ -0,0 +1,17 @@
|
||||
package fr.dcproject.entity
|
||||
|
||||
import fr.postgresjson.entity.EntityUpdatedAt
|
||||
import fr.postgresjson.entity.EntityUpdatedAtImp
|
||||
import fr.postgresjson.entity.UuidEntity
|
||||
import java.util.*
|
||||
|
||||
open class Comment <T: UuidEntity> (
|
||||
id: UUID = UUID.randomUUID(),
|
||||
createdBy: Citizen,
|
||||
override var target: T,
|
||||
var content: String,
|
||||
var responses: List<Comment<T>>? = null,
|
||||
var parent: Comment<T>? = null,
|
||||
var parentsIds: List<UUID>? = null
|
||||
): Extra<T>(id, createdBy),
|
||||
EntityUpdatedAt by EntityUpdatedAtImp()
|
||||
@@ -10,7 +10,7 @@ interface ExtraI <T: EntityI<UUID>>:
|
||||
var target: T
|
||||
}
|
||||
|
||||
abstract class Extra<T: EntityI<UUID>>(
|
||||
abstract class Extra<T: UuidEntity>(
|
||||
id: UUID? = UUID.randomUUID(),
|
||||
createdBy: Citizen
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user