feat(metadata): 服务流执行 REST 门面 FlowController + 本地自举 + 单测

P1-2 第二步:报表方案 D 类——79 个 selectservice 服务流的统一 REST 化入口。

FlowController(com.eip4.platform.metadata.web):
  GET  /api/flow/{id}?k=v   query 参数 → 服务流入参 map(查询/报表类)
  POST /api/flow/{id} body  JSON body  → 服务流入参 map(参数多/带结构)
  统一封装 {status,msg,data};响应递归归一化(GeneralPOJO→平面行、
  listSelect 结果 {listresult,pagecount}→amis {items,total})。OpenAPI 注解。
  REST 入口读写时机:引擎不区分读写,P1 不在门面做引擎级读写闸,由调用方按
  「流定义 XML 审阅」确认查询/报表类后放行;风险与 P2 三层防护待办写入注释与报告。

适配(P1 服务流脚本编译):SecureGroovyScriptEngineFactory 的 DEFAULTIMPORTSLIST
移除两条 Vaadin 客户端 UI 默认导入(client.groovy.TestService、
com.dsasp.client.viewframework.component.MainComponent)——它们逐脚本注入,
classpath 缺失会使每个服务流脚本编译失败;与服务端取数无关,原值登记于注释供 diff。

LegacyXmlWiring:补 FlowServiceImpl.setJdbcTemplate(等价原 XML <property> 注入)。

本地自举:platform-parity bootstrap-flow.sql(幂等)——在 eip4m0 上建 SYS_SERVICEFLOW
+ 自描述元数据 + 最小查询流 EIP4M0_USERGROUP_SEARCH,参照 parity bootstrap 思路,
无客户库副本时引擎可独立跑通。

单测 18 例:FlowModelParseTest(9,XML 解析/参数绑定/默认流生成/往返序列化)+
FlowControllerTest(8,mock 引擎,GET/POST 参数透传 + 响应归一化)+
FlowExecuteLocalIT(1,@SpringBootTest local profile,自举 SQL + 真实引擎执行 +
二次一致;eip4m0 不可达则 assumeTrue 跳过)。全绿。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 12:01:15 +08:00
parent de72116502
commit f0500647be
7 changed files with 731 additions and 4 deletions

View File

@@ -88,9 +88,14 @@ public class SecureGroovyScriptEngineFactory extends GroovyScriptEngineFactory{
"com.dsasp.server.common.function.GetServicesFunction",
"com.dsasp.server.common.function.GetDefaultValueFunction",
"com.dsasp.server.common.function.GetValueFunction",
"com.dsasp.client.viewframework.template.util.Console",
"client.groovy.TestService",
"com.dsasp.client.viewframework.component.MainComponent"
"com.dsasp.client.viewframework.template.util.Console"
// 适配(P1 服务流引擎):移除两条 Vaadin 客户端 UI 默认导入——它们经 imports.addImport
// 逐脚本注入,而 client.groovy.TestService / com.dsasp.client.viewframework.component.MainComponent
// 属已淘汰的 Vaadin 表现层(eip4-platform 保真层不含),classpath 缺失会使「每一个」服务流脚本
// 编译失败(MultipleCompilationErrorsException: unable to resolve class)。两类与服务流
// 服务端取数逻辑无关。原版两条登记于此供 diff 溯源:
// "client.groovy.TestService", "com.dsasp.client.viewframework.component.MainComponent"
// 详见 P1 服务流实测报告「替换类登记」与迁移手册新增坑位。
]
def DEFAULTSTARIMPORTSLIST=[