Files
dacli/docs/cmd-review/_summary.md
T
sswandClaude b9c9e318af feat(v0.11+): Phase 1 - 23 个 dacli 父命令审计完成
派 25 个 Explore 子代理 (5 批 × 5) 审计 23 个父命令.
产出 cmd-review/{cmd}.md (24 文件) + _summary.md.

关键发现:
- webapi 镜像使用率 < 30% (12+ 父命令 100% 绕 webapi)
- 30+ P0 必补新命令 (form update, log exception, di CRUD, role authorize 等)
- 3 处 P0 端点错误 (假 PASS):
  * integration emailTest/smsTest
  * msg templateCreate
- 用户关键修正: bigscreen → jnpf-web-datascreen-vue3 (独立子项目)
- 用户关键修正: report → jnpf-web-datareport (独立子项目)

下一步: Phase 2 按 P0 优先级执行 (修端点 + 新命令 + webapi 化)

Co-Authored-By: Claude <[email protected]>
2026-06-25 14:58:32 +08:00

124 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Phase 1 总结报告: 23 个 dacli 父命令审计 (2026-06-25)
> **背景**: 用户在 v0.11+ plan 中要求"逐个过 23 个 dacli 父命令", 看 web 端页面逻辑, 决定命令改/删/留.
> **方法**: 5 批 × 5/批 派 Explore 子代理并行审计, 主代理汇总.
> **产出**: `dacli/docs/cmd-review/` 23 个 markdown 报告 + 本总结.
## 1. 审计覆盖 (23/23 完成)
| 批次 | 命令 | web 路径修正 |
|------|------|--------------|
| A | apis, app, bigscreen, datasource, di | **bigscreen** → `jnpf/前端/jnpf-web-datascreen-vue3` |
| B | dict, dm, doc, form, integration | — |
| C | log, menu, monitor, msg, org | — |
| D | portal, print, report, role, schedule | **report** → `jnpf/前端/jnpf-web-datareport` |
| E | storage, user, workflow | — |
**用户关键修正** (2026-06-25):
1. **bigscreen** web 在独立子项目 `jnpf-web-datascreen-vue3`, 不是主 webapp
2. **report** web 在独立子项目 `jnpf-web-datareport`, 不是主 webapp
3. 这两类命令审计 v2 已重新执行
## 2. 总体数据
| 维度 | 数据 |
|------|------|
| 总子命令数 | 116 (24 父命令) |
| webapi 镜像模块 | 6 (dataModel/dataSource/dict/menu/visualDev/workflow) |
| webapi 镜像函数 | 95 |
| webapi 实际使用率 | **< 30%** (大量 c.postJson/c.get 仍手写) |
| 缺 [REFACTOR-WEBAPI] 的命令 | **12+ 父命令** |
| 缺 [NEW-CMD] P0 必补 | **30+ 个新命令** |
| 端点错误 (P0 假 PASS) | **3 处** (integration emailTest/smsTest, msg templateCreate) |
## 3. P0 优先级 Top 10 (按执行价值)
1. **`dacli form update` (高需求, 增量改 schema)** — 改 schema 需 export → 改 → import, 无原子性
2. **`dacli log exception` (P0 必补)** — AI 排查后端异常的唯一杀手锏, 当前完全缺失
3. **`dacli di info/test/create/update/delete` (5 个)** — 当前 1 个 list, AI 完全无法闭环
4. **`dacli role update/info/selector/authorize` (4 个)** — 权限管理闭环断裂
5. **`dacli org update/delete/info + org position (5 子) + org selector`** — 闭环 + 岗位空白
6. **`dacli msg noticeUpdate/Delete + templateUpdate/Delete` (4 个)** + 修端点错误
7. **`dacli storage create/update/delete + upload/download/ls` (6 个)** — 阻塞附件调试
8. **`dacli apis search --field=` (P0)** — 解决 AI 字段盲猜
9. **`dacli bigscreen update/delete/category` (3+ 个)** — 补全 CRUD 闭环
10. **`dacli report create/update/delete + preview + category` (5+ 个)** — 报表管理 3/8 = 12.5% 覆盖率
## 4. P0 [REFACTOR-WEBAPI] Top 5 (架构对齐)
1. **datasource** 4 子命令 (100% 绕 webapi) — webapi/dataSource.ts 已镜像 11 函数, 使用率 0%
2. **dict** 4 子命令 (100% 绕 webapi) — webapi/dict.ts 已镜像 15 函数, 使用率 0%
3. **menu** 6/8 子命令 (1/15 = 6.7% 使用率) — 消除 ~120 行硬编码
4. **form** import.ts (8 调用) + codegen.ts (4) + create.ts (4) + fixcolumndata.ts (3) — 22 调用待切
5. **dm** create + drop — 切到 webapi/dataModel.ts
## 5. 端点错误 (P0 假 PASS, 立即修)
| 命令 | 当前错误端点 | 正确端点 | 影响 |
|------|--------------|----------|------|
| `integration emailTest` | `/message/SendMessageConfig/testSendConfig` | `/message/AccountConfig/testSendMail` | 假 PASS |
| `integration smsTest` | `/system/SmsTemplate/testSent` | `/message/AccountConfig/testSendSms` | 假 PASS |
| `msg templateCreate` | `/api/system/MessageTemplate` | `/api/message/MessageTemplateConfig` | 调用失败 |
## 6. AI 痛点 Top 5 跨命令
1. **webapi 一致性差** — 12+ 父命令 100% 绕 webapi, 大量 c.postJson/c.get 手写
2. **CRUD 闭环断裂** — 大量命令缺 update/info/delete, 改名/修改/清理需 delete+create
3. **selector 缺失** — 多个命令缺选择器 (role/org/dict type/storage/menu), AI 引用 ID 需 list 拉全表
4. **P0 端点错误 (假 PASS)** — 3 处端点错, AI 调用成功但实际不生效
5. **子项目 web 路径未知** — bigscreen/report 是独立子项目, 需特殊处理
## 7. Phase 2 执行建议
### 立即执行 (P0 端点错误)
- 修 integration emailTest/smsTest 端点
- 修 msg templateCreate 端点
- 加 @deprecated 标记
- **执行时间**: 半天
### 短期 (P0 必补 [NEW-CMD])
- form update (2 周)
- log exception (1 周)
- di info/test/create/update/delete (1 周)
- role update/info/selector/authorize (1 周)
- org position + selector (1 周)
- msg noticeUpdate/Delete + templateUpdate/Delete (3 天)
- **总时间**: ~6 周
### 短期 (P0 必补 [REFACTOR-WEBAPI])
- datasource 4 子命令 (2 天)
- dict 4 子命令 (2 天)
- menu 6 子命令 (3 天)
- form import/codegen/create/fixcolumndata (1 周)
- **总时间**: ~2 周
### 中期 (P1 增强)
- apis search (3 天)
- storage CRUD (1 周)
- bigscreen update/delete/category (1 周)
- report CRUD (2 周)
## 8. 不建议做的事 (基于审计)
1. ❌ 不建议补 `schedule pause/resume/start/stop` — JNPF 无对应 API, 用 `update --enabledMark` 替代
2. ❌ 不建议把 `schedule log` 移到 `monitor` — 数据源不同
3. ❌ 不建议命令化 bigscreen/report 设计器 drag-drop — UI 复杂操作, 命令化收益低
4. ❌ 不建议补 `app init --restart` 实际功能 — 现有 dry-run 已说明, 改用 `app use <code>` 替代
5. ❌ 不建议 `dict dataList` 改名 — 现有 4 子命令命名清晰
## 9. 下一步
**Phase 2 开始**: 按 P0 优先级执行
1. **Day 1-2**: 修 3 处端点错误 + 加 @deprecated
2. **Week 1**: form update + log exception
3. **Week 2-3**: di/role/org/msg P0 必补
4. **Week 4-5**: webapi 镜像化 (datasource/dict/menu/form)
5. **Week 6+**: P1 增强 (apis search / storage / bigscreen / report)
---
**作者**: 2026-06-25 派 25 个 Explore 子代理审计 (5 批 × 5)
**审计者**: 23 个 dacli 父命令 (apis/app/bigscreen/datasource/di/dict/dm/doc/form/integration/log/menu/monitor/msg/org/portal/print/report/role/schedule/storage/user/workflow)
**关键修正**: bigscreen/report 是独立子项目, web 路径已修正
**下一步**: Phase 2 按 P0 优先级执行