mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
支持预发布、灰度发布
This commit is contained in:
@@ -37,6 +37,7 @@ public abstract class BaseExecutorAdapter<T, R> implements ResultExecutor<T, R>
|
||||
private static final ErrorMeta SUCCESS_META = ErrorEnum.SUCCESS.getErrorMeta();
|
||||
private static final ErrorMeta ISP_UNKNOW_ERROR_META = ErrorEnum.ISP_UNKNOW_ERROR.getErrorMeta();
|
||||
private static final ErrorMeta ISP_BIZ_ERROR = ErrorEnum.BIZ_ERROR.getErrorMeta();
|
||||
private static final ErrorMeta ISV_MISSING_METHOD_META = ErrorEnum.ISV_MISSING_METHOD.getErrorMeta();
|
||||
|
||||
public static final String GATEWAY_CODE_NAME = "code";
|
||||
public static final String GATEWAY_MSG_NAME = "msg";
|
||||
@@ -90,6 +91,10 @@ public abstract class BaseExecutorAdapter<T, R> implements ResultExecutor<T, R>
|
||||
responseData = JSON.parseObject(serviceResult);
|
||||
responseData.put(GATEWAY_CODE_NAME, ISP_BIZ_ERROR.getCode());
|
||||
responseData.put(GATEWAY_MSG_NAME, ISP_BIZ_ERROR.getError().getMsg());
|
||||
} else if(responseStatus == HttpStatus.NOT_FOUND.value()) {
|
||||
responseData = JSON.parseObject(serviceResult);
|
||||
responseData.put(GATEWAY_CODE_NAME, ISV_MISSING_METHOD_META.getCode());
|
||||
responseData.put(GATEWAY_MSG_NAME, ISV_MISSING_METHOD_META.getError().getCode());
|
||||
} else {
|
||||
this.storeError(request, ErrorType.UNKNOWN);
|
||||
// 微服务端有可能返回500错误
|
||||
|
@@ -63,13 +63,7 @@ public class ApiMappingRequestCondition implements RequestCondition<ApiMappingRe
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(ApiMappingRequestCondition other, HttpServletRequest request) {
|
||||
if (null != apiMappingInfo && null == other.apiMappingInfo) {
|
||||
return 1;
|
||||
} else if (null == apiMappingInfo && null != other.apiMappingInfo) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return this.apiMappingInfo.getVersion().compareTo(other.apiMappingInfo.getVersion());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ public class RefreshTokenTest extends TestCase {
|
||||
OpenAuthTokenAppRequest request = new OpenAuthTokenAppRequest();
|
||||
OpenAuthTokenAppModel model = new OpenAuthTokenAppModel();
|
||||
model.setGrant_type("refresh_token");
|
||||
model.setRefresh_token("856faf8d77d3b985c1073557ce6ea724");
|
||||
model.setRefresh_token("c9e4003c06fe59066eed73d64ea074ca");
|
||||
request.setBizModel(model);
|
||||
|
||||
OpenAuthTokenAppResponse response = openClient.execute(request);
|
||||
|
Reference in New Issue
Block a user