package com.magicdapps.horseraising.config;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
@Aspect
@Component
public class DappsServiceProxyAspect {
@Pointcut("execution(public * com.magicdapps.horseraising.services.dapps.*.*(..)) && !execution(public * com.magicdapps.horseraising.services.dapps.*.init())")
public void initService() {
}
@Before("initService()")
public void deBefore(JoinPoint joinPoint) throws Throwable {
//代理的目标对象
Object target = joinPoint.getTarget();
Method method = target.getClass().getDeclaredMethod("init");
method.invoke(target);
}
}
springboot
最新推荐文章于 2023-07-28 10:33:14 发布
21万+

被折叠的 条评论
为什么被折叠?



