我们发布啦

This commit is contained in:
张乐
2020-08-13 16:12:57 +08:00
parent a3e1c38d27
commit c0cec49f41
1885 changed files with 376936 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
package com.aop;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.Arrays;
/**
* 所有的前端controller层的拦截业务方法的执行时间长度
*/
@Aspect
@Component
public class ControllerAspect {
Logger logger = LoggerFactory.getLogger(ControllerAspect.class);
@Pointcut("execution(* com.zbkj.crmeb.system.controller.*.*(..))")
private void pointCutMethodController() {
}
@Around("pointCutMethodController()")
public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable {
long begin = System.nanoTime();
Object obj = pjp.proceed();
long end = System.nanoTime();
logger.info("Controller method{}prams{}cost time{} nscost{} ms",
pjp.getSignature().toString(), Arrays.toString(pjp.getArgs()), (end - begin), (end - begin) / 1000000);
return obj;
}
}