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 override val content: ContentIds
val creationDate: DateTime val creationDate: DateTime
val modificationDate: DateTime
} }
/** /**
@ -40,6 +39,5 @@ data class SimplePost(
data class SimpleRegisteredPost( data class SimpleRegisteredPost(
override val id: PostId, override val id: PostId,
override val content: ContentIds, override val content: ContentIds,
override val creationDate: DateTime = DateTime.now(), override val creationDate: DateTime = DateTime.now()
override val modificationDate: DateTime = creationDate
) : RegisteredPost ) : RegisteredPost

View File

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

View File

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