From 2d7af2aaabba3baa9d1563a92e60e36d0d4d6bc0 Mon Sep 17 00:00:00 2001 From: iliyangermanov Date: Tue, 26 Nov 2024 01:17:57 +0200 Subject: [PATCH] Migrate DI --- server/src/main/kotlin/ivy/learn/di/AppModule.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/main/kotlin/ivy/learn/di/AppModule.kt b/server/src/main/kotlin/ivy/learn/di/AppModule.kt index 4c2e167..38d25b4 100644 --- a/server/src/main/kotlin/ivy/learn/di/AppModule.kt +++ b/server/src/main/kotlin/ivy/learn/di/AppModule.kt @@ -2,7 +2,8 @@ package ivy.learn.di import ivy.di.Di import ivy.di.Di.register -import ivy.di.Di.singleton +import ivy.di.autowire.autoWire +import ivy.di.autowire.autoWireSingleton import ivy.learn.Environment import ivy.learn.EnvironmentImpl import ivy.learn.LearnServer @@ -11,9 +12,7 @@ import ivy.learn.ServerConfigurationProvider class AppModule(private val devMode: Boolean) : Di.Module { override fun init() = Di.appScope { register { EnvironmentImpl() } - register { ServerConfigurationProvider(Di.get()) } - singleton { - LearnServer(Di.get(), Di.get()) - } + autoWire(::ServerConfigurationProvider) + autoWireSingleton(::LearnServer) } } \ No newline at end of file