float64全部改float32
This commit is contained in:
@@ -86,14 +86,14 @@ type ListHistoricalAlarmResponse struct {
|
||||
type CreateDeviceThresholdAlarmDTO struct {
|
||||
DeviceID uint `json:"device_id" binding:"required"` // 设备ID
|
||||
SensorType models.SensorType `json:"sensor_type" binding:"required"` // 传感器类型
|
||||
Thresholds float64 `json:"thresholds" binding:"required"` // 阈值
|
||||
Thresholds float32 `json:"thresholds" binding:"required"` // 阈值
|
||||
Operator models.Operator `json:"operator" binding:"required"` // 操作符 (使用string类型,与前端交互更通用)
|
||||
Level models.SeverityLevel `json:"level,omitempty"` // 告警等级,可选,如果未提供则使用默认值
|
||||
}
|
||||
|
||||
// UpdateDeviceThresholdAlarmDTO 更新设备阈值告警的请求DTO
|
||||
type UpdateDeviceThresholdAlarmDTO struct {
|
||||
Thresholds float64 `json:"thresholds" binding:"required"` // 新的阈值
|
||||
Thresholds float32 `json:"thresholds" binding:"required"` // 新的阈值
|
||||
Operator models.Operator `json:"operator" binding:"required"` // 新的操作符
|
||||
Level models.SeverityLevel `json:"level,omitempty"` // 新的告警等级,可选
|
||||
}
|
||||
@@ -102,14 +102,14 @@ type UpdateDeviceThresholdAlarmDTO struct {
|
||||
type CreateAreaThresholdAlarmDTO struct {
|
||||
AreaControllerID uint `json:"area_controller_id" binding:"required"` // 区域主控ID
|
||||
SensorType models.SensorType `json:"sensor_type" binding:"required"` // 传感器类型
|
||||
Thresholds float64 `json:"thresholds" binding:"required"` // 阈值
|
||||
Thresholds float32 `json:"thresholds" binding:"required"` // 阈值
|
||||
Operator models.Operator `json:"operator" binding:"required"` // 操作符
|
||||
Level models.SeverityLevel `json:"level,omitempty"` // 告警等级,可选
|
||||
}
|
||||
|
||||
// UpdateAreaThresholdAlarmDTO 更新区域阈值告警的请求DTO
|
||||
type UpdateAreaThresholdAlarmDTO struct {
|
||||
Thresholds float64 `json:"thresholds" binding:"required"` // 新的阈值
|
||||
Thresholds float32 `json:"thresholds" binding:"required"` // 新的阈值
|
||||
Operator models.Operator `json:"operator" binding:"required"` // 新的操作符
|
||||
Level models.SeverityLevel `json:"level,omitempty"` // 新的告警等级,可选
|
||||
}
|
||||
@@ -124,7 +124,7 @@ type AreaThresholdAlarmDTO struct {
|
||||
ID int `json:"id"`
|
||||
AreaControllerID uint `json:"area_controller_id"`
|
||||
SensorType models.SensorType `json:"sensor_type"`
|
||||
Thresholds float64 `json:"thresholds"`
|
||||
Thresholds float32 `json:"thresholds"`
|
||||
Operator models.Operator `json:"operator"`
|
||||
Level models.SeverityLevel `json:"level"`
|
||||
}
|
||||
@@ -134,7 +134,7 @@ type DeviceThresholdAlarmDTO struct {
|
||||
ID int `json:"id"`
|
||||
DeviceID uint `json:"device_id"`
|
||||
SensorType models.SensorType `json:"sensor_type"`
|
||||
Thresholds float64 `json:"thresholds"`
|
||||
Thresholds float32 `json:"thresholds"`
|
||||
Operator models.Operator `json:"operator"`
|
||||
Level models.SeverityLevel `json:"level"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user