changeset 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 b27759d0cdff
children 64324aaeb1fb
files pkg/controllers/routes.go pkg/controllers/stretches.go
diffstat 2 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)
 
--- /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 <sascha.teichmann@intevation.de>
+
+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!
+}