remove modification info from registered posts
This commit is contained in:
parent
30eefcd87b
commit
5859c8bb44
@ -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
|
@ -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)
|
||||
|
@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user