add integration with posts creating

This commit is contained in:
2022-01-22 13:30:49 +06:00
parent d1fa0242fa
commit 5e61c2a770
22 changed files with 548 additions and 43 deletions
client
build.gradle
src
commonMain
kotlin
dev
inmo
postssystem
client
features/content
binary
common
src
commonMain
kotlin
dev
server
src
jvmMain
kotlin
dev
inmo
postssystem
features
common
src
commonMain
kotlin
dev
inmo
postssystem
features
content
gradle.properties
server
build.gradle
src
main
java
dev
inmo
postssystem
server
services/posts
client
src
commonMain
common
server

@ -1,3 +1,5 @@
package dev.inmo.postssystem.services.posts.common
const val postsRootPath = "posts"
const val postsPostIdParameter = "postId"

@ -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>
)

@ -0,0 +1,3 @@
package dev.inmo.postssystem.services.posts.common
interface PostsService : ReadPostsService, WritePostsService

@ -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>

@ -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)
}