add validation for sensor data and fix tests
This commit is contained in:
@@ -15,18 +15,18 @@ const (
|
||||
)
|
||||
|
||||
type Sensor struct {
|
||||
SensorID string `json:"sensor_id"`
|
||||
SensorType SType `json:"sensor_type"`
|
||||
SamplingInterval *time.Duration `json:"sampling"`
|
||||
ThresholdAbove *float64 `json:"thresoldabove"`
|
||||
ThresholdBelow *float64 `json:"thresoldbelow"`
|
||||
SensorData *[]SensorData `json:"sensor_data,omitempty"`
|
||||
SensorID string `json:"sensor_id"`
|
||||
SensorType SType `json:"sensor_type"`
|
||||
SamplingInterval *time.Duration `json:"sampling"`
|
||||
ThresholdAbove *float64 `json:"thresoldabove"`
|
||||
ThresholdBelow *float64 `json:"thresoldbelow"`
|
||||
SensorData *map[int]SensorData `json:"sensor_data,omitempty"`
|
||||
}
|
||||
|
||||
type SensorData struct {
|
||||
SensorID string `json:"sensor_id"`
|
||||
Value float64 `json:"value"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
SensorID string `json:"sensor_id"`
|
||||
Value *float64 `json:"value"`
|
||||
Timestamp *time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
type SensorRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user