Commit 7a8f424e by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !53
parents 5a7e2ba0 d40ec812
...@@ -15,7 +15,6 @@ import java.util.List; ...@@ -15,7 +15,6 @@ import java.util.List;
*/ */
public class WeChatMenuDTO implements Serializable{ public class WeChatMenuDTO implements Serializable{
private static final long serialVersionUID = -4659824138256697908L; private static final long serialVersionUID = -4659824138256697908L;
@JSONField(name = "1111")
private String type; private String type;
private String name; private String name;
private String key; private String key;
......
package com.gic.enterprise.config;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
/**
* 采集GIC系统操作日志
*
* @author leeon
* @date 2019年6月28日
*/
@Aspect
@Configuration
public class ParamAop {
private Logger logger = LogManager.getLogger(ParamAop.class);
/**
* 环绕通知
*
* @param joinPoint
* @return
* @throws Throwable
*/
@Around(value = "execution(* com.gic.*.service..*(..))")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
try {
// 当前方法
String currentMethodName = getMethodName(joinPoint);
// 当前方法参数列表
Object[] args = joinPoint.getArgs();
logger.info("请求方法:{}, 参数:{}", currentMethodName, args);
// 执行当前方法
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
throw throwable;
}
}
/**
* 获取当前方法
*
* @param joinPoint
* @return
* @throws
*/
private String getMethodName(ProceedingJoinPoint joinPoint) throws NoSuchMethodException {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Object target = joinPoint.getTarget();
return target.getClass().getName() + "." + methodSignature.getName();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment