better models and improve validation

This commit is contained in:
2025-10-09 15:46:43 +02:00
parent 5b281bb295
commit 15b1e9c82f
2 changed files with 37 additions and 29 deletions
+10 -10
View File
@@ -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"`
}