comparison pkg/models/surveys.go @ 2149:ed0ee54fc49e

Extend /surveys endpoint to include waterlevel_value * Change SQL to use the same strategy as used in schema/gemma.sql for bottlenecks_geoserver to determine the waterlevel_value. * Extend go controler to deal with the situation where the value is not there. This is still suboptimal as this creates a json object for the NullInt64 value.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 08 Feb 2019 11:26:05 +0100
parents 7267f8168176
children 8132434f4093
comparison
equal deleted inserted replaced
2148:4057a1f15174 2149:ed0ee54fc49e
11 // Author(s): 11 // Author(s):
12 // * Sascha Wilde <sascha.wilde@intevation.de> 12 // * Sascha Wilde <sascha.wilde@intevation.de>
13 13
14 package models 14 package models
15 15
16 import (
17 "database/sql"
18 )
19
16 type ( 20 type (
17 Survey struct { 21 Survey struct {
18 BottleneckID string `json:"bottleneck_id"` 22 BottleneckID string `json:"bottleneck_id"`
19 DateInfo string `json:"date_info"` 23 DateInfo string `json:"date_info"`
20 DepthReference string `json:"depth_reference"` 24 DepthReference string `json:"depth_reference"`
21 ReferenceGauge string `json:"gauge_objname"` 25 ReferenceGauge string `json:"gauge_objname"`
26 WaterLevelValue sql.NullInt64 `json:"waterlevel_value"`
22 } 27 }
23 ) 28 )