# HG changeset patch # User Sascha L. Teichmann # Date 1557731720 -7200 # Node ID 60f25cbe77fb46927087c2869b954497c89ab54d # Parent b27759d0cdff37a4d5608f9c599b1299de61bad0 Added API stubs from fairway availabilty for stretches and sections. diff -r b27759d0cdff -r 60f25cbe77fb pkg/controllers/routes.go --- a/pkg/controllers/routes.go Fri May 10 17:58:49 2019 +0200 +++ b/pkg/controllers/routes.go Mon May 13 09:15:20 2019 +0200 @@ -314,6 +314,13 @@ Handle: bottleneckAvailabilty, })).Methods(http.MethodGet) + api.Handle("/data/{kind:stretch|section}/availability/{objnam}", any(&JSONHandler{ + Handle: stretchAvailabilty, + })).Methods(http.MethodGet) + + api.Handle("/data/{kind:stretch|section}/fairway-depth/{objnam}", any( + middleware.DBConn(http.HandlerFunc(stretchAvailableFairwayDepth)))).Methods(http.MethodGet) + api.Handle("/data/bottleneck/fairway-depth/{objnam}", any( middleware.DBConn(http.HandlerFunc(bottleneckAvailableFairwayDepth)))).Methods(http.MethodGet) diff -r b27759d0cdff -r 60f25cbe77fb pkg/controllers/stretches.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/controllers/stretches.go Mon May 13 09:15:20 2019 +0200 @@ -0,0 +1,32 @@ +// 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) 2099 by via donau +// – Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann + +package controllers + +import ( + "database/sql" + "net/http" +) + +func stretchAvailabilty( + _ interface{}, + req *http.Request, + conn *sql.Conn, +) (jr JSONResult, err error) { + // TODO: Implement me! + return +} + +func stretchAvailableFairwayDepth(rw http.ResponseWriter, req *http.Request) { + // TODO: Implement me! +}