1. 新增三表结构: alarm_event(主表), alarm_event_ext(算法扩展), alarm_llm_analysis(大模型分析) 2. 新增 AlarmEventService 服务,支持 MQTT/HTTP 双路创建告警 3. MQTT handler 双写新旧表,平滑过渡 4. 重写 yudao_aiot_alarm 路由,对接新告警服务 5. 集成腾讯云 COS 对象存储:上传、预签名URL、STS临时凭证 6. 新增 storage 路由:upload/presign/upload-url/sts 四个接口 7. COS 未启用时自动降级本地 uploads/ 目录存储 8. 新增数据迁移脚本 migrate_to_alarm_event.py 9. 删除根目录 main.py(非项目入口) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
584 B
Plaintext
30 lines
584 B
Plaintext
# 数据库配置
|
|
DATABASE_URL=sqlite:///./data/alert_platform.db
|
|
|
|
# 腾讯云 COS 存储配置
|
|
COS_ENABLED=false
|
|
COS_SECRET_ID=your_secret_id
|
|
COS_SECRET_KEY=your_secret_key
|
|
COS_REGION=ap-beijing
|
|
COS_BUCKET=your-bucket-1250000000
|
|
COS_UPLOAD_PREFIX=alerts
|
|
COS_PRESIGN_EXPIRE=1800
|
|
COS_STS_EXPIRE=1800
|
|
|
|
# 应用配置
|
|
APP_HOST=0.0.0.0
|
|
APP_PORT=8000
|
|
DEBUG=true
|
|
DEV_MODE=true
|
|
|
|
# MQTT 配置
|
|
MQTT_ENABLED=true
|
|
MQTT_BROKER_HOST=localhost
|
|
MQTT_BROKER_PORT=1883
|
|
MQTT_USERNAME=
|
|
MQTT_PASSWORD=
|
|
|
|
# 大模型配置(可选)
|
|
AI_MODEL_ENDPOINT=http://localhost:8001
|
|
AI_MODEL_API_KEY=your_api_key
|