add integration with posts creating
This commit is contained in:
@@ -12,6 +12,8 @@ kotlin {
|
||||
dependencies {
|
||||
api project(":postssystem.features.common.common")
|
||||
api project(":postssystem.features.posts.common")
|
||||
api "dev.inmo:micro_utils.repos.common:$microutils_version"
|
||||
api "dev.inmo:micro_utils.repos.ktor.client:$microutils_version"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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)
|
||||
}
|
Reference in New Issue
Block a user