1d7e6a9d6ecbed52b810bd4130fbbc8b9f48de5b
lark-webhook-sender
🤖 基于飞书 Webhook 实现仓库代码更新 | AI 摘要
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
Languages
Java
100%