feat(feishu): 添加飞书长连接支持并重构事件处理

添加了 FeishuEventService 来统一处理飞书消息事件,
新增 long_connection.py 实现长连接客户端,
修改 webhook 路由使用新的事件处理服务,
添加了 lark-oapi 依赖支持长连接功能,
更新测试用例覆盖新的事件处理逻辑。

BREAKING CHANGE: 飞书事件处理逻辑重构,统一使用
FeishuEventService 进行消息处理和审计记录。
```
This commit is contained in:
2026-06-22 14:54:20 +08:00
parent 71ca804764
commit 09933b15ad
20 changed files with 177 additions and 869 deletions

View File

@@ -20,7 +20,8 @@ class FeishuService:
def verify_event(self, payload: dict[str, Any]) -> None:
settings = get_settings()
expected = settings.feishu_verification_token
token = payload.get("token")
header = payload.get("header") or {}
token = payload.get("token") or header.get("token")
if expected and token and token != expected:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,