diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt index df7633f5..229d791e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/PostsAPI.kt @@ -1,15 +1,3 @@ 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 PostsAPI { - suspend fun getPostById(id: PostId): Post? - suspend fun getPostsByContent(id: ContentId): List - suspend fun getPostsByDates(from: DateTime? = null, to: DateTime? = null): List - - suspend fun getPostsByPagination(pagination: Pagination): PaginationResult -} \ No newline at end of file +interface PostsAPI : ReadPostsAPI, WritePostsAPI diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/ReadPostsAPI.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/ReadPostsAPI.kt new file mode 100644 index 00000000..33da29af --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/ReadPostsAPI.kt @@ -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 + suspend fun getPostsByDates(from: DateTime? = null, to: DateTime? = null): List + + suspend fun getPostsByPagination(pagination: Pagination): PaginationResult +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/WritePostsAPI.kt similarity index 94% rename from src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt rename to src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/WritePostsAPI.kt index 847c527f..cde400d9 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/WritePostsAPI.kt @@ -3,7 +3,7 @@ package com.github.insanusmokrassar.postssystem.core.api import com.github.insanusmokrassar.postssystem.core.post.* import kotlinx.coroutines.flow.Flow -interface MutablePostsAPI { +interface WritePostsAPI { val postCreatedFlow: Flow val postDeletedFlow: Flow val postUpdatedFlow: Flow