remove modification info from registered posts

This commit is contained in:
InsanusMokrassar 2019-11-25 00:54:34 +06:00
parent 30eefcd87b
commit 5859c8bb44
3 changed files with 3 additions and 8 deletions

View File

@ -23,7 +23,6 @@ interface RegisteredPost : Post {
override val content: ContentIds
val creationDate: DateTime
val modificationDate: DateTime
}
/**
@ -40,6 +39,5 @@ data class SimplePost(
data class SimpleRegisteredPost(
override val id: PostId,
override val content: ContentIds,
override val creationDate: DateTime = DateTime.now(),
override val modificationDate: DateTime = creationDate
override val creationDate: DateTime = DateTime.now()
) : RegisteredPost

View File

@ -55,8 +55,7 @@ class InMemoryPostsAPI(
val newPost = SimpleRegisteredPost(
dbPost.id,
post.content,
dbPost.creationDate,
DateTime.now()
dbPost.creationDate
)
posts[newPost.id] = newPost
postUpdatedBroadcastChannel.send(newPost)

View File

@ -65,7 +65,6 @@ private class PostsAPIDatabaseTable(
private val idColumn = text("postId")
private val creationDateColumn = datetime("creationDate").default(org.joda.time.DateTime.now())
private val modificationDateColumn = datetime("modificationDate").default(org.joda.time.DateTime.now())
private val postCreatedBroadcastChannel = BroadcastChannel<RegisteredPost>(Channel.BUFFERED)
@ -89,8 +88,7 @@ private class PostsAPIDatabaseTable(
SimpleRegisteredPost(
id,
contentsTable.getPostContents(id),
DateTime(get(creationDateColumn).millis),
DateTime(get(modificationDateColumn).millis)
DateTime(get(creationDateColumn).millis)
)
}