Query and display city field chart and all city weather data

This commit is contained in:
Guntis Smaukstelis
2024-01-12 17:13:39 +02:00
parent d6707b7bb0
commit 65dfcf052a
7 changed files with 149 additions and 27 deletions
+4
View File
@@ -58,6 +58,10 @@ class Server(postgresService: PostgresService, fetch: FetchService, log: Logger[
.map(result => ResponseWrapper(result, userQuery))
.flatMap(responseWrapper => Ok(responseWrapper.asJson.pretty))
// http://0.0.0.0:8080/api/query/city/Kolka/20230414_2200-20230501_1230/allFields
case GET -> Root / "query" / "city" / (city: String) / DateTimeRange(from, to) / "allFields" =>
postgresService.queryCityAllFields(city, from, to).flatMap(result => Ok(result.asJson))
// http://0.0.0.0:8080/api/query/country/20230414_2200-20230501_1230/tempMax,tempMin,tempAvg,precipitation
case GET -> Root / "query" / "country" / DateTimeRange(from, to) / AggFieldList(fieldList) =>
postgresService.queryCountry(from, to, fieldList)