- 新增 edge/report 端点接收边缘端HTTP告警上报 - alarm_event_service 新增 create_from_edge_report 幂等创建 - schemas 新增 EdgeAlarmReport 模型 - 移除 config_service/redis_service/yudao_aiot_config 配置中转 - MQTT 服务标记废弃,告警上报改为HTTP+COS - config 新增 COS/Redis 配置项 - requirements 新增 redis 依赖 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
"""
|
|
MQTT 服务 - 已废弃
|
|
|
|
告警上报已改为 HTTP + COS 方案(边缘端直传)。
|
|
此文件保留为空壳,避免其他模块 import 报错。
|
|
后续版本将彻底删除此文件。
|
|
"""
|
|
|
|
from typing import Dict, Any, Optional
|
|
|
|
|
|
class MQTTService:
|
|
"""MQTT 服务 (已废弃,保留空壳兼容旧代码)"""
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
@property
|
|
def is_connected(self) -> bool:
|
|
return False
|
|
|
|
def register_alert_handler(self, handler):
|
|
pass
|
|
|
|
def register_heartbeat_handler(self, handler):
|
|
pass
|
|
|
|
def start(self):
|
|
pass
|
|
|
|
def stop(self):
|
|
pass
|
|
|
|
def get_statistics(self) -> Dict[str, Any]:
|
|
return {
|
|
"messages_received": 0,
|
|
"alerts_received": 0,
|
|
"heartbeats_received": 0,
|
|
"errors": 0,
|
|
"connected": False,
|
|
"running": False,
|
|
"deprecated": True,
|
|
}
|
|
|
|
|
|
_mqtt_service: Optional[MQTTService] = None
|
|
|
|
|
|
def get_mqtt_service() -> MQTTService:
|
|
"""获取 MQTT 服务单例 (已废弃)"""
|
|
global _mqtt_service
|
|
if _mqtt_service is None:
|
|
_mqtt_service = MQTTService()
|
|
return _mqtt_service
|