@Around用法

    @Around(value = "pointcut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
    
return joinPoint.proceed();
    }

 

@AfterThrowing用法

 

//pointcut()为注册的切入点方法
    @AfterThrowing(pointcut = "pointcut()", throwing = "ex")
    public void afterThrow(JoinPoint joinPoint, Exception ex) {
        String name = joinPoint.getSignature().getName();
        log.info(name + "异常:" + "\t" + ex.getMessage());

 

posted on 2021-02-07 16:34  花开浪漫拾  阅读(2211)  评论(0编辑  收藏  举报