implement full logic to filter ad hoc route suggestions against weather conditions
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package SuMoC.backend.dev;
|
||||
|
||||
import SuMoC.backend.meteo.ForecastService;
|
||||
import SuMoC.backend.meteo.MeteoClient;
|
||||
import SuMoC.backend.scheduling.ScheduledTasks;
|
||||
import SuMoC.backend.trend.services.StatTableUpdateService;
|
||||
@@ -28,6 +29,8 @@ public class DevController {
|
||||
|
||||
private final MeteoClient meteoClient;
|
||||
|
||||
private final ForecastService forecastService;
|
||||
|
||||
@PostMapping("/trigger-trend-calculation")
|
||||
public void triggerTrendCalculation() {
|
||||
LocalDate dayOfLastWeek = LocalDate.now().minusDays(7);
|
||||
@@ -55,24 +58,16 @@ public class DevController {
|
||||
}
|
||||
|
||||
@GetMapping("/test-meteo")
|
||||
public ResponseEntity<String> testMeteoClient() {
|
||||
public void testMeteoClient() {
|
||||
try {
|
||||
// Test with Zurich coordinates
|
||||
double lat = 47.3769;
|
||||
double lon = 8.5417;
|
||||
double lat = 51.44378662109375;
|
||||
double lon = 7.007565975189209;
|
||||
|
||||
var forecast = meteoClient.getForecastWeatherCodeToday(lat, lon).block();
|
||||
|
||||
if (forecast != null) {
|
||||
return ResponseEntity.ok("✓ Meteo API working! Received forecast for " +
|
||||
forecast.latitude() + ", " + forecast.longitude() +
|
||||
" with " + (forecast.hourly() != null ? forecast.hourly().weatherCode().size() : 0) +
|
||||
" hourly weather codes");
|
||||
} else {
|
||||
return ResponseEntity.status(500).body("✗ No response from Meteo API");
|
||||
}
|
||||
var forecast = forecastService.getTodayYesterdayForecast(
|
||||
lat,
|
||||
lon);
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.status(500).body("✗ Failed: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user