update - 服务端添加版本校验逻辑
This commit is contained in:
parent
6816c14ba8
commit
05c341b993
@ -19,6 +19,7 @@ import static cn.axzo.workflow.client.config.WorkflowRequestInterceptor.HEADER_A
|
||||
import static cn.axzo.workflow.client.config.WorkflowRequestInterceptor.HEADER_HTTP_CLIENT;
|
||||
import static cn.axzo.workflow.client.config.WorkflowRequestInterceptor.HEADER_HTTP_CLIENT_VALUE;
|
||||
import static cn.axzo.workflow.client.config.WorkflowRequestInterceptor.HEADER_SERVER_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.FLOW_SERVER_VERSION_130;
|
||||
import static cn.axzo.workflow.core.common.code.OtherRespCode.CLIENT_VERSION_SUPPORT;
|
||||
import static cn.axzo.workflow.core.common.code.OtherRespCode.MICRO_SERVER_NEED_REBUILD;
|
||||
|
||||
@ -40,9 +41,10 @@ public class RequestHeaderContextInterceptor implements HandlerInterceptor {
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if (Objects.equals(HEADER_HTTP_CLIENT_VALUE, request.getHeader(HEADER_HTTP_CLIENT))) {
|
||||
String headerClientVersion = request.getHeader(HEADER_API_VERSION);
|
||||
DefaultArtifactVersion minimumSupportedVersion = new DefaultArtifactVersion(FLOW_SERVER_VERSION_130);
|
||||
DefaultArtifactVersion clientVersion = new DefaultArtifactVersion(headerClientVersion);
|
||||
DefaultArtifactVersion serverVersion = new DefaultArtifactVersion(serviceVersion);
|
||||
if (clientVersion.compareTo(serverVersion) >= 0) {
|
||||
if (minimumSupportedVersion.compareTo(clientVersion) >= 0 || clientVersion.compareTo(serverVersion) >= 0) {
|
||||
|
||||
recordClientInfo(request, headerClientVersion, clientVersion);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user