From c5d3b9b996b66df4a50e0748cd3016528165a0f7 Mon Sep 17 00:00:00 2001 From: Wonder Date: Sat, 11 Oct 2025 21:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=93=9DDocs:=20=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=A1=86=E6=9E=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ README.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d2be69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +/target \ No newline at end of file diff --git a/README.md b/README.md index 923572b..63e7e0c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ # lark-webhook-sender -🤖 基于飞书 Webhook 实现仓库代码更新 | AI 摘要 \ No newline at end of file +🤖 基于飞书 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 +``` \ No newline at end of file