fill readonly PostsAPI

This commit is contained in:
InsanusMokrassar 2019-09-20 13:05:14 +06:00
parent 0261e9b60d
commit 9fb4a2aae6
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,12 @@
package com.github.insanusmokrassar.postssystem.core.api
import com.github.insanusmokrassar.postssystem.core.post.Post
import com.github.insanusmokrassar.postssystem.core.post.PostId
import com.github.insanusmokrassar.postssystem.core.content.ContentId
import org.joda.time.DateTime
interface PostsAPI {
suspend fun getPostById(id: PostId): Post?
suspend fun getPostsByContent(id: ContentId): List<Post>
suspend fun getPostsByDates(from: DateTime? = null, to: DateTime? = null): List<Post>
}

View File

@ -1,4 +1,4 @@
package com.github.insanusmokrassar.postssystem.core package com.github.insanusmokrassar.postssystem.core.post
import com.github.insanusmokrassar.postssystem.core.content.Content import com.github.insanusmokrassar.postssystem.core.content.Content
@ -7,4 +7,6 @@ typealias PostId = String
interface Post { interface Post {
val id: PostId val id: PostId
val content: List<Content> val content: List<Content>
val meta: PostMetaInfo
} }

View File

@ -0,0 +1,9 @@
package com.github.insanusmokrassar.postssystem.core.post
import org.joda.time.DateTime
interface PostMetaInfo {
val postId: PostId
val creationDate: DateTime
val modificationDate: DateTime
}