init
This commit is contained in:
1
domain/domain_impl/.gitignore
vendored
Normal file
1
domain/domain_impl/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
37
domain/domain_impl/build.gradle.kts
Normal file
37
domain/domain_impl/build.gradle.kts
Normal file
@@ -0,0 +1,37 @@
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.dagger.hilt.android")
|
||||
id("com.google.devtools.ksp")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = Config.SdkVersion.COMPILE
|
||||
namespace = "com.testappbank.test"
|
||||
|
||||
defaultConfig {
|
||||
minSdk = Config.SdkVersion.MIN
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("proguard-rules.pro")
|
||||
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree("dir" to "libs", "include" to listOf("*.jar")))
|
||||
|
||||
implementation(project(":domain:domain"))
|
||||
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
|
||||
coreLibraryDesugaring(libs.desugar.jdk.libs)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.testapp.domain.usecase
|
||||
|
||||
import com.testapp.domain.domain.gatway.WeatherGateWay
|
||||
import com.testapp.domain.domain.models.Weather
|
||||
import com.testapp.domain.domain.usecase.GetWeather
|
||||
import javax.inject.Inject
|
||||
|
||||
class GetWeatherImpl @Inject constructor(
|
||||
private val gateWay: WeatherGateWay,
|
||||
) : GetWeather {
|
||||
|
||||
override suspend fun getWeather(id: String): Weather =
|
||||
gateWay.getWeather(id)
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.testapp.domain.usecase
|
||||
|
||||
import com.testapp.domain.domain.gatway.WeatherGateWay
|
||||
import com.testapp.domain.domain.models.Weather
|
||||
import com.testapp.domain.domain.usecase.GetWeatherList
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import javax.inject.Inject
|
||||
|
||||
class GetWeatherListImpl @Inject constructor(
|
||||
private val gateWay: WeatherGateWay,
|
||||
) : GetWeatherList {
|
||||
|
||||
override suspend fun subscribeForWeatherList(): Flow<List<Weather>> =
|
||||
gateWay.subscribeForWeatherList()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.testapp.domain.usecase
|
||||
|
||||
import com.testapp.domain.domain.gatway.WeatherGateWay
|
||||
import com.testapp.domain.domain.models.ActionResult
|
||||
import com.testapp.domain.domain.models.Weather
|
||||
import com.testapp.domain.domain.usecase.RequestNewWeather
|
||||
import javax.inject.Inject
|
||||
|
||||
class RequestNewWeatherImpl @Inject constructor(
|
||||
private val gateWay: WeatherGateWay,
|
||||
|
||||
) : RequestNewWeather {
|
||||
|
||||
override suspend fun requestNewWeatherForPlace(placeName: String): ActionResult<Weather> =
|
||||
gateWay.requestNewWeatherForPlace(placeName)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.testapp.domain.usecase
|
||||
|
||||
import com.testapp.domain.domain.gatway.WeatherGateWay
|
||||
import com.testapp.domain.domain.models.ActionResult
|
||||
import com.testapp.domain.domain.models.Weather
|
||||
import com.testapp.domain.domain.usecase.SaveWeather
|
||||
import javax.inject.Inject
|
||||
|
||||
class SaveWeatherImpl @Inject constructor(
|
||||
val gateWay: WeatherGateWay
|
||||
) : SaveWeather {
|
||||
|
||||
override suspend fun saveWeather(weather: Weather) {
|
||||
gateWay.saveWeather(weather)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user