refactor(service): 删除MQTT旧代码 + 修复边缘节点重复显示问题

**删除MQTT旧代码:**
- 删除 mqtt_service.py(已废弃的空壳)
- 从 config.py 删除 MQTTConfig 类和相关配置
- 从 schemas.py 删除 mqtt 字段
- 从 alert_service.py 删除 create_alert_from_mqtt 方法
- 告警上报已改为 HTTP + COS 方案,MQTT机制完全废弃

**修复边缘节点重复显示(方案A):**
- 清理 edge_devices 表历史数据(删除 edge_device_001、edge_inference_device)
- 禁用 DeviceService 的 handle_heartbeat 自动创建设备功能
- 边缘端未实现心跳机制,告警数从 alarm_event 表统计
- 运行时长、处理帧数字段设为 null(无心跳机制,不可用)
- 添加 count_alarms_by_edge_node 方法统计边缘节点告警数

**影响范围:**
- /admin-api/aiot/edge/device/page 接口返回数据调整
- /admin-api/aiot/edge/device/get 接口返回数据调整
- 确保不破坏现有功能(告警上报已改为HTTP)
This commit is contained in:
2026-02-25 10:30:01 +08:00
parent 3bac8be70e
commit f81cc81ce6
7 changed files with 48 additions and 208 deletions

View File

@@ -108,7 +108,6 @@ class DeviceStatisticsResponse(BaseModel):
class HealthResponse(BaseModel):
status: str
database: str
mqtt: Optional[str] = None
websocket_connections: Optional[int] = None