better models and improve validation
This commit is contained in:
@@ -15,17 +15,17 @@ 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 *[]SensorData `json:"sensor_data,omitempty"`
|
||||
}
|
||||
|
||||
type SensorData struct {
|
||||
SensorID string `json:"sensor_id"`
|
||||
Value *float64 `json:"value"`
|
||||
Value float64 `json:"value"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ type SensorRequest struct {
|
||||
}
|
||||
|
||||
type SensorDataRequest struct {
|
||||
SensorID string `json:"sensor_id"`
|
||||
From string `json:"from"`
|
||||
To string `json:"to"`
|
||||
SensorID string `json:"sensor_id"`
|
||||
From *string `json:"from"`
|
||||
To *string `json:"to"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user