refactor(operalog): 优化操作日志切面类代码结构
- 在方法调用前添加this关键字明确对象引用
This commit is contained in:
+5
-7
@@ -52,18 +52,16 @@ public class OperationLogAspect {
|
||||
private SystemOperationLogMapper systemOperationLogMapper;
|
||||
|
||||
@Around("@annotation(operationLog)")
|
||||
public Object operationLogCatch(ProceedingJoinPoint joinPoint, OperationLog operationLog)
|
||||
throws Throwable {
|
||||
return handleLog(joinPoint, operationLog);
|
||||
public Object operationLogCatch(ProceedingJoinPoint joinPoint, OperationLog operationLog) throws Throwable {
|
||||
return this.handleLog(joinPoint, operationLog);
|
||||
}
|
||||
|
||||
private Object handleLog(ProceedingJoinPoint joinPoint, OperationLog annotation)
|
||||
throws Throwable {
|
||||
private Object handleLog(ProceedingJoinPoint joinPoint, OperationLog annotation) throws Throwable {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
try {
|
||||
Object result = joinPoint.proceed();
|
||||
long interval = timeInterval.interval();
|
||||
SystemOperationLogTb record = getOperationLogTb(joinPoint, annotation, interval);
|
||||
SystemOperationLogTb record = this.getOperationLogTb(joinPoint, annotation, interval);
|
||||
ThreadUtil.execAsync(
|
||||
() -> {
|
||||
try {
|
||||
@@ -75,7 +73,7 @@ public class OperationLogAspect {
|
||||
return result;
|
||||
} catch (Throwable exception) {
|
||||
long interval = timeInterval.interval();
|
||||
SystemOperationLogTb record = getOperationLogTb(joinPoint, annotation, interval);
|
||||
SystemOperationLogTb record = this.getOperationLogTb(joinPoint, annotation, interval);
|
||||
record.setExceptionDetail(ExceptionUtil.stacktraceToString(exception));
|
||||
ThreadUtil.execAsync(
|
||||
() -> {
|
||||
|
||||
Reference in New Issue
Block a user