| Modifier and Type | Field and Description |
|---|---|
protected SpringBootPlusAopProperties.LogAopConfig |
logAopConfig
AOP配置
|
protected static ThreadLocal<String> |
threadLocal
本地线程变量,保存请求参数信息到当前线程中
|
| Constructor and Description |
|---|
AbstractLogAop() |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
argsArrayToJsonString(Object[] args)
请求参数拼装
|
abstract Object |
doAround(org.aspectj.lang.ProceedingJoinPoint joinPoint)
环绕通知
方法执行前打印请求参数信息
方法执行后打印响应结果信息
|
protected String |
formatRequestInfo(Map<String,Object> map)
格式化请求信息
|
protected String |
formatResponseInfo(ApiResult apiResult)
格式化响应信息
|
protected com.alibaba.fastjson.JSONObject |
getJsonForParamMap(Map<String,String[]> paramsMap)
获取参数Map的JSON字符串
|
protected Object |
getRequestParamJsonString(org.aspectj.lang.ProceedingJoinPoint joinPoint,
javax.servlet.http.HttpServletRequest request,
String requestMethod,
String contentType,
boolean isRequestBody)
获取请求参数JSON字符串
|
Object |
handle(org.aspectj.lang.ProceedingJoinPoint joinPoint) |
protected void |
handleRequestInfo(Map<String,Object> map)
处理请求参数
|
protected void |
handleResponseInfo(Object result)
处理响应结果
|
protected void |
handleShiroAnnotationValue(Map<String,Object> map,
Method method)
获取Shiro注解值,并记录到map中
|
protected boolean |
isRequestBody(Annotation[][] annotations)
判断控制器方法参数中是否有RequestBody注解
|
protected void |
printRequestInfo(String requestInfo)
打印请求信息
|
protected void |
printRequestResponseInfo(int code,
String requestInfo,
String responseResultInfo)
同时打印请求和响应信息
|
protected void |
printResponseInfo(int code,
String responseResultInfo)
打印响应信息
|
void |
setSpringBootPlusAopProperties(SpringBootPlusAopProperties springBootPlusAopProperties) |
protected static ThreadLocal<String> threadLocal
protected SpringBootPlusAopProperties.LogAopConfig logAopConfig
@Autowired public void setSpringBootPlusAopProperties(SpringBootPlusAopProperties springBootPlusAopProperties)
public abstract Object doAround(org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
joinPoint - Throwablepublic Object handle(org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
Throwableprotected void handleShiroAnnotationValue(Map<String,Object> map, Method method)
map - method - protected void handleResponseInfo(Object result)
result - protected void printRequestResponseInfo(int code,
String requestInfo,
String responseResultInfo)
code - requestInfo - responseResultInfo - protected String formatRequestInfo(Map<String,Object> map)
map - protected void printRequestInfo(String requestInfo)
requestInfo - protected String formatResponseInfo(ApiResult apiResult)
apiResult - protected void printResponseInfo(int code,
String responseResultInfo)
code - responseResultInfo - protected Object getRequestParamJsonString(org.aspectj.lang.ProceedingJoinPoint joinPoint, javax.servlet.http.HttpServletRequest request, String requestMethod, String contentType, boolean isRequestBody)
joinPoint - request - requestMethod - contentType - isRequestBody - protected boolean isRequestBody(Annotation[][] annotations)
annotations - protected Object argsArrayToJsonString(Object[] args)
args - Copyright © 2019. All rights reserved.