Commit e8069009 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

resolve dependencies

parent 99dff8b6
......@@ -8,8 +8,8 @@ import com.biganto.visual.roompark.data.repository.mapper.fromRaw
import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.model.AuthInfoModel
import com.biganto.visual.roompark.domain.model.fromEntity
import dagger.Binds
import dagger.Module
import dagger.Provides
import io.reactivex.Completable
import io.reactivex.Observable
import timber.log.Timber
......@@ -35,14 +35,13 @@ const val FILES_CACHE_LIMIT_SECONDS_INACTIVE = 60L
const val DATABASE_VERSION = 6
@Module
class AppModule() {
}
class AppModule
class AuthContractModule @Inject constructor(
val local:ILocalStore,
val api:IRoomParkApi,
val db:IDb
private val local:ILocalStore,
private val api:IRoomParkApi,
private val db:IDb
):AuthContract{
init {
......@@ -66,13 +65,13 @@ class AppModule() {
} }
}
@Module()
class DataModule() {
@Module
abstract class DataModule {
@Provides
@Binds
@Singleton
fun provideAuthContract() : AuthContract = AuthContractModule()
abstract fun provideAuthContract(contract: AuthContractModule) : AuthContract
/*
@Provides
......
package com.biganto.visual.roompark.domain.use_case
import com.biganto.visual.roompark.domain.contract.AuthContract
import io.reactivex.Observable
import javax.inject.Inject
/**
......@@ -12,7 +11,7 @@ class AuthUseCase @Inject constructor(
private val authContract: AuthContract
){
fun validateAuth() = Observable.just(true)
fun validateAuth() = authContract.validateAuthState()
fun signIn(login:String,pwd:String) = authContract.signIn(login,pwd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment