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

@@ -632,6 +632,10 @@ public final class Eip4Cli {
for (String field : fields) {
fieldNodes.add(parseField(field));
}
String pageRecipe = options.single("page-recipe");
if (pageRecipe != null && !pageRecipe.isBlank()) {
feature.put("pageRecipe", pageRecipe);
}
return root;
}
@@ -872,7 +876,7 @@ public final class Eip4Cli {
eip4 env use --name NAME
eip4 env current
eip4 env status [--env NAME|--base-url URL|--all]
eip4 ai auto-develop --objective TEXT --feature-name NAME --table-name TABLE --entity-name NAME --template-id ID --menu-name NAME --field column:label:type[:length][:required]
eip4 ai auto-develop --objective TEXT --feature-name NAME --table-name TABLE --entity-name NAME --template-id ID --menu-name NAME --field column:label:type[:length][:required] [--page-recipe maintenance-crud-v1|tree-crud-v1]
eip4 release diff --left FILE --right FILE
eip4 release export --package-file FILE --output FILE
eip4 release import-preview --package-file FILE
@@ -934,6 +938,7 @@ public final class Eip4Cli {
Optional:
--env NAME
--base-url URL
--page-recipe maintenance-crud-v1|tree-crud-v1
--max-repair-attempts N
--no-deployment-package
--yes

View File

@@ -84,6 +84,7 @@ class Eip4CliTest {
"--menu-name", "客户等级维护",
"--field", "NAME:名称:string:100:true",
"--field", "ENABLED:启用:boolean::false",
"--page-recipe", "tree-crud-v1",
"--max-repair-attempts", "3",
"--no-deployment-package",
"--output", output.toString());
@@ -95,6 +96,7 @@ class Eip4CliTest {
assertEquals(3, client.body.path("maxRepairAttempts").asInt());
JsonNode feature = client.body.path("feature");
assertEquals("EIP4AI_CUSTOMER_LEVEL", feature.path("tableName").asText());
assertEquals("tree-crud-v1", feature.path("pageRecipe").asText());
assertEquals(2, feature.path("fields").size());
assertEquals("NAME", feature.path("fields").get(0).path("column").asText());
assertEquals(100, feature.path("fields").get(0).path("length").asInt());