provide to server work with posts

This commit is contained in:
2022-01-22 13:37:56 +06:00
parent 5e61c2a770
commit 4f96d2ce76
4 changed files with 29 additions and 62 deletions
server/src/main/java/dev/inmo/postssystem/server
services/posts/server/src/jvmMain/kotlin/dev/inmo/postssystem/services/posts/server

@ -35,7 +35,7 @@ import dev.inmo.postssystem.features.posts.server.ExposedServerPostsStorage
import dev.inmo.postssystem.features.posts.server.ServerPostsStorage
import dev.inmo.postssystem.features.publication.server.PublicationManager
import dev.inmo.postssystem.features.publication.server.PublicationTarget
import dev.inmo.postssystem.services.posts.server.ServerPostsServiceRoutingConfigurator
import dev.inmo.postssystem.services.posts.server.*
import dev.inmo.postssystem.targets.telegram.publication.server.PublicationTargetTelegram
import io.ktor.application.featureOrNull
import io.ktor.application.log
@ -177,6 +177,13 @@ fun getDIModule(
// Posts storage
single<ServerPostsStorage> { ExposedServerPostsStorage(get()) }
singleWithBinds {
ServerPostsService(
DefaultExposedReadPostsService(get<ServerPostsStorage>()),
DefaultWritePostsService(get<ServerPostsStorage>(), get<ServerContentStorage<Content>>())
)
}
// Routing configurators
singleWithBinds { FilesRoutingConfigurator(get(), null, get()) }
singleWithBinds { StatusRoutingConfigurator }