Notes spring aop @after and @before like, how to specify multiple cut points

Cut following two points:

@Pointcut("execution(public * com.wyh.data.controller.DepartmentController.*(..))")
public void department(){}
@Pointcut("execution(public * com.wyh.data.controller.UserController.*(..))")
public void user(){}

@Before("department()")//怎样在这里指定多个切点,逗号不可以
public void before(JoinPoint joinPoint){do something}

At this point you could write

@Before("department()||user()")
public void before(JoinPoint joinPoint){do something}

Guess you like

Origin www.cnblogs.com/eternityz/p/12241515.html