public class RequestAspectTool extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RequestAspectTool.RequestDto |
| 构造器和说明 |
|---|
RequestAspectTool() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
aspect(org.aspectj.lang.ProceedingJoinPoint joinPoint)
对请求controller进行切面
使用uuid作为请求流水号,请求之前将请求流水号设置为当前线程名称
|
static Object |
aspect(org.aspectj.lang.ProceedingJoinPoint joinPoint,
java.util.function.Supplier<String> traceIdSupplier,
java.util.function.Consumer<javax.servlet.http.HttpServletRequest> beforeRequestConsumer,
java.util.function.BiConsumer<javax.servlet.http.HttpServletRequest,Object> afterResponseConsumer,
java.util.function.Consumer<RequestAspectTool.RequestDto> finalConsumer)
对请求controller进行切面
|
public static Object aspect(org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
joinPoint - joinPointThrowable - 异常对象public static Object aspect(org.aspectj.lang.ProceedingJoinPoint joinPoint, java.util.function.Supplier<String> traceIdSupplier, java.util.function.Consumer<javax.servlet.http.HttpServletRequest> beforeRequestConsumer, java.util.function.BiConsumer<javax.servlet.http.HttpServletRequest,Object> afterResponseConsumer, java.util.function.Consumer<RequestAspectTool.RequestDto> finalConsumer) throws Throwable
joinPoint - joinPointtraceIdSupplier - 请求流水号生成接口beforeRequestConsumer - 请求执行之前的接口afterResponseConsumer - 请求执行之后的接口finalConsumer - finally 代码块中的回调函数Throwable - 异常对象Copyright © 2023. All rights reserved.