我有以下看点
@Around("execution(public * (@DisabledForBlockedAccounts *).*(..))" + " && @annotation(denyForTeam)")
public Object translateExceptionsDenySelectedAccount(ProceedingJoinPoint pjp, Deny deny) throws Throwable
{
Account account = (Account) pjp.getArgs()[0];
Account selectedAccount = (Account) pjp.getArgs()[1];
if (ArrayUtils.contains(deny.value(), account.getRole()))
{
if (account.getType().equals(Type.CHEF) && !selectedAccount.getType().equals(Type.CHEF))
{
throw new IllegalAccessException("");
}
}
return pjp.proceed();
}
Run Code Online (Sandbox Code Playgroud)
和这个注释:
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
public @interface DenyForTeam
{
Role[] value();
}
Run Code Online (Sandbox Code Playgroud)
我得到错误:错误引用的类型不是注释类型:denyForTeam
为什么DenyForTeam没有注释?它标有@interface