修复切片

This commit is contained in:
stivepeim
2023-10-07 15:32:06 +08:00
parent 6c6ccce625
commit b689d74472
2 changed files with 7 additions and 7 deletions

View File

@@ -1,53 +0,0 @@
package com.zbkj.common.acpect;
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;
/**
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
* 所有的前端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;
}
}