spring aop @after和@before之類的註解,怎麼指定多個切點

有以下兩個切點:code

@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}

此時能夠這麼寫io

@Before("department()||user()")
public void before(JoinPoint joinPoint){do something}
相關文章
相關標籤/搜索