修改说明

This commit is contained in:
zhaojie
2025-09-08 15:27:22 +08:00
parent 8083f136c9
commit e08b570f22
26 changed files with 3524 additions and 21 deletions

View File

@@ -58,6 +58,21 @@ def get_alerts():
except Exception as e:
return jsonify({"error": str(e)}), 500
@app.route('/api/alerts', methods=['POST'])
def create_alert():
"""创建预警"""
try:
data = request.get_json()
alert = assistant.create_alert(
alert_type=data.get('alert_type', 'manual'),
title=data.get('title', '手动预警'),
description=data.get('description', ''),
level=data.get('level', 'medium')
)
return jsonify({"success": True, "alert": alert})
except Exception as e:
return jsonify({"error": str(e)}), 500
@app.route('/api/alerts/statistics')
def get_alert_statistics():
"""获取预警统计"""