-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathWeatherInterface.java
More file actions
31 lines (24 loc) · 1.02 KB
/
WeatherInterface.java
File metadata and controls
31 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package github.vatsal.easyweather.retrofit.api;
import github.vatsal.easyweather.retrofit.models.ForecastResponseModel;
import github.vatsal.easyweather.retrofit.models.WeatherResponseModel;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface WeatherInterface {
@GET("weather")
Call<WeatherResponseModel> getCityWeather(@Query(FIELDS.Q) String city);
@GET("weather")
Call<WeatherResponseModel> getLocationWeather(@Query(FIELDS.LAT) String latitude,
@Query(FIELDS.LON) String longitude);
@GET("forecast")
Call<ForecastResponseModel> getCityForcast(@Query(FIELDS.Q) String city);
@GET("forecast")
Call<ForecastResponseModel> getLocationForecast(@Query(FIELDS.LAT) String latitude,
@Query(FIELDS.LON) String longitude);
interface FIELDS {
String APPID = "appid";
String Q = "q";
String LAT = "lat";
String LON = "lon";
}
}