comparison pkg/controllers/routes.go @ 3245:60f25cbe77fb

Added API stubs from fairway availabilty for stretches and sections.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 13 May 2019 09:15:20 +0200
parents 4c254651d80b
children 2b5c22f6bb1f
comparison
equal deleted inserted replaced
3244:b27759d0cdff 3245:60f25cbe77fb
312 // Handler to serve data to the client. 312 // Handler to serve data to the client.
313 api.Handle("/data/bottleneck/availability/{objnam}", any(&JSONHandler{ 313 api.Handle("/data/bottleneck/availability/{objnam}", any(&JSONHandler{
314 Handle: bottleneckAvailabilty, 314 Handle: bottleneckAvailabilty,
315 })).Methods(http.MethodGet) 315 })).Methods(http.MethodGet)
316 316
317 api.Handle("/data/{kind:stretch|section}/availability/{objnam}", any(&JSONHandler{
318 Handle: stretchAvailabilty,
319 })).Methods(http.MethodGet)
320
321 api.Handle("/data/{kind:stretch|section}/fairway-depth/{objnam}", any(
322 middleware.DBConn(http.HandlerFunc(stretchAvailableFairwayDepth)))).Methods(http.MethodGet)
323
317 api.Handle("/data/bottleneck/fairway-depth/{objnam}", any( 324 api.Handle("/data/bottleneck/fairway-depth/{objnam}", any(
318 middleware.DBConn(http.HandlerFunc(bottleneckAvailableFairwayDepth)))).Methods(http.MethodGet) 325 middleware.DBConn(http.HandlerFunc(bottleneckAvailableFairwayDepth)))).Methods(http.MethodGet)
319 326
320 api.Handle("/data/waterlevels/{gauge}", any( 327 api.Handle("/data/waterlevels/{gauge}", any(
321 middleware.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet) 328 middleware.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet)