Query and display weather data for all country
This commit is contained in:
@@ -2,6 +2,7 @@ package server
|
||||
|
||||
import cats.data.NonEmptyList
|
||||
import parse.Aggregate.AggregateKey
|
||||
import parse.WeatherData
|
||||
|
||||
import java.time.{LocalDate, LocalDateTime}
|
||||
import java.time.format.DateTimeFormatter
|
||||
@@ -56,6 +57,14 @@ object ValidateRoutes {
|
||||
}
|
||||
}
|
||||
|
||||
object AggFieldList {
|
||||
def unapply(str: String): Option[NonEmptyList[String]] = {
|
||||
val weatherFields = WeatherData.getKeys
|
||||
val filteredList = str.split(",").toList.filter(weatherFields.contains)
|
||||
NonEmptyList.fromList(filteredList)
|
||||
}
|
||||
}
|
||||
|
||||
object AggKey {
|
||||
def unapply(str: String): Option[AggregateKey] = {
|
||||
AggregateKey.fromString(str)
|
||||
|
||||
Reference in New Issue
Block a user