Приложение

This commit is contained in:
Халимов Рустам
2026-04-14 01:15:54 +03:00
parent 8399d32490
commit 1fb1be47dd
126 changed files with 6145 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
package chats.di
import chats.data.remote.api.ChatApi
import chats.data.remote.signalr.ChatHubClient
import chats.data.repository.ChatRepositoryImpl
import chats.domain.repository.ChatRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object ChatModule {
@Provides
@Singleton
fun provideChatApi(retrofit: Retrofit): ChatApi {
return retrofit.create(ChatApi::class.java)
}
@Provides
@Singleton
fun provideChatRepository(api: ChatApi): ChatRepository {
return ChatRepositoryImpl(api)
}
@Provides
@Singleton
fun provideChatHubClient(): ChatHubClient {
return ChatHubClient()
}
}