add mutable posts api
This commit is contained in:
parent
9fb4a2aae6
commit
2d5189ce0a
@ -0,0 +1,15 @@
|
||||
package com.github.insanusmokrassar.postssystem.core.api
|
||||
|
||||
import com.github.insanusmokrassar.postssystem.core.post.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface MutablePostsAPI {
|
||||
val postCreatedFlow: Flow<Post>
|
||||
val postDeletedFlow: Flow<Post>
|
||||
val postUpdatedFlow: Flow<Post>
|
||||
|
||||
suspend fun createPost(content: PostContents): Post?
|
||||
suspend fun deletePost(id: PostId): Boolean
|
||||
|
||||
suspend fun updatePostContent(postId: PostId, content: PostContents): Boolean
|
||||
}
|
@ -3,10 +3,11 @@ package com.github.insanusmokrassar.postssystem.core.post
|
||||
import com.github.insanusmokrassar.postssystem.core.content.Content
|
||||
|
||||
typealias PostId = String
|
||||
typealias PostContents = List<Content>
|
||||
|
||||
interface Post {
|
||||
val id: PostId
|
||||
val content: List<Content>
|
||||
val content: PostContents
|
||||
|
||||
val meta: PostMetaInfo
|
||||
}
|
Loading…
Reference in New Issue
Block a user