Mercurial > gemma
changeset 5191:f5564dc0adcc new-fwa
Merged default into new-fwa branch.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 29 Apr 2020 10:32:48 +0200 |
parents | c3765d8e2a90 (diff) 2e97bd2952cf (current diff) |
children | 08f623c87ec0 |
files | |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/controllers/fwa.go Wed Apr 29 10:32:48 2020 +0200 @@ -0,0 +1,33 @@ +// This is Free Software under GNU Affero General Public License v >= 3.0 +// without warranty, see README.md and license for details. +// +// SPDX-License-Identifier: AGPL-3.0-or-later +// License-Filename: LICENSES/AGPL-3.0.txt +// +// Copyright (C) 2018, 2019, 2020 by via donau +// – Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann <sascha.teichmann@intevation.de> + +package controllers + +import ( + "net/http" + + "github.com/gorilla/mux" +) + +func fairwayAvailability(res http.ResponseWriter, req *http.Request) { + + vars := mux.Vars(req) + + switch vars["kind"] { + case "bottleneck": + case "stretch": + case "section": + } + + // TODO: Implement me! +}
--- a/pkg/controllers/routes.go Wed Apr 22 17:34:43 2020 +0200 +++ b/pkg/controllers/routes.go Wed Apr 29 10:32:48 2020 +0200 @@ -324,6 +324,9 @@ // Handler to serve data to the client. + api.Handle("/data/{kind:stretch|section|bottleneck}/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)