float64全部改float32
This commit is contained in:
@@ -22,7 +22,7 @@ const (
|
||||
// SignalMetrics 存储信号强度数据
|
||||
type SignalMetrics struct {
|
||||
RssiDbm int `json:"rssi_dbm"` // 绝对信号强度(dBm),受距离、障碍物影响
|
||||
SnrDb float64 `json:"snr_db"` // 信号与噪声的相对比率(dB),由 RSSI 减去噪声地板(Noise Floor)
|
||||
SnrDb float32 `json:"snr_db"` // 信号与噪声的相对比率(dB),由 RSSI 减去噪声地板(Noise Floor)
|
||||
SensitivityDbm int `json:"sensitivity_dbm"` // 网关的最低检测阈值(dBm)
|
||||
MarginDb int `json:"margin_db"` // SNR 相对于接收器灵敏度的余量, Margin = SNR - Sensitivity
|
||||
}
|
||||
@@ -36,17 +36,17 @@ type BatteryLevel struct {
|
||||
|
||||
// TemperatureData 存储温度数据
|
||||
type TemperatureData struct {
|
||||
TemperatureCelsius float64 `json:"temperature_celsius"` // 温度值 (摄氏度)
|
||||
TemperatureCelsius float32 `json:"temperature_celsius"` // 温度值 (摄氏度)
|
||||
}
|
||||
|
||||
// HumidityData 存储湿度数据
|
||||
type HumidityData struct {
|
||||
HumidityPercent float64 `json:"humidity_percent"` // 湿度值 (%)
|
||||
HumidityPercent float32 `json:"humidity_percent"` // 湿度值 (%)
|
||||
}
|
||||
|
||||
// WeightData 存储重量数据
|
||||
type WeightData struct {
|
||||
WeightKilograms float64 `json:"weight_kilograms"` // 重量值 (公斤)
|
||||
WeightKilograms float32 `json:"weight_kilograms"` // 重量值 (公斤)
|
||||
}
|
||||
|
||||
// SensorData 存储所有类型的传感器数据,对应数据库中的 'sensor_data' 表。
|
||||
|
||||
Reference in New Issue
Block a user