add integration with posts creating
This commit is contained in:
client
features/content
binary
common
src
commonMain
kotlin
dev
inmo
postssystem
features
content
server
src
jvmMain
kotlin
dev
inmo
postssystem
features
content
binary
common
src
commonMain
kotlin
dev
inmo
postssystem
features
content
common
server
services/posts
client
src
commonMain
kotlin
dev
inmo
postssystem
services
common
server
2
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/Constants.kt
2
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/Constants.kt
@ -1,3 +1,5 @@
|
||||
package dev.inmo.postssystem.services.posts.common
|
||||
|
||||
const val postsRootPath = "posts"
|
||||
|
||||
const val postsPostIdParameter = "postId"
|
||||
|
9
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/FullNewPost.kt
Normal file
9
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/FullNewPost.kt
Normal file
@ -0,0 +1,9 @@
|
||||
package dev.inmo.postssystem.services.posts.common
|
||||
|
||||
import dev.inmo.postssystem.features.content.common.Content
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class FullNewPost(
|
||||
val content: List<Content>
|
||||
)
|
3
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/PostsService.kt
Normal file
3
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/PostsService.kt
Normal file
@ -0,0 +1,3 @@
|
||||
package dev.inmo.postssystem.services.posts.common
|
||||
|
||||
interface PostsService : ReadPostsService, WritePostsService
|
7
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/ReadPostsService.kt
Normal file
7
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/ReadPostsService.kt
Normal file
@ -0,0 +1,7 @@
|
||||
package dev.inmo.postssystem.services.posts.common
|
||||
|
||||
import dev.inmo.micro_utils.repos.ReadCRUDRepo
|
||||
import dev.inmo.postssystem.features.posts.common.PostId
|
||||
import dev.inmo.postssystem.features.posts.common.RegisteredPost
|
||||
|
||||
interface ReadPostsService : ReadCRUDRepo<RegisteredPost, PostId>
|
16
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/WritePostsService.kt
Normal file
16
services/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/common/WritePostsService.kt
Normal file
@ -0,0 +1,16 @@
|
||||
package dev.inmo.postssystem.services.posts.common
|
||||
|
||||
import dev.inmo.micro_utils.common.Either
|
||||
import dev.inmo.postssystem.features.content.common.Content
|
||||
import dev.inmo.postssystem.features.content.common.ContentId
|
||||
import dev.inmo.postssystem.features.posts.common.PostId
|
||||
import dev.inmo.postssystem.features.posts.common.RegisteredPost
|
||||
|
||||
interface WritePostsService {
|
||||
suspend fun create(newPost: FullNewPost): RegisteredPost?
|
||||
suspend fun update(
|
||||
postId: PostId,
|
||||
content: List<Either<ContentId, Content>>
|
||||
): RegisteredPost?
|
||||
suspend fun remove(postId: PostId)
|
||||
}
|
Reference in New Issue
Block a user