Class WeatherController

java.lang.Object
web.sportflow.weather.WeatherController

@RestController @RequestMapping("/api/weather") public class WeatherController extends Object
  • Constructor Details

    • WeatherController

      @Autowired public WeatherController(WeatherService weatherService)
  • Method Details

    • getWeatherStatsAtDate

      @GetMapping("/stats") public WeatherStatsDTO getWeatherStatsAtDate(@RequestParam String date, @RequestParam String address, @RequestParam Double duration)
      Get weather statistics for a specific date and duration.
      Parameters:
      date - The date and time to get the weather stats for (format: YYYY-MM-DDTHH).
      address - The address to get the weather stats for.
      duration - The duration (in minutes) to get the weather stats for.
      Returns:
      WeatherStatsDTO containing the weather statistics.
    • getCurrentWeather

      @GetMapping("/current") public WeatherDTO getCurrentWeather(@RequestParam String address)
    • getWeatherAtDate

      @GetMapping("/at/{date}") public WeatherDTO getWeatherAtDate(@PathVariable String date, @RequestParam String address)
    • getCityFromCoordinates

      @GetMapping("/reverse-city") public Map<String,String> getCityFromCoordinates(@RequestParam Double lat, @RequestParam Double lon)