Replace flows due to their logical placement in aggregator of read and write interfaces

This commit is contained in:
InsanusMokrassar 2019-11-23 21:20:14 +06:00
parent 4e77e242fe
commit 1dfc225133
5 changed files with 16 additions and 13 deletions

View File

@ -1,7 +1,6 @@
package com.insanusmokrassar.postssystem.core.content
import kotlinx.serialization.*
import kotlinx.serialization.internal.*
import kotlinx.serialization.Serializable
typealias ContentId = String

View File

@ -1,3 +1,9 @@
package com.insanusmokrassar.postssystem.core.content.api
interface ContentAPI : ReadContentAPI, WriteContentAPI
import com.insanusmokrassar.postssystem.core.content.RegisteredContent
import kotlinx.coroutines.flow.Flow
interface ContentAPI : ReadContentAPI, WriteContentAPI {
val contentCreatedFlow: Flow<RegisteredContent>
val contentDeletedFlow: Flow<RegisteredContent>
}

View File

@ -1,12 +1,8 @@
package com.insanusmokrassar.postssystem.core.content.api
import com.insanusmokrassar.postssystem.core.content.*
import kotlinx.coroutines.flow.Flow
interface WriteContentAPI {
val contentCreatedFlow: Flow<RegisteredContent>
val contentDeletedFlow: Flow<RegisteredContent>
suspend fun createContent(content: Content): RegisteredContent?
suspend fun deleteContent(id: ContentId): Boolean
}

View File

@ -1,3 +1,10 @@
package com.insanusmokrassar.postssystem.core.post.api
interface PostsAPI : ReadPostsAPI, WritePostsAPI
import com.insanusmokrassar.postssystem.core.post.RegisteredPost
import kotlinx.coroutines.flow.Flow
interface PostsAPI : ReadPostsAPI, WritePostsAPI {
val postCreatedFlow: Flow<RegisteredPost>
val postDeletedFlow: Flow<RegisteredPost>
val postUpdatedFlow: Flow<RegisteredPost>
}

View File

@ -1,13 +1,8 @@
package com.insanusmokrassar.postssystem.core.post.api
import com.insanusmokrassar.postssystem.core.post.*
import kotlinx.coroutines.flow.Flow
interface WritePostsAPI {
val postCreatedFlow: Flow<RegisteredPost>
val postDeletedFlow: Flow<RegisteredPost>
val postUpdatedFlow: Flow<RegisteredPost>
/**
* For creating of post you need to create all its [com.insanusmokrassar.postssystem.core.content.RegisteredContent]
* and (or just) retrieve their [ContentIds] and put it into some [Post] implementation line [SimplePost]