Compare commits
2 Commits
master
...
1.3.3-u1-S
| Author | SHA1 | Date | |
|---|---|---|---|
| 524e011541 | |||
| 51f1cba431 |
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -199,8 +200,8 @@ public class WorkflowEngineClientAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor workflowRequestInterceptor(String serviceVersion) {
|
||||
return new WorkflowRequestInterceptor(serviceVersion);
|
||||
public RequestInterceptor workflowRequestInterceptor(String serviceVersion, Environment environment) {
|
||||
return new WorkflowRequestInterceptor(serviceVersion, environment);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.axzo.workflow.client.config;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import feign.Target;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
/**
|
||||
* 通用的 Feign 请求拦截器
|
||||
@ -12,14 +13,16 @@ import feign.Target;
|
||||
*/
|
||||
public class WorkflowRequestInterceptor implements RequestInterceptor {
|
||||
private final String serviceVersion;
|
||||
private final Environment environment;
|
||||
|
||||
public WorkflowRequestInterceptor(String serviceVersion) {
|
||||
public WorkflowRequestInterceptor(String serviceVersion, Environment environment) {
|
||||
this.serviceVersion = serviceVersion;
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
public static final String HEADER_HTTP_CLIENT = "http-client";
|
||||
public static final String HEADER_HTTP_CLIENT_VALUE = "workflowEngine-feign";
|
||||
public static final String HEADER_API_VERSION = "service-version";
|
||||
public static final String HEADER_HTTP_CLIENT = "Http-Client";
|
||||
public static final String HEADER_HTTP_CLIENT_VALUE = "WorkflowEngine-Feign";
|
||||
public static final String HEADER_API_VERSION = "Service-Version";
|
||||
public static final String HEADER_SERVER_NAME = "X-SERVER-NAME";
|
||||
|
||||
|
||||
@ -31,6 +34,7 @@ public class WorkflowRequestInterceptor implements RequestInterceptor {
|
||||
|| apiClassPath.contains("cn.axzo.workflow.client.feign.manage")) {
|
||||
requestTemplate.header(HEADER_HTTP_CLIENT, HEADER_HTTP_CLIENT_VALUE);
|
||||
requestTemplate.header(HEADER_API_VERSION, serviceVersion);
|
||||
requestTemplate.header(HEADER_SERVER_NAME, environment.getProperty("spring.application.name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ public enum BpmnFlowNodeType {
|
||||
NODE_ROBOT("NODE_ROBOT", "机器人节点"),
|
||||
NODE_COMMENT("NODE_COMMENT", "评论节点"),
|
||||
NODE_ABORT("NODE_ABORT", "中止节点"),
|
||||
NODE_ALTER("NODE_ALTER", "告警节点"),
|
||||
NODE_CANCEL("NODE_CANCEL", "撤回节点"),
|
||||
NODE_EMPTY("NODE_EMPTY", "空节点"),
|
||||
;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user