自定义注解:
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Oauth {
String key() default "userLogin";
}
切面获取注解key的值
@Around(value = "@annotation(com.foo.common.Oauth) && @annotation(oauth)",
argNames = "joinPoint,oauth")
public Object checkOauth(ProceedingJoinPoint joinPoint, Oauth oauth) {
oauth.key();
return joinPoint.proceed(joinPoint.getArgs());
}