|
@@ -1,6 +1,7 @@
|
|
package com.hrsk.cloud.eg.domain.api;
|
|
package com.hrsk.cloud.eg.domain.api;
|
|
|
|
|
|
import com.google.common.base.Function;
|
|
import com.google.common.base.Function;
|
|
|
|
+import com.hrsk.cloud.eg.client.dto.RedisSetDto;
|
|
import com.hrsk.cloud.eg.client.dto.cmd.RouteCmd;
|
|
import com.hrsk.cloud.eg.client.dto.cmd.RouteCmd;
|
|
import com.hrsk.cloud.eg.domain.api.channel.guide.common.EgressApiErrorCodeEnum;
|
|
import com.hrsk.cloud.eg.domain.api.channel.guide.common.EgressApiErrorCodeEnum;
|
|
import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
|
|
import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
|
|
@@ -38,11 +39,11 @@ public class Api {
|
|
* 调用
|
|
* 调用
|
|
* @param input 入参
|
|
* @param input 入参
|
|
*/
|
|
*/
|
|
- public String invoke(Map<String,Object> input, Function<HttpApiRequest, HttpApiResponse> httpClientFunc){
|
|
|
|
|
|
+ public String invoke(Map<String,Object> input, Function<HttpApiRequest, HttpApiResponse> httpClientFunc,Function<String,Object> redisGetFunction,Function<RedisSetDto,Boolean> redisSetFunction){
|
|
if(target == null){
|
|
if(target == null){
|
|
throw new BizException(EgressApiErrorCodeEnum.AVAILABLE_API_CHANNEL_NOT_EXIST.getCode(),EgressApiErrorCodeEnum.API_CHANNEL_NOT_EXIST.getMessage());
|
|
throw new BizException(EgressApiErrorCodeEnum.AVAILABLE_API_CHANNEL_NOT_EXIST.getCode(),EgressApiErrorCodeEnum.API_CHANNEL_NOT_EXIST.getMessage());
|
|
}
|
|
}
|
|
- return target.invoke(input,httpClientFunc);
|
|
|
|
|
|
+ return target.invoke(input,httpClientFunc,redisGetFunction,redisSetFunction);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -54,4 +55,5 @@ public class Api {
|
|
target = ApiRoute.getInstance().route(apiChannels,route);
|
|
target = ApiRoute.getInstance().route(apiChannels,route);
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|