Lab #3 - Adding a Weather Microservice private static final String current_weather_uri = "https://api.open-meteo.com/v1/forecast?" + "latitude=%.2f&longitude=%.2f" + "&start_date=%s&end_date=%s" + "&elevation&daily=temperature_2m_max,temperature_2m_min," + "precipitation_sum,wind_speed_10m_max,wind_gusts_10m_max&" + "timezone=Europe/Madrid"; the current weather Forecast is good from tommorow up to 15 days from now private static final String historical_weather_uri = "https://archive-api.open-meteo.com/v1/archive?latitude=%.2f&" + "longitude=%.2f&start_date=%s&end_date=%s&elevation&" + "daily=temperature_2m_max,temperature_2m_min,precipitation_sum," + "wind_speed_10m_max,wind_gusts_10m_max&timezone=Europe/Madrid"; the historical weather Forecast is good from today back to Jan 1, 2016 https://api.open-meteo.com/v1/forecast?latitude=40.42&longitude=-3.70&start_date=2024-07-01&end_date=2024-07-01&elevation&daily=temperature_2m_max,temperature_2m_min,precipitation_sum,wind_speed_10m_max,wind_gusts_10m_max&timezone=Europe/Madrid the Weather API we are going to add is: @GetMapping(value="/weather/{lat}/{lon}/{year}/{month}/{day}", produces="application/json") Weather getWeatherByLocationAndDate(@PathVariable double lat, @PathVariable double lon, @PathVariable int year, @PathVariable int month, @PathVariable int day) throws IOException; the Lat, Lon comes from the Stage object public class Stage implements Serializable { private int stage; private String city; private String country; private double[] location; <= this is Lat, Lon the composite API we will add is: @GetMapping(value="/stageSummary/{routeCode}/{stageNumber}/{year}/{month}/{day}", produces="application/json") StageSummary getStageSummaryByCodeAndDate(@PathVariable String routeCode, @PathVariable int stageNumber, @PathVariable int year, @PathVariable int month, @PathVariable int day, HttpServletRequest request, HttpServletResponse response) throws IOException; the StageSummary object (in the Entity project): public class StageSummary { private String routeName; private String routeCode; private String nickname; private int stageNum; private String city; private String Country; private LocalDate date; private Weather weather; as part of your coding assignment, you will need to define a Weather object from the Weather Web Services response ------------------------------------------------------------- the flow is: client calls Composite passing the route and stage num Composite calls the route service (API - Monday) getting the route object (which has the stages) Compsite then extracts the lat/Lon from the specific stage (asked for by the user) and calls the Weather service, passing the Lat/Lon/Date which in turn calls the open-metro API