欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

springAOP添加多个具体的切点

程序员文章站 2022-04-25 22:10:17
...

1.用&&或者|| ,代码

    @Pointcut("execution(public * com.ynsj.page.Member.ExpireMemberController.update(..))")
    public void addUpdateMemberInfoLogByCommon() {
    }

    @Pointcut("execution(public * com.ynsj.page.Member.ExpireMemberController.renewalCard(..))")
    public void addUpdateMemberInfoLogByRenewalCard() {
    }
/**
     * 前置操作
     */
    @Before("addUpdateMemberInfoLogByCommon() || addUpdateMemberInfoLogByRenewalCard()")
    public void doword(JoinPoint joinPoint) throws Throwable {
    	// TODO 业务处理
    }

2文章参考链接
https://my.oschina.net/dendy/blog/385608
https://www.cnblogs.com/eternityz/p/12241515.html
https://blog.csdn.net/guchuanlong/article/details/41449835

相关标签: SpringAOP