changeset 2146:7267f8168176

Extending endpoint /surveys to return depth_reference * Extending the endpoint because the depth_reference is an attribute of the survey and could be different in principle between several surveys.
author Bernhard Reiter <bernhard@intevation.de>
date Thu, 07 Feb 2019 17:45:00 +0100
parents ba43b29e8694
children b66cfcde8ff7
files pkg/controllers/surveys.go pkg/models/surveys.go
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/surveys.go	Thu Feb 07 17:15:33 2019 +0100
+++ b/pkg/controllers/surveys.go	Thu Feb 07 17:45:00 2019 +0100
@@ -28,6 +28,7 @@
 SELECT
   s.bottleneck_id,
   s.date_info::text,
+  s.depth_reference,
   bg.objname AS gauge_objname
 FROM
   ( SELECT * FROM waterway.bottlenecks AS b, waterway.gauges AS g
@@ -61,6 +62,7 @@
 		if err = rows.Scan(
 			&survey.BottleneckID,
 			&survey.DateInfo,
+			&survey.DepthReference,
 			&survey.ReferenceGauge,
 		); err != nil {
 			return
--- a/pkg/models/surveys.go	Thu Feb 07 17:15:33 2019 +0100
+++ b/pkg/models/surveys.go	Thu Feb 07 17:45:00 2019 +0100
@@ -17,6 +17,7 @@
 	Survey struct {
 		BottleneckID   string `json:"bottleneck_id"`
 		DateInfo       string `json:"date_info"`
+		DepthReference string `json:"depth_reference"`
 		ReferenceGauge string `json:"gauge_objname"`
 	}
 )