feat: add AI tree CRUD recipe

This commit is contained in:
2026-06-17 13:03:38 +08:00
parent 2b0b673ce9
commit 718c5a5b9b
17 changed files with 675 additions and 46 deletions

View File

@@ -51,10 +51,31 @@ java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
--field NAME:名称:string:100:true \
--field CODE:编码:string:64:true \
--field ENABLED:启用:boolean::false \
--page-recipe maintenance-crud-v1 \
--max-repair-attempts 2 \
--output target/ai-runs/customer-level.json
```
树形维护页使用 `tree-crud-v1`。如果字段列表没有显式提供 `PARENTID`,生成器会自动补一个父级字段,
页面使用 `/api/entity/{table}/tree?parentKey=PARENTID&idKey={table}_ID&perPage=2000`
作为树数据接口,并把 `PARENTID` 从树列表列中隐藏:
```bash
java -jar platform-cli/target/platform-cli-0.1.0-SNAPSHOT.jar ai auto-develop \
--base-url http://localhost:8093 \
--objective "新增组织分类树形维护功能" \
--feature-name "组织分类维护" \
--table-name EIP4AI_ORG_CATEGORY \
--entity-name "组织分类" \
--template-id eip4ai-org-category \
--menu-name "组织分类维护" \
--field NAME:名称:string:100:true \
--field CODE:编码:string:64:true \
--page-recipe tree-crud-v1 \
--max-repair-attempts 2 \
--output target/ai-runs/org-category-tree.json
```
本地门禁通过后,可以把最终变更包封装成功能包快照,并保存一个里程碑 revision:
```bash
@@ -88,6 +109,7 @@ curl -X POST http://localhost:8093/api/ai/features/auto-develop \
"entityName": "客户等级",
"templateId": "eip4ai-customer-level",
"menuName": "客户等级维护",
"pageRecipe": "maintenance-crud-v1",
"fields": [
{"column": "NAME", "label": "名称", "type": "string", "length": 100, "required": true},
{"column": "CODE", "label": "编码", "type": "string", "length": 64, "required": true},
@@ -105,6 +127,7 @@ curl -X POST http://localhost:8093/api/ai/features/auto-develop \
2. 读取 `/api/ai/page-recipes` 中的 EIP4 页面 recipe,确认当前页面类型的 UI/UE 约束。
3. 生成 `ENTITY`、`PAGE_SCHEMA`、`SERVICEFLOW`、`MENU`、`TEST` 草稿。`PAGE_SCHEMA`
先生成 EIP4 PageBlueprint,再由平台编译器输出 amis schema;草稿 metadata 保留 blueprint 证据。
未指定 `feature.pageRecipe` 时默认使用 `maintenance-crud-v1`;树形维护页应指定 `tree-crud-v1`。
4. 对草稿执行基础门禁,包括 page-recipe、amis schema、typed page schema、服务流 XML、实体字段和 smoke 计划。
5. 生成待人审 `AiChangeSet`。
6. 生成 release plan。