Mercurial > gemma
changeset 5218:7dbb7cc6dbfa new-fwa
Remove old routes for availabilties.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 11 May 2020 20:10:15 +0200 |
parents | 70d83b7d36ef |
children | de86a96d55c3 |
files | pkg/controllers/fwa.go pkg/controllers/routes.go |
diffstat | 2 files changed, 5 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/controllers/fwa.go Mon May 11 19:52:25 2020 +0200 +++ b/pkg/controllers/fwa.go Mon May 11 20:10:15 2020 +0200 @@ -198,6 +198,10 @@ return } + // TODO: Use this. + availability := vars["type"] == "availability" + _ = availability + ctx := req.Context() conn := middleware.GetDBConn(req)
--- a/pkg/controllers/routes.go Mon May 11 19:52:25 2020 +0200 +++ b/pkg/controllers/routes.go Mon May 11 20:10:15 2020 +0200 @@ -324,24 +324,12 @@ // Handler to serve data to the client. - api.Handle("/data/{kind:stretch|section|bottleneck}/fairway/{name:.+}", any( + api.Handle("/data/{kind:stretch|section|bottleneck}/{type:availability|fairway}/{name:.+}", any( mw.DBConn(http.HandlerFunc(fairwayAvailability)))).Methods(http.MethodGet) api.Handle("/data/stretch/shape/{name:.+}", any( mw.DBConn(http.HandlerFunc(stretchShapeDownload)))).Methods(http.MethodGet) - api.Handle("/data/{kind:stretch|section}/availability/{name:.+}", any( - mw.DBConn(http.HandlerFunc(stretchAvailabilty)))).Methods(http.MethodGet) - - api.Handle("/data/{kind:stretch|section}/fairway-depth/{name:.+}", any( - mw.DBConn(http.HandlerFunc(stretchAvailableFairwayDepth)))).Methods(http.MethodGet) - - api.Handle("/data/bottleneck/fairway-depth/{objnam:.+}", any( - mw.DBConn(http.HandlerFunc(bottleneckAvailableFairwayDepth)))).Methods(http.MethodGet) - - api.Handle("/data/bottleneck/availability/{objnam:.+}", any( - mw.DBConn(http.HandlerFunc(bottleneckAvailabilty)))).Methods(http.MethodGet) - api.Handle("/data/waterlevels/{gauge:.+}", any( mw.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet)