yandex user info repository

This commit is contained in:
2026-04-21 00:25:20 +03:00
parent c84edcf16a
commit 52353ea4a0
8 changed files with 92 additions and 20 deletions

View File

@@ -5,10 +5,12 @@ import com.github.nullptroma.wallenc.app.di.modules.app.IoDispatcher
import com.github.nullptroma.wallenc.data.db.app.dao.StorageKeyMapDao
import com.github.nullptroma.wallenc.data.db.app.dao.StorageMetaInfoDao
import com.github.nullptroma.wallenc.data.db.app.dao.YandexAccountDao
import com.github.nullptroma.wallenc.data.network.YandexUserInfoApi
import com.github.nullptroma.wallenc.data.network.YandexUserInfoApiFactory
import com.github.nullptroma.wallenc.data.db.app.repository.StorageKeyMapRepository
import com.github.nullptroma.wallenc.data.db.app.repository.StorageMetaInfoRepository
import com.github.nullptroma.wallenc.data.db.app.repository.YandexAccountRepository
import com.github.nullptroma.wallenc.data.network.yandexuserinfo.YandexUserInfoApi
import com.github.nullptroma.wallenc.data.network.yandexuserinfo.YandexUserInfoApiFactory
import com.github.nullptroma.wallenc.data.network.yandexuserinfo.repository.YandexUserInfoRepository
import com.github.nullptroma.wallenc.data.tasks.TaskOrchestrator
import com.github.nullptroma.wallenc.data.vaults.VaultsManager
import com.github.nullptroma.wallenc.domain.interfaces.IUnlockManager
@@ -41,10 +43,16 @@ class SingletonModule {
@IoDispatcher ioDispatcher: CoroutineDispatcher,
@ApplicationContext context: Context,
keyRepo: StorageKeyMapRepository,
yandexAccountDao: YandexAccountDao,
yandexUserInfoApi: YandexUserInfoApi,
yandexAccountRepository: YandexAccountRepository,
yandexUserInfoRepository: YandexUserInfoRepository,
): IVaultsManager {
return VaultsManager(ioDispatcher, context, keyRepo, yandexAccountDao, yandexUserInfoApi)
return VaultsManager(
ioDispatcher = ioDispatcher,
context = context,
keyRepo = keyRepo,
yandexAccountRepository = yandexAccountRepository,
yandexUserInfoRepository = yandexUserInfoRepository,
)
}
@Provides
@@ -71,4 +79,22 @@ class SingletonModule {
): StorageMetaInfoRepository {
return StorageMetaInfoRepository(dao, ioDispatcher)
}
@Provides
@Singleton
fun provideYandexAccountRepository(
dao: YandexAccountDao,
@IoDispatcher ioDispatcher: CoroutineDispatcher
): YandexAccountRepository {
return YandexAccountRepository(dao, ioDispatcher)
}
@Provides
@Singleton
fun provideYandexUserInfoRepository(
api: YandexUserInfoApi,
@IoDispatcher ioDispatcher: CoroutineDispatcher
): YandexUserInfoRepository {
return YandexUserInfoRepository(api, ioDispatcher)
}
}