Mercurial > gemma
changeset 5189:5c52d6d69545 new-fwa
Merged default into new-fwa branch.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 02 Apr 2020 15:09:29 +0200 |
parents | f742b5cf9a64 (diff) 673f2a00c767 (current diff) |
children | c3765d8e2a90 |
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 Thu Apr 02 15:09:29 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 Thu Apr 02 13:17:13 2020 +0200 +++ b/pkg/controllers/routes.go Thu Apr 02 15:09:29 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)