# dacli `msg` 命令审计报告 (2026-06-25) > **注意**: msg 与 integration 是不同命令. msg 是消息通知/公告/模板, integration 是系统集成 (邮件/短信/webhook 配置). ## 1. 命令清单 | 子命令 | 格式 | 用途 | |--------|------|------| | `dacli msg noticeList` | `[--keyword] [--json]` | 公告列表 | | `dacli msg noticeCreate` | `--fullName --enCode --content --category [--json]` | 创建公告 | | `dacli msg noticeSend` | ` --toUserIds [--json]` | 发送公告 | | `dacli msg templateList` | `[--keyword] [--json]` | 消息模板列表 | | `dacli msg templateCreate` | `--fullName --enCode --content --templateType [--json]` | 创建模板 | ## 2. web 端对应 - 消息页: `web/apps/jnpf-web-apps-main/src/views/extend/message/` 或 `system/notice/` - 消息 API: `web/apps/jnpf-web-apps-main/src/api/extend/message.ts` 或 `system/message.ts` - JNPF 后端: `POST /api/message/Notice` (公告) `/api/message/MessageTemplate` (模板) ## 3. 改/删/留 建议 ### [KEEP] 保留 - noticeList / noticeCreate / noticeSend / templateList / templateCreate — 基础 CRUD + 发送 ### [REFACTOR-WEBAPI] **P1 必做** - 缺 webapi/message.ts, 当前用硬编码端点 - 应新建 webapi/message.ts (对应 system/message.ts) + webapi/msgTemplate.ts (对应 msgCenter/msgTemplate.ts) ### [DEPRECATE] 无 (但有端点错误) - **`templatecreate.ts` 端点错误**: 当前用 `/api/system/MessageTemplate`, web 端用 `/api/message/MessageTemplateConfig`, 调用失败 - **必须立即修**: 改用 web 端真实端点 ### [NEW-CMD] **P0 必补** — CRUD 闭环 - **`dacli msg noticeUpdate `** — 改公告 - **`dacli msg noticeDelete `** — 删公告 - **`dacli msg templateUpdate `** — 改模板 - **`dacli msg templateDelete `** — 删模板 ### [NEW-CMD] P1 — 业务命令 - **`dacli msg monitor`** — 消息送达日志 (web 端有 msgMonitor) - **`dacli msg send`** — 直接发模板消息 (不走 notice) - **`dacli msg selector`** — AI 选模板 enCode 必需 ## 4. AI 痛点评估 ### 端点错误 (P0) - `templatecreate.ts` 调用失败 - AI 创建模板 100% 失败, 急需修 ### CRUD 闭环不完整 - AI 只能创建, 无法修改或删除已发布公告/模板 - 业务闭环断开 ### 与 form 联动 - form 业务规则无法联动消息模板 - 缺 `--messageTemplateId` 选项, form 触发消息无路径 - AI 场景: form submit 触发 "报名成功" 通知, 当前无命令支持 ### 与 integration 边界 - msg = 业务消息 (站内信/公告/模板消息) - integration = 系统集成 (邮件/短信/Webhook 配置) - 边界清晰, 但 msg 应负责"如何通过模板发", integration 负责"通道配置" --- **核心结论**: 5 个子命令 (CRUD 中缺 Update/Delete), AI 消息闭环约 60%. 端点错误 1 处 (P0). **3 个最关键建议**: 1. **[P0 端点错误]** `templatecreate.ts` 改用 `/api/message/MessageTemplateConfig` 2. **[P0 CRUD 不完整]** 新增 noticeUpdate/noticeDelete/templateUpdate/templateDelete 4 个命令 3. **[P1 webapi 镜像]** 新建 webapi/message.ts + webapi/msgTemplate.ts