增加ping指令并获取带版本号的响应

This commit is contained in:
2025-12-01 20:42:21 +08:00
parent d5999cee7e
commit 49555c0842
17 changed files with 557 additions and 44 deletions

View File

@@ -16,6 +16,8 @@ type PlanName string
const (
// PlanNamePeriodicSystemHealthCheck 是周期性系统健康检查计划的名称
PlanNamePeriodicSystemHealthCheck PlanName = "周期性系统健康检查"
// PlanNamePeriodicHeartbeatCheck 是周期性心跳检测计划的名称
PlanNamePeriodicHeartbeatCheck PlanName = "周期性心跳检测"
// PlanNameAlarmNotification 是告警通知发送计划的名称
PlanNameAlarmNotification PlanName = "告警通知发送"
)
@@ -44,6 +46,7 @@ const (
TaskTypeWaiting TaskType = "等待" // 等待任务
TaskTypeReleaseFeedWeight TaskType = "下料" // 下料口释放指定重量任务
TaskTypeFullCollection TaskType = "全量采集" // 新增的全量采集任务
TaskTypeHeartbeat TaskType = "心跳检测" // 区域主控心跳检测任务
TaskTypeAlarmNotification TaskType = "告警通知" // 告警通知任务
TaskTypeNotificationRefresh TaskType = "通知刷新" // 通知刷新任务
TaskTypeDeviceThresholdCheck TaskType = "设备阈值检查" // 设备阈值检查任务

View File

@@ -17,6 +17,16 @@ const (
SensorTypeTemperature SensorType = "温度" // 温度
SensorTypeHumidity SensorType = "湿度" // 湿度
SensorTypeWeight SensorType = "重量" // 重量
SensorTypeOnlineStatus SensorType = "在线状态" // 在线状态
)
// OnlineState 定义了设备的在线状态枚举
type OnlineState string
const (
StateOnline OnlineState = "在线" // 设备在线
StateOffline OnlineState = "离线" // 设备离线
StateAbnormal OnlineState = "异常" // 设备状态异常
)
// SignalMetrics 存储信号强度数据
@@ -49,6 +59,11 @@ type WeightData struct {
WeightKilograms float32 `json:"weight_kilograms"` // 重量值 (公斤)
}
// OnlineStatusData 记录了设备的在线状态
type OnlineStatusData struct {
State OnlineState `json:"state"` // 在线状态
}
// SensorData 存储所有类型的传感器数据,对应数据库中的 'sensor_data' 表。
type SensorData struct {
// Time 是数据记录的时间戳,作为复合主键的一部分。