feat(core:data): Ktor network core + coreDataModule (REDI-83)
- HttpClientFactory.create(engine) with the engine injected (MockEngine seam for tests): ContentNegotiation JSON (ignoreUnknownKeys), Kermit-backed Ktor logging, default JSON request. - safeCall / responseToResult (status -> DataError.Network, extended with 400/403/404/503) / constructRoute (reads BuildConfig.BASE_URL) and typed HttpClient.get/post/delete. - BASE_URL BuildConfig field = Rick & Morty API. - coreDataModule: single<HttpClient> via factory lambda (the one sanctioned lambda-DSL binding).
This commit is contained in:
@@ -6,8 +6,17 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "com.example.architecture.core.data"
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
}
|
||||
defaultConfig {
|
||||
// The no-key Rick & Morty API. constructRoute() reads this BuildConfig field.
|
||||
buildConfigField("String", "BASE_URL", "\"https://rickandmortyapi.com/api\"")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":core:domain"))
|
||||
implementation(libs.kermit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user