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:
@@ -4,10 +4,13 @@ import org.springframework.beans.factory.SmartInitializingSingleton;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
import com.fasterxml.jackson.datatype.joda.JodaModule;
|
||||
|
||||
import com.dsasp.server.common.log.service.DataOperatorLog;
|
||||
import com.dsasp.server.common.log.service.SystemLogManager;
|
||||
import com.dsasp.server.core.service.FlowServiceImpl;
|
||||
import com.dsasp.server.dataDic.service.POJOCRUDServiceImpl;
|
||||
import com.dsasp.server.dataDic.service.POJOServiceImpl;
|
||||
|
||||
@@ -23,15 +26,21 @@ public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
private final POJOServiceImpl pojoService;
|
||||
private final SystemLogManager systemLogManager;
|
||||
private final DataOperatorLog dataOperatorLog;
|
||||
private final FlowServiceImpl flowService;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
|
||||
public LegacyXmlWiring(POJOCRUDServiceImpl pojoCRUDService,
|
||||
POJOServiceImpl pojoService,
|
||||
SystemLogManager systemLogManager,
|
||||
DataOperatorLog dataOperatorLog) {
|
||||
DataOperatorLog dataOperatorLog,
|
||||
FlowServiceImpl flowService,
|
||||
JdbcTemplate jdbcTemplate) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
this.pojoService = pojoService;
|
||||
this.systemLogManager = systemLogManager;
|
||||
this.dataOperatorLog = dataOperatorLog;
|
||||
this.flowService = flowService;
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,6 +48,9 @@ public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
pojoCRUDService.setSystemLogManager(systemLogManager);
|
||||
pojoService.setSystemLogManager(systemLogManager);
|
||||
pojoService.setDataOperatorLog(dataOperatorLog);
|
||||
// 服务流引擎:FlowServiceImpl.jdbcTemplate 在 framework 经 XML <property> 注入,非 @Autowired 字段。
|
||||
// 等价补齐(见迁移手册 §4.1)。仅 isExistEntityFlow/addDefaultFlowService 用到,执行路径不依赖。
|
||||
flowService.setJdbcTemplate(jdbcTemplate);
|
||||
}
|
||||
|
||||
/** 引擎字段值含 joda DateTime(CREATETIME 等),Boot 3 需显式注册序列化模块。 */
|
||||
|
||||
Reference in New Issue
Block a user