feat: Add Retrofit and Moshi for network operations

This commit introduces Retrofit and Moshi to handle network requests and JSON parsing.

Key changes include:
- Added Retrofit, Moshi, OkHttp, and OkHttp Logging Interceptor dependencies to `libs.versions.toml` and `model/data/api/build.gradle.kts`.
- Created data classes for API responses: `AirportResponse`, `RouteResponse`, and `FlightResponse`.
- Defined Retrofit service interfaces: `AirportService`, `RoutesService`, and `FlightService`.
- Implemented a Hilt `NetworkModule` to provide Retrofit, Moshi, and OkHttpClient instances.
- Added a Detekt configuration file for the `model/data/api` module.
- Temporarily commented out `configureFlavors` in `AndroidApplicationConvention.kt` and `ConfigureLibrary.kt`.
This commit is contained in:
2025-06-12 23:44:05 +02:00
parent 714cdb6795
commit a6202c5383
12 changed files with 302 additions and 2 deletions

View File

@ -16,6 +16,7 @@ androidxLifecycle = "2.9.0"
androidxNavigation = "2.9.0"
appUpdateKtx = "2.1.0"
appcompat = "1.7.0"
converterMoshi = "2.11.0"
coreTest = "1.6.1" # https://developer.android.com/jetpack/androidx/releases/test
detekt = "1.23.8" # https://detekt.dev/changelog
detektCompose = "0.4.22" # https://github.com/mrmans0n/compose-rules/releases
@ -31,6 +32,8 @@ kotlinxSerializationJson = "1.8.1"
ksp = "2.1.21-2.0.1" # https://github.com/google/ksp/releases
material = "1.12.0"
mockk = "1.14.2" # https://github.com/mockk/mockk/releases
okhttpBom = "4.12.0"
retrofit = "3.0.0"
secrets = "2.0.1"
testRules = "1.6.1" # https://developer.android.com/jetpack/androidx/releases/test
testRunner = "1.6.2" # https://developer.android.com/jetpack/androidx/releases/test
@ -69,6 +72,7 @@ androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator",
androidx-ui-text-google-fonts = { module = "androidx.compose.ui:ui-text-google-fonts", version.ref = "uiTextGoogleFonts" }
app-update-ktx = { module = "com.google.android.play:app-update-ktx", version.ref = "appUpdateKtx" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "converterMoshi" }
detekt-compose = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
detekt-ktlint = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
@ -83,6 +87,10 @@ kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-t
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockk" }
okhttp = { module = "com.squareup.okhttp3:okhttp" }
okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttpBom" }
okhttp-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
timber = { group = "com.jakewharton.timber", name = "timber", version.ref = "timber" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }