All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redick.starter.aop.LogHelperAspectJ Maven / Gradle / Ivy

There is a newer version: 1.0.5-RELEASE
Show newest version
package com.redick.starter.aop;

import com.redick.AroundLogHandler;
import com.redick.proxy.aspectj.AroundLogProxyChainImpl;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author Redick01
 *  2022/3/25 14:36
 */
@Aspect
@Configuration
public class LogHelperAspectJ {

    @Resource
    private AroundLogHandler aroundLogHandler;

    @Pointcut("@annotation(com.redick.annotation.LogMarker)")
    public void pointcut() {

    }

    /**
     * 执行结果
     * @param joinPoint 切点
     * @return 返回结果
     * @throws Throwable 异常
     */
    @Around("pointcut()")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        return aroundLogHandler.around(new AroundLogProxyChainImpl(joinPoint));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy