探祕Spring AOP
@Aspect @Component public class SecurityAspect { @Autowired private AuthService authService; @Pointcut("@annotation(AdminOnly)") public void adminOnly(){} @Before("adminOnly()") public void check(){ authService.checkAccess(); } }