Files
eip4-platform/platform-flow-gateway
zhengwr b489f3d834 feat(gateway): models 五端点转发(requireSuperAdmin 统一门)+wftemplates picker 数据源
阶段 2 网关侧(对齐 flowable-service T2.1 ProcessModelController 契约):

FlowableClient +5 方法:listModels/getModel/createModel/updateModel/modelFromProcDef,
全 uri 模板变量严格编码(禁字符串拼接);RestClient 无 PUT 封装 → 照 post 补私有 put()
(uriTemplate+uriVars 严格编码);连接级重试 + 4xx/5xx 透传语义复用既有 execute。

ProcessModelerController:抽 requireSuperAdmin(principal) 私有方法(超管返 null,非超管/无身份
返 403 {status:1,msg:"仅系统管理员可用"}),既有两个 source 端点改用它(行为零变,既有 10 测试零改动);
新增五端点 GET /models、GET /models/{id}、POST /models、PUT /models/{id}、POST /models/from-procdef
全部先过门再转发 FlowableClient,返回体原样透传。

GET /api/workflow/wftemplates(同门):formKey 选择器数据源。
**information_schema 实证**:view_wftemplate 无独立名称列(仅 view_wftemplate_id CHAR + xml +
isactive + 审计列),<form> 根标签也无 title/name 属性(0/1016);唯一人类可读名来自 XML 的
entityid → sys_entity.name(378/1016 带 entityid,339 解析出中文名如「通知管理」)。故
name = entityid 解析出的实体名(LEFT JOIN + substring 正则抽 entityid),空则回退 id;
view_wftemplate_id 是 CHAR 补白 → RowMapper trim;isactive=1 过滤;读库异常降级空列表不 500。

测试:FlowableClientTest 12→18(+list/get/create/update/from-procdef body 透传+4xx 透传);
ProcessModelerControllerTest 10→20(五端点各 admin 200 透传+非超管 403 门拦下游 恰调 1 次证明门生效、
无身份 403、422 胶水经 FlowGatewayExceptionHandler 出 FLOW_REMOTE_ERROR、wftemplates 超管 trim 补白+
无名回退 id、非超管 403 零读库、读库异常降级空列表)。platform-flow-gateway 全模块 98 测试绿、
上游 493 测试绿,BUILD SUCCESS,既有测试零改动。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 11:48:30 +08:00
..