#15 Count total view
Create Viewable interface Set Article as Viewable Create ES client Now view article increment view count Create index on start application add an extention in ApplicationCall, to get citizen or return null
This commit is contained in:
@@ -18,7 +18,8 @@ class Article(
|
||||
override var lastVersion: Boolean = false,
|
||||
createdBy: CitizenBasic
|
||||
) : ArticleFull,
|
||||
ArticleBasic(id, title, anonymous, content, description, tags, createdBy)
|
||||
ArticleBasic(id, title, anonymous, content, description, tags, createdBy),
|
||||
Viewable by ViewableImp()
|
||||
|
||||
open class ArticleBasic(
|
||||
id: UUID = UUID.randomUUID(),
|
||||
@@ -41,14 +42,20 @@ open class ArticleSimple(
|
||||
override var title: String,
|
||||
override val createdBy: CitizenBasic
|
||||
) : ArticleSimpleI,
|
||||
ArticleRef(id),
|
||||
ArticleRefVersioning(id),
|
||||
EntityCreatedAt by EntityCreatedAtImp(),
|
||||
EntityCreatedBy<CitizenBasicI> by EntityCreatedByImp(createdBy),
|
||||
EntityDeletedAt by EntityDeletedAtImp(),
|
||||
EntityVersioning<UUID, Int> by UuidEntityVersioning(),
|
||||
Votable by VotableImp(),
|
||||
Opinionable by OpinionableImp()
|
||||
|
||||
open class ArticleRefVersioning(
|
||||
id: UUID = UUID.randomUUID(),
|
||||
versionNumber: Int? = null,
|
||||
versionId: UUID = UUID.randomUUID()
|
||||
) : ArticleRef(id),
|
||||
EntityVersioning<UUID, Int> by UuidEntityVersioning(versionNumber, versionId)
|
||||
|
||||
open class ArticleRef(
|
||||
id: UUID = UUID.randomUUID()
|
||||
) : ArticleI, TargetRef(id)
|
||||
|
||||
Reference in New Issue
Block a user