Commit dee40a3d authored by yanzg's avatar yanzg

切面

parent 8ee31df7
......@@ -24,7 +24,7 @@ public class FeignAspect extends AbstractValidateAspect {
/**
* AOP的表达式
*/
@Pointcut("execution(* *..*Feign.*(..))")
@Pointcut("execution(* *..feign..*Feign.*(..))")
public void feignAspect() {
}
......
......@@ -41,8 +41,8 @@ import java.util.concurrent.LinkedBlockingQueue;
* @author: Kang
* @time: 2018年04月25日 11:43
*/
//@Aspect
//@Component
@Aspect
@Component
public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next {
private static final Logger logger = LoggerFactory.getLogger(WebAspect.class);
......@@ -76,26 +76,10 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next
/**
* exec aop point aspect
*/
@Pointcut("execution(* *..*Controller.*(..))")
@Pointcut("execution(* *..web.*Controller..*(..))")
public void webAspect() {
}
/**
* 获取返回的至类型
*
* @param joinPoint
* @return
* @throws NoSuchMethodException
*/
private Type getReturnType(ProceedingJoinPoint joinPoint) {
//获取返回值类型
Signature s = joinPoint.getSignature();
MethodSignature ms = (MethodSignature) s;
Method m = ms.getMethod();
Type t = m.getAnnotatedReturnType().getType();
return t;
}
/**
* 执行环形切面
*
......@@ -134,6 +118,22 @@ public class WebAspect extends AbstractValidateAspect implements ThreadNext.Next
}
}
/**
* 获取返回的至类型
*
* @param joinPoint
* @return
* @throws NoSuchMethodException
*/
private Type getReturnType(ProceedingJoinPoint joinPoint) {
//获取返回值类型
Signature s = joinPoint.getSignature();
MethodSignature ms = (MethodSignature) s;
Method m = ms.getMethod();
Type t = m.getAnnotatedReturnType().getType();
return t;
}
private Object executeMethod(ProceedingJoinPoint joinPoint, String name) throws Throwable {
if (joinPoint.getArgs().length != 1
|| joinPoint.getArgs().length == 1 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment