feature #14: create route for follow article
This commit is contained in:
22
src/main/kotlin/fr/dcproject/entity/Extra.kt
Normal file
22
src/main/kotlin/fr/dcproject/entity/Extra.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
package fr.dcproject.entity
|
||||
|
||||
import fr.postgresjson.entity.EntityCreatedAt
|
||||
import fr.postgresjson.entity.EntityCreatedAtImp
|
||||
import fr.postgresjson.entity.EntityI
|
||||
import fr.postgresjson.entity.UuidEntity
|
||||
import java.util.*
|
||||
|
||||
interface ExtraI <T: EntityI<UUID>>:
|
||||
EntityI<UUID>,
|
||||
EntityCreatedAt {
|
||||
var citizen: Citizen
|
||||
var target: T
|
||||
}
|
||||
|
||||
abstract class Extra<T: EntityI<UUID>>(
|
||||
id: UUID? = UUID.randomUUID(),
|
||||
override var citizen: Citizen
|
||||
):
|
||||
ExtraI<T>,
|
||||
UuidEntity(id),
|
||||
EntityCreatedAt by EntityCreatedAtImp()
|
||||
11
src/main/kotlin/fr/dcproject/entity/Follow.kt
Normal file
11
src/main/kotlin/fr/dcproject/entity/Follow.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package fr.dcproject.entity
|
||||
import fr.postgresjson.entity.EntityI
|
||||
import java.util.*
|
||||
|
||||
class Follow <T: EntityI<UUID>> (
|
||||
id: UUID = UUID.randomUUID(),
|
||||
citizen: Citizen,
|
||||
override var target: T
|
||||
): Extra<T>(id, citizen)
|
||||
|
||||
typealias FollowArticleEntity = Follow<Article>
|
||||
Reference in New Issue
Block a user