将所有Regional更改为Area

This commit is contained in:
2025-11-10 21:32:18 +08:00
parent 4f3148eaa2
commit 75306941c2
11 changed files with 61 additions and 60 deletions

View File

@@ -11,11 +11,11 @@ func NewListSensorDataResponse(data []models.SensorData, total int64, page, page
dtos := make([]SensorDataDTO, len(data))
for i, item := range data {
dtos[i] = SensorDataDTO{
Time: item.Time,
DeviceID: item.DeviceID,
RegionalControllerID: item.RegionalControllerID,
SensorType: item.SensorType,
Data: json.RawMessage(item.Data),
Time: item.Time,
DeviceID: item.DeviceID,
AreaControllerID: item.AreaControllerID,
SensorType: item.SensorType,
Data: json.RawMessage(item.Data),
}
}

View File

@@ -22,11 +22,11 @@ type ListSensorDataRequest struct {
// SensorDataDTO 是用于API响应的传感器数据结构
type SensorDataDTO struct {
Time time.Time `json:"time"`
DeviceID uint `json:"device_id"`
RegionalControllerID uint `json:"regional_controller_id"`
SensorType models.SensorType `json:"sensor_type"`
Data json.RawMessage `json:"data"`
Time time.Time `json:"time"`
DeviceID uint `json:"device_id"`
AreaControllerID uint `json:"area_controller_id"`
SensorType models.SensorType `json:"sensor_type"`
Data json.RawMessage `json:"data"`
}
// ListSensorDataResponse 是获取传感器数据列表的响应结构