This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.yunhai.svchall.service;
|
||||
|
||||
import com.yunhai.svchall.model.svc.SvcModels;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程中心客户端接缝(V2.0 Part B.4):Notice 同款托管模式的出站面。
|
||||
* 默认实现经共享 IDHttp(出站自动签名,yh.app-auth 身份)调 flow-center /oapi/flow/**。
|
||||
* enabled=false(本地未部署 flow-center)时所有方法抛业务异常,消费方按需降级
|
||||
* (事项不绑流程=纯指南,不经过本接口)。
|
||||
*/
|
||||
public interface FlowClient {
|
||||
|
||||
/** 流程中心是否已接入(未接入时管理端选择器降级提示,事项绑 flow_guid 校验跳过) */
|
||||
boolean enabled();
|
||||
|
||||
/** 已发布流程列表(事项编辑页"办理流程"选择器数据源) */
|
||||
List<SvcModels.FlowSummaryVo> listFlows(Long schId);
|
||||
|
||||
/** 流程详情回显(节点与办理科室摘要) */
|
||||
SvcModels.FlowSummaryVo getFlow(Long schId, String flowGuid);
|
||||
|
||||
/**
|
||||
* 代发起(POST /oapi/flow/apply,V2.0 B.4#3)。
|
||||
*
|
||||
* @return {instanceId, duplicated}(duplicated=true 表示命中 uk 幂等返回既有办件)
|
||||
*/
|
||||
ApplyResult apply(Long schId, String flowGuid, String bizType, String bizId, String bizTitle,
|
||||
String bizUrl, String bizSnapshot, Integer submitterId, String submitterName,
|
||||
String formDataJson);
|
||||
|
||||
/** 按业务键查办件(对账兜底;返回 {instanceId,status,version,nodeSummary,traceJson},查不到返回 null) */
|
||||
Map<String, Object> getInstanceByBiz(Long schId, String bizType, String bizId);
|
||||
|
||||
/** 注册回调(POST /oapi/flow/callback/reg)→ 下发 secret */
|
||||
String registerCallback(Long schId, String flowGuid, String callbackUrl, String eventTypes);
|
||||
|
||||
/** 代发起结果 */
|
||||
class ApplyResult {
|
||||
private final Long instanceId;
|
||||
private final boolean duplicated;
|
||||
|
||||
public ApplyResult(Long instanceId, boolean duplicated) {
|
||||
this.instanceId = instanceId;
|
||||
this.duplicated = duplicated;
|
||||
}
|
||||
|
||||
public Long getInstanceId() {
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
public boolean isDuplicated() {
|
||||
return duplicated;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user