docs(详细设计): 新增飞书通知设计

This commit is contained in:
2026-06-03 21:15:34 +08:00
parent cc200a32c4
commit 7a60af0485
7 changed files with 823 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
# 飞书任务入口解析Skill 设计
## 1. Skill 定位
`飞书任务入口解析Skill` 负责解析飞书事件和用户指令,将群聊消息映射到系统审核任务。
英文实现标识建议使用 `FeishuTaskEntryParseSkill`
## 2. 输入
```python
@dataclass
class FeishuTaskEntryParseInput:
event_payload: dict
```
## 3. 输出
```python
@dataclass
class FeishuTaskEntryParseOutput:
command: str
scenario_id: str | None
batch_id: int | None
chat_id: str
message_id: str
warnings: list[dict]
```
## 4. 核心方法
### 4.1 `run(input) -> FeishuTaskEntryParseOutput`
主入口方法。
### 4.2 `verify_event_signature(payload) -> bool`
校验事件来源。
### 4.3 `extract_command(payload) -> str`
提取用户指令。
### 4.4 `resolve_scenario(command) -> str | None`
映射任务场景。
## 5. 技术实现
使用技术:
1. 飞书事件订阅
2. Django webhook
3. 场景配置 YAML
## 6. 异常处理
1. 验签失败:拒绝请求。
2. 指令无法识别:返回帮助提示。
3. 批次无法解析:提示用户补充批次。
## 7. 测试要点
1. 能解析群聊消息。
2. 能识别风险报告指令。
3. 验签失败被拒绝。