类 ApiGateWay<Config extends ApiConfig>
java.lang.Object
io.github.mangocrisp.spring.taybct.tool.core.tpa.ApiGateWay<Config>
广州市指挥中心110警情信息(汇聚)
-
字段概要
字段修饰符和类型字段说明protected BiFunction<Config,
ConcurrentMap<String, com.alibaba.fastjson2.JSONObject>, com.alibaba.fastjson2.JSONObject> 检查登录信息
apiToken 登录信息protected BiConsumer<com.alibaba.fastjson2.JSONObject,
String> 检查返回结果
resultJSON 返回结果的对象
defaultErrorMessage 默认失败消息protected ConcurrentMap<String,
com.alibaba.fastjson2.JSONObject> 缓存客户端登录信息生成 token 的方法拼接包含登录信息的请求头
apiToken 登录信息
return 请求头protected BiFunction<Config,
org.apache.hc.core5.http.Header[], String> 登录的方法protected String
指定第三方接口的名称获取到缓存 token 的 key -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected void
清除 token 信息void
login()
登录<E> E
withTokenInfo
(BiFunction<Config, org.apache.hc.core5.http.Header[], E> tokenInfoFunction) 请求带上 token 信息com.alibaba.fastjson2.JSONObject
withTokenInfoJSON
(BiFunction<Config, org.apache.hc.core5.http.Header[], String> tokenInfoFunction) 带统一处理返回结果的方法
-
字段详细资料
-
loginFun
登录的方法 -
genTokenFun
生成 token 的方法 -
thirdPartName
指定第三方接口的名称 -
tokenCacheKeyFn
获取到缓存 token 的 key -
checkResult
检查返回结果
resultJSON 返回结果的对象
defaultErrorMessage 默认失败消息 -
checkLoginInfo
protected BiFunction<Config extends ApiConfig,ConcurrentMap<String, checkLoginInfocom.alibaba.fastjson2.JSONObject>, com.alibaba.fastjson2.JSONObject> 检查登录信息
apiToken 登录信息 -
getRequestWithTokenHeaders
拼接包含登录信息的请求头
apiToken 登录信息
return 请求头 -
clientTokenInfoMap
缓存客户端登录信息
-
-
构造器详细资料
-
ApiGateWay
public ApiGateWay()
-
-
方法详细资料
-
login
public void login()登录 -
withTokenInfo
public <E> E withTokenInfo(BiFunction<Config, org.apache.hc.core5.http.Header[], E> tokenInfoFunction) 请求带上 token 信息- 类型参数:
E
- 返回的结果- 参数:
tokenInfoFunction
- 传 token 信息给需要调用的方法,然后返回结果- 返回:
- 结果
-
clearTokenInfo
protected void clearTokenInfo()清除 token 信息 -
withTokenInfoJSON
public com.alibaba.fastjson2.JSONObject withTokenInfoJSON(BiFunction<Config, org.apache.hc.core5.http.Header[], String> tokenInfoFunction) 带统一处理返回结果的方法- 参数:
tokenInfoFunction
- 传 token 信息给需要调用的方法,然后返回结果- 返回:
- 请求的返回结果
-