@Aspect
public class CacheManager {
}
@Before("execution(* com.aliexpress.social.game.cointree.cointree.gateway.application.*.*(..))")
public void migrateCheck(JoinPoint joinPoint) {
String userId = getUserIdFromAop(jointPoint);
}
//从拦截的参数中获取用户id
private String getUserIdFromAop(JoinPoint joinPoint){
//https://www.cnblogs.com/yln20170705/p/10511743.html
//类名
String clazzName = joinPoint.getTarget().getClass().getName();
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
//方法名
String methodName = methodSignature.getName();
//参数名数组
String[] parameters = methodSignature.getParameterNames();
//参数值
Object[] args = joinPoint.getArgs();
//获取参数名对应数组下标
RequestInfoDTO infoDTO = null;</