add models and validation

This commit is contained in:
2025-10-09 14:41:08 +02:00
parent 37e65ddd76
commit d342efadbc
2 changed files with 86 additions and 1 deletions
+12 -1
View File
@@ -24,6 +24,17 @@ type Sensor struct {
}
type SensorData struct {
Value float64 `json:"value"`
SensorID string `json:"sensor_id"`
Value *float64 `json:"value"`
Timestamp time.Time `json:"timestamp"`
}
type SensorRequest struct {
SensorID string `json:"sensor_id"`
}
type SensorDataRequest struct {
SensorID string `json:"sensor_id"`
From string `json:"from"`
To string `json:"to"`
}