This commit is contained in:
tanghc
2019-02-28 12:37:06 +08:00
parent 5b32524a83
commit c359bf2fb0
9 changed files with 53 additions and 7 deletions

View File

@@ -17,10 +17,26 @@ public abstract class BaseZuulFilter extends ZuulFilter {
private Integer filterOrder;
/**
* 获取过滤器类型
* @return 返回FilterType
* @see ZuulFilter#filterType() filterType()
*/
protected abstract FilterType getFilterType();
/**
* 获取过滤器顺序
* @return
* @see ZuulFilter#filterOrder() filterOrder()
*/
protected abstract int getFilterOrder();
/**
* 执行run
* @param requestContext
* @return
* @throws ZuulException
*/
protected abstract Object doRun(RequestContext requestContext) throws ZuulException;
/**

View File

@@ -7,7 +7,17 @@ import org.springframework.cloud.netflix.zuul.filters.Route;
* @author tanghc
*/
public interface ApiMetaContext {
/**
* 重新加载接口信息
* @param serviceId
* @param serviceApiInfo
*/
void reload(String serviceId, ServiceApiInfo serviceApiInfo);
/**
* 获取接口对应的route信息
* @param nameVersion
* @return
*/
Route getRoute(String nameVersion);
}

View File

@@ -4,7 +4,18 @@ package com.gitee.sop.gatewaycommon.result;
* @author tanghc
*/
public interface ResultExecutor {
/**
* 合并结果
* @param responseStatus
* @param responseData
* @return
*/
String mergeResult(int responseStatus, String responseData);
/**
* 合并错误结果
* @param throwable
* @return
*/
String mergeError(Throwable throwable);
}

View File

@@ -7,6 +7,7 @@ public interface SignEncipher {
/**
* 签名的摘要算法
* @param input 待签名数据
* @param secret 秘钥
* @return 返回加密后的数据
*/
byte[] encrypt(String input, String secret);