类 LogRestApiInterceptor
java.lang.Object
com.sie.mbm.mom.framework.apilog.step.rest.LogRestApiInterceptor
- 所有已实现的接口:
org.springframework.http.client.ClientHttpRequestInterceptor
@Component
@Qualifier("logRestApiInterceptor")
@Order(2147483647)
public class LogRestApiInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
-
嵌套类概要
嵌套类修饰符和类型类说明private static class缓存响应体的包装类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private voidhandleError(LogApiInfo logApiInfo, Exception ex) 处理异常请求handleSuccess(LogApiInfo logApiInfo, org.springframework.http.client.ClientHttpResponse response) 处理成功请求org.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) 拦截器private voidsetRecord(LogApiInfo logApiInfo)
-
字段详细资料
-
logger
private static final org.slf4j.Logger logger -
logProperties
LogProperties logProperties
-
-
构造器详细资料
-
LogRestApiInterceptor
public LogRestApiInterceptor()
-
-
方法详细资料
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException 拦截器- 指定者:
intercept在接口中org.springframework.http.client.ClientHttpRequestInterceptor- 参数:
request- 请求body- 请求体execution- 执行- 返回:
- ClientHttpResponse
- 抛出:
IOException- 异常
-
handleSuccess
private LogRestApiInterceptor.CachedBodyClientHttpResponseWrapper handleSuccess(LogApiInfo logApiInfo, org.springframework.http.client.ClientHttpResponse response) throws IOException 处理成功请求- 参数:
logApiInfo- 日志信息response- 响应- 返回:
- CachedBodyClientHttpResponseWrapper
- 抛出:
IOException- 响应体异常
-
handleError
处理异常请求- 参数:
logApiInfo- 日志信息ex- 异常
-
setRecord
-