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 ...@@ -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.contract.AuthContract
import com.biganto.visual.roompark.domain.model.AuthInfoModel import com.biganto.visual.roompark.domain.model.AuthInfoModel
import com.biganto.visual.roompark.domain.model.fromEntity import com.biganto.visual.roompark.domain.model.fromEntity
import dagger.Binds
import dagger.Module import dagger.Module
import dagger.Provides
import io.reactivex.Completable import io.reactivex.Completable
import io.reactivex.Observable import io.reactivex.Observable
import timber.log.Timber import timber.log.Timber
...@@ -35,14 +35,13 @@ const val FILES_CACHE_LIMIT_SECONDS_INACTIVE = 60L ...@@ -35,14 +35,13 @@ const val FILES_CACHE_LIMIT_SECONDS_INACTIVE = 60L
const val DATABASE_VERSION = 6 const val DATABASE_VERSION = 6
@Module @Module
class AppModule() { class AppModule
}
class AuthContractModule @Inject constructor( class AuthContractModule @Inject constructor(
val local:ILocalStore, private val local:ILocalStore,
val api:IRoomParkApi, private val api:IRoomParkApi,
val db:IDb private val db:IDb
):AuthContract{ ):AuthContract{
init { init {
...@@ -66,13 +65,13 @@ class AppModule() { ...@@ -66,13 +65,13 @@ class AppModule() {
} } } }
} }
@Module() @Module
class DataModule() { abstract class DataModule {
@Provides @Binds
@Singleton @Singleton
fun provideAuthContract() : AuthContract = AuthContractModule() abstract fun provideAuthContract(contract: AuthContractModule) : AuthContract
/* /*
@Provides @Provides
......
package com.biganto.visual.roompark.domain.use_case package com.biganto.visual.roompark.domain.use_case
import com.biganto.visual.roompark.domain.contract.AuthContract import com.biganto.visual.roompark.domain.contract.AuthContract
import io.reactivex.Observable
import javax.inject.Inject import javax.inject.Inject
/** /**
...@@ -12,7 +11,7 @@ class AuthUseCase @Inject constructor( ...@@ -12,7 +11,7 @@ class AuthUseCase @Inject constructor(
private val authContract: AuthContract private val authContract: AuthContract
){ ){
fun validateAuth() = Observable.just(true) fun validateAuth() = authContract.validateAuthState()
fun signIn(login:String,pwd:String) = authContract.signIn(login,pwd) 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