Add a /conditions/current endpoint
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -11,6 +11,7 @@ type Repository interface {
|
||||
LatestObservation(ctx context.Context) (*model.WeatherObservation, error)
|
||||
LatestHourlyForecast(ctx context.Context) (*model.WeatherForecastRun, error)
|
||||
LatestActiveAlerts(ctx context.Context) (*model.WeatherAlertRun, error)
|
||||
CurrentConditions(ctx context.Context, observationWindowMinutes int) (*CurrentConditions, error)
|
||||
}
|
||||
|
||||
// Service provides weather read use-cases.
|
||||
@@ -33,3 +34,7 @@ func (s *Service) LatestHourlyForecast(ctx context.Context) (*model.WeatherForec
|
||||
func (s *Service) LatestActiveAlerts(ctx context.Context) (*model.WeatherAlertRun, error) {
|
||||
return s.repo.LatestActiveAlerts(ctx)
|
||||
}
|
||||
|
||||
func (s *Service) CurrentConditions(ctx context.Context) (*CurrentConditions, error) {
|
||||
return s.repo.CurrentConditions(ctx, ObservationWindowMinutesDefault)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user