Add consumer for Notification

This commit is contained in:
2020-02-24 20:44:37 +01:00
parent af33ed9ec3
commit b678f7f2cc
14 changed files with 192 additions and 47 deletions

View File

@@ -1,6 +1,7 @@
package fr.dcproject.event
import fr.dcproject.entity.Article
import fr.postgresjson.entity.Serializable
import fr.postgresjson.entity.immutable.UuidEntity
import io.ktor.application.*
import io.ktor.util.AttributeKey
@@ -12,11 +13,11 @@ abstract class Notification(
val type: String,
val createdAt: DateTime = DateTime.now()
)
abstract class EntityEvent(
open class EntityEvent(
val target: UuidEntity,
type: String,
val action: String
) : Notification(type) {
) : Notification(type), Serializable {
enum class Type(val event: EventDefinition<ArticleUpdate>) {
UPDATE_ARTICLE(EventDefinition<ArticleUpdate>())
}