refactor(flow): 目录键归一 flowcenter→flow-center(D1)——PlatformService.FLOW_CENTER 机械跟随,FlowCenterClientTest 失败文案断言同步新键;NoticeFlowProperties 注释残留随移动门户线 WIP 后续处理
build / build-push (push) Failing after 7s
build / build-push (push) Failing after 7s
This commit is contained in:
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* FlowClient 默认实现:主路径走 SDK 类型化门面 {@link YschFlowOpenApi}(服务目录 key=
|
||||
* {@code flowcenter}:yh.call.targets > yh.open.services > 枚举 base-host 兜底,
|
||||
*{@code flow-center}:yh.call.targets > yh.open.services > 枚举 base-host 兜底,
|
||||
* 《子应用配置优化方案》§4.2 零专属地址配置);目录未显式配置时回落本应用 legacy 键
|
||||
* {@code notice.flow.base-url}(ad-hoc TargetSpec,迁移期兼容)。签名/信封解析/错误映射
|
||||
* 全部由 SDK 统一承载(401/403→DException、code!=0→DException、传输错→OpenApiException)。
|
||||
@@ -54,7 +54,7 @@ public class FlowCenterClient implements FlowClient {
|
||||
}
|
||||
this.openCall = call;
|
||||
// 服务目录显式配置(targets/services)则走门面命名目标;否则回落 legacy base-url ad-hoc
|
||||
this.directoryResolved = call.hasTarget(com.yunhai.platform.openapi.core.PlatformService.FLOWCENTER.key());
|
||||
this.directoryResolved = call.hasTarget(com.yunhai.platform.openapi.core.PlatformService.FLOW_CENTER.key());
|
||||
if (directoryResolved) {
|
||||
com.yunhai.platform.openapi.flow.YschFlowOpenApi.setCall(call);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class FlowCenterClient implements FlowClient {
|
||||
// 避免静默打 localhost 把"地址没配"伪装成"流程中心不可达"。
|
||||
// enabled=false(显式未接入)时不校验——地址本就不需要。
|
||||
throw new IllegalStateException("流程中心调用地址未配置:请配置服务目录 yh.open.services."
|
||||
+ com.yunhai.platform.openapi.core.PlatformService.FLOWCENTER.key()
|
||||
+ com.yunhai.platform.openapi.core.PlatformService.FLOW_CENTER.key()
|
||||
+ "(推荐,容器直连完整 URL)或回落键 notice.flow.base-url");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Map;
|
||||
@Service
|
||||
public class NoticeApprovalClient {
|
||||
|
||||
private static final String TARGET = PlatformService.FLOWCENTER.key();
|
||||
private static final String TARGET = PlatformService.FLOW_CENTER.key();
|
||||
private static final String NOT_CONNECTED = "流程中心未接入,审批功能不可用";
|
||||
|
||||
private final NoticeFlowProperties properties;
|
||||
|
||||
@@ -150,7 +150,7 @@ class FlowCenterClientTest {
|
||||
(host, basePath) -> java.util.Collections.emptyList());
|
||||
IllegalStateException e = assertThrows(IllegalStateException.class,
|
||||
() -> new FlowCenterClient(props, new FixedProvider<>(openCall), null, objectMapper));
|
||||
assertTrue(e.getMessage().contains("yh.open.services.flowcenter"), e.getMessage());
|
||||
assertTrue(e.getMessage().contains("yh.open.services.flow-center"), e.getMessage());
|
||||
assertTrue(e.getMessage().contains("notice.flow.base-url"), e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user