rewrite posts api to be result of write and read posts apis
This commit is contained in:
parent
9c1bffab41
commit
71c7880582
@ -1,15 +1,3 @@
|
|||||||
package com.github.insanusmokrassar.postssystem.core.api
|
package com.github.insanusmokrassar.postssystem.core.api
|
||||||
|
|
||||||
import com.github.insanusmokrassar.postssystem.core.post.Post
|
interface PostsAPI : ReadPostsAPI, WritePostsAPI
|
||||||
import com.github.insanusmokrassar.postssystem.core.post.PostId
|
|
||||||
import com.github.insanusmokrassar.postssystem.core.content.ContentId
|
|
||||||
import com.github.insanusmokrassar.postssystem.core.utils.pagination.*
|
|
||||||
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>
|
|
||||||
|
|
||||||
suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<Post>
|
|
||||||
}
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
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 com.github.insanusmokrassar.postssystem.core.utils.pagination.*
|
||||||
|
import org.joda.time.DateTime
|
||||||
|
|
||||||
|
interface ReadPostsAPI {
|
||||||
|
suspend fun getPostById(id: PostId): Post?
|
||||||
|
suspend fun getPostsByContent(id: ContentId): List<Post>
|
||||||
|
suspend fun getPostsByDates(from: DateTime? = null, to: DateTime? = null): List<Post>
|
||||||
|
|
||||||
|
suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<Post>
|
||||||
|
}
|
@ -3,7 +3,7 @@ package com.github.insanusmokrassar.postssystem.core.api
|
|||||||
import com.github.insanusmokrassar.postssystem.core.post.*
|
import com.github.insanusmokrassar.postssystem.core.post.*
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
interface MutablePostsAPI {
|
interface WritePostsAPI {
|
||||||
val postCreatedFlow: Flow<Post>
|
val postCreatedFlow: Flow<Post>
|
||||||
val postDeletedFlow: Flow<Post>
|
val postDeletedFlow: Flow<Post>
|
||||||
val postUpdatedFlow: Flow<Post>
|
val postUpdatedFlow: Flow<Post>
|
Loading…
Reference in New Issue
Block a user