This commit is contained in:
2026-02-27 12:50:54 +03:00
commit c6c8897cb4
105 changed files with 2935 additions and 0 deletions

1
domain/domain_impl/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

View 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)
}

View File

@@ -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)
}

View File

@@ -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()
}

View File

@@ -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)
}

View File

@@ -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)
}
}