📝Docs: 技术框架文档

This commit is contained in:
2025-10-11 21:47:48 +08:00
parent a904db5d06
commit c5d3b9b996
2 changed files with 31 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
.idea
/target
+28
View File
@@ -1,3 +1,31 @@
# lark-webhook-sender
🤖 基于飞书 Webhook 实现仓库代码更新 | AI 摘要
> [飞书开放平台 - 服务端API - 事件概述](https://open.feishu.cn/document/server-docs/event-subscription-guide/overview)
```mermaid
sequenceDiagram
participant Gitea as Gitea 仓库
participant Service as 你的服务 (Java)
participant AISummary as AI摘要服务
participant Lark as 飞书机器人
Gitea->>Service: 1. Git push事件触发
Service->>Service: 2. 验证Gitea请求(必须!)
Service-->>Service: 2.1 检查 X-Gitea-Event: push
Service-->>Service: 2.2 用 SECRET 校验 signature (HMAC-SHA256)
alt 验证通过
Service->>Service: 3. 解析Gitea Payload
Service-->>Service: 3.1 示例:
Service-->>Service: { "ref": "main", "commits": [{"message": "feat: ..."}] }
Service->>AISummary: 4. 调用AI摘要服务
AISummary->>Service: 4.1 返回总结结果
Service->>Lark: 5. 发送飞书机器人通知
Lark->>Lark: 5.1 格式化:
Lark->>Lark: { "msg_type": "text", "content": "【代码更新】feat: ... [AI总结]" }
Service-->>Gitea: 6. 返回 HTTP 200
else 验证失败
Service-->>Gitea: 6. 返回 HTTP 401
end
```