删除不要的方法
This commit is contained in:
@@ -1,31 +0,0 @@
|
|||||||
package com.bao.dating.aspect;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
|
||||||
import org.aspectj.lang.annotation.Around;
|
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 记录方法运行耗时
|
|
||||||
* @author KilLze
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Aspect
|
|
||||||
@Component
|
|
||||||
public class RecordTimeAspect {
|
|
||||||
@Around("execution(* com.bao.dating.service.impl.*.*(..))")
|
|
||||||
public Object recordTime(ProceedingJoinPoint pjp) throws Throwable {
|
|
||||||
//1. 记录方法运行的开始时间
|
|
||||||
long begin = System.currentTimeMillis();
|
|
||||||
|
|
||||||
//2. 执行原始的方法
|
|
||||||
Object result = pjp.proceed();
|
|
||||||
|
|
||||||
//3. 记录方法运行的结束时间, 记录耗时
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
log.info("方法 {} 执行耗时: {}ms", pjp.getSignature() ,end-begin);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user