com.github.qq275860560.common.util.AspectLogUtil Maven / Gradle / Ivy
package com.github.qq275860560.common.util;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;
/**
* @author [email protected]
*/
public class AspectLogUtil {
private static final Log log = LogFactory.getLog(AspectLogUtil.class);
public static Object around(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
String methodName = method.getName();
if (!methodName.matches(
"(get|list|page|count|check|save|update|delete|upload|download|import|export|send|receive|batchUpdate|batchDelete|batchUpload|batchImport).*")) {
log.info(
"为了前后端联调方便,接口名请使用关键字前缀get|list|page|count|check|save|update|delete|upload|download|import|export|send|receive");
}
Object[] args = joinPoint.getArgs();
Set
© 2015 - 2024 Weber Informatics LLC | Privacy Policy