1
0
forked from erp-dev/erp

feat: message-api for mission via wecomm agent

This commit is contained in:
2026-05-14 09:30:38 +08:00
parent 9359013b4c
commit f409f2e6ee
38 changed files with 2085 additions and 49 deletions

View File

@@ -25,6 +25,7 @@
- 独立 app`notifier`
- Celery task 化投递
- 企业微信 webhook 渠道
- `message_api` 渠道ERP 作为调用方)
- 模板化内容渲染
- Admin 可配置
- `NotifierRoute` 事件路由
@@ -33,7 +34,6 @@
本阶段仍未做:
- 旧模块静态通知逻辑迁移
- 外部 API
- 通知投递明细表
- 数据库级别审计
@@ -151,7 +151,26 @@
`template_key` 如果写错,会在渲染阶段报错并记录日志。
后续可在 admin 或 model clean 中增强校验。
## 12. 当前结论
## 12. `message_api` 渠道边界
`message_api` 的定位是:
- ERP / notifier 只负责渲染结构化消息模板并调用内部 `message_api`
- ERP 不直接管理企业微信 `corp_id``secret``access_token`
- ERP 不直接调用企业微信官方 API
当前实现方式:
- `message_api` channel 使用 `.json` 模板
- backend 会校验模板渲染结果是否符合 text/news 结构
- 之后由 notifier 作为 HTTP client 调用 `MESSAGE_API_BASE_URL`
这意味着:
- `agent_id` / `agent_ids` 仍然属于 channel 级配置
- 企业微信系统级凭据属于 `message_api` 服务自身,不属于 ERP 配置
## 13. 当前结论
当前 `notifier` 已具备: