From 953d0823539d6457aa0ce2ce353d70e07cbd1e45 Mon Sep 17 00:00:00 2001 From: ABHISHEK PATHAK <51234843+myofficework000@users.noreply.github.com> Date: Fri, 30 Jun 2023 21:43:52 +0530 Subject: [PATCH] One more step close to fix issue --- .../data/remote/CurrentWeather.kt | 10 ++++++++++ .../clean_code_with_mvi_mvvm/data/remote/Hourly.kt | 8 ++++++++ .../data/remote/HourlyUnits.kt | 8 ++++++++ .../data/remote/WeatherApi.kt | 2 +- .../data/remote/WeatherResponse.kt | 14 ++++++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/CurrentWeather.kt create mode 100644 app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/Hourly.kt create mode 100644 app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/HourlyUnits.kt create mode 100644 app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherResponse.kt diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/CurrentWeather.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/CurrentWeather.kt new file mode 100644 index 00000000..589d5677 --- /dev/null +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/CurrentWeather.kt @@ -0,0 +1,10 @@ +package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote + +data class CurrentWeather( + val is_day: Int, + val temperature: Double, + val time: String, + val weathercode: Int, + val winddirection: Double, + val windspeed: Double +) \ No newline at end of file diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/Hourly.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/Hourly.kt new file mode 100644 index 00000000..c6396402 --- /dev/null +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/Hourly.kt @@ -0,0 +1,8 @@ +package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote + +data class Hourly( + val relativehumidity_2m: List, + val temperature_2m: List, + val time: List, + val windspeed_10m: List +) \ No newline at end of file diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/HourlyUnits.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/HourlyUnits.kt new file mode 100644 index 00000000..86e4bc61 --- /dev/null +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/HourlyUnits.kt @@ -0,0 +1,8 @@ +package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote + +data class HourlyUnits( + val relativehumidity_2m: String, + val temperature_2m: String, + val time: String, + val windspeed_10m: String +) \ No newline at end of file diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherApi.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherApi.kt index d8aa8efa..e2fea45c 100644 --- a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherApi.kt +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherApi.kt @@ -10,5 +10,5 @@ interface WeatherApi { suspend fun getWeather( @Query("latitude") latitude: Double, @Query("longitude") longitude: Double, - ): WeatherDto + ): WeatherResponse } \ No newline at end of file diff --git a/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherResponse.kt b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherResponse.kt new file mode 100644 index 00000000..150d8001 --- /dev/null +++ b/app/src/main/java/com/example/jetpack_compose_all_in_one/android_architectures/clean_code_with_mvi_mvvm/data/remote/WeatherResponse.kt @@ -0,0 +1,14 @@ +package com.example.jetpack_compose_all_in_one.android_architectures.clean_code_with_mvi_mvvm.data.remote + +data class WeatherResponse( + val current_weather: CurrentWeather, + val elevation: Double, + val generationtime_ms: Double, + val hourly: Hourly, + val hourly_units: HourlyUnits, + val latitude: Double, + val longitude: Double, + val timezone: String, + val timezone_abbreviation: String, + val utc_offset_seconds: Int +) \ No newline at end of file