-
-
Save Arunshaik2001/4385ef719882e3cc56d01ad015be89e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface WeatherApi { | |
companion object { | |
const val BASE_URL = "https://api.openweathermap.org/" | |
val apiInstance = Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.client(OkHttpClient.Builder().addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC)).build()) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build() | |
.create(WeatherApi::class.java) | |
} | |
@GET("/data/2.5/weather") | |
suspend fun getWeatherDetails(@Query("lat") lat: Double,@Query("lon") long: Double,@Query("appid") appid: String): WeatherDTO | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment