fill readonly PostsAPI
This commit is contained in:
parent
0261e9b60d
commit
9fb4a2aae6
@ -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>
|
||||||
|
}
|
@ -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
|
||||||
}
|
}
|
@ -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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user