feat: 集成飞书通知和机器人对话系统

- 新增通知系统 (notifications 表、服务、API)
- 新增飞书定时任务结果推送 (webhook + 应用消息)
- 新增飞书应用消息发送服务 (feishu_app_service)
- 新增飞书 WebSocket 长连接事件监听 (苹果应用)
- 新增飞书账号绑定/解绑 API
- 新增橙子飞书机器人 (独立 WS 连接,固定路由到橙子助手 Agent)
- 执行记录添加 schedule_id,用户添加飞书绑定字段

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
renjianbo
2026-05-02 16:17:49 +08:00
parent 0bbf68d5bb
commit 7ee80c74b2
29 changed files with 4288 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
"""
低代码智能体平台 - FastAPI 主应用
"""
import asyncio
import logging
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
@@ -212,8 +213,22 @@ async def startup_event():
except Exception as e:
logger.error(f"自定义工具加载失败: {e}")
# 启动飞书长连接(在主事件循环中运行)
try:
from app.services.feishu_ws_handler import start_ws_client
asyncio.ensure_future(start_ws_client())
except Exception as e:
logger.error(f"飞书长连接启动失败: {e}")
# 启动橙子飞书长连接
try:
from app.services.orange_ws_handler import start_ws_client as start_orange_ws
asyncio.ensure_future(start_orange_ws())
except Exception as e:
logger.error(f"橙子长连接启动失败: {e}")
# 注册路由
from app.api import auth, uploads, workflows, executions, websocket, execution_logs, data_sources, agents, platform_templates, model_configs, webhooks, template_market, batch_operations, collaboration, permissions, monitoring, alert_rules, node_test, node_templates, tools, agent_chat, agent_monitoring, knowledge_base, agent_schedules
from app.api import auth, uploads, workflows, executions, websocket, execution_logs, data_sources, agents, platform_templates, model_configs, webhooks, template_market, batch_operations, collaboration, permissions, monitoring, alert_rules, node_test, node_templates, tools, agent_chat, agent_monitoring, knowledge_base, agent_schedules, notifications, feishu_bind
app.include_router(auth.router)
app.include_router(uploads.router)
@@ -239,6 +254,8 @@ app.include_router(agent_chat.router)
app.include_router(agent_monitoring.router)
app.include_router(knowledge_base.router)
app.include_router(agent_schedules.router)
app.include_router(notifications.router)
app.include_router(feishu_bind.router)
if __name__ == "__main__":
import uvicorn