代码功能修改

This commit is contained in:
wangchengjun
2022-01-06 23:37:51 +08:00
parent 0f248adc32
commit 01269d3260
8 changed files with 195 additions and 28 deletions
@@ -0,0 +1,42 @@
package com.jero.common.aspect;
import com.jero.modules.base.service.BaseCommonService;
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.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 导入校验,切面处理类
*
* @Author wcj
* @Date 2022年1月6日
*/
@Aspect
@Component
public class ExcelImportAspect {
@Resource
private BaseCommonService baseCommonService;
@Pointcut("@annotation(com.jero.common.aspect.annotation.ExcelImport)")
public void logPointCut() {
}
@Around("logPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
long beginTime = System.currentTimeMillis();
//执行方法
Object result = point.proceed();
//执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime;
return result;
}
}
@@ -0,0 +1,44 @@
package com.jero.common.aspect.annotation;
import com.jero.common.constant.enums.ModuleType;
import java.lang.annotation.*;
/**
* 日志导入校验
*
* @Author wcj
* @Date 2022年1月6日
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ExcelImport {
/**
* 是否必填,false
*
* @return
*/
boolean required() default false;
/**
* 正则表达式
*
* @return 0:操作日志;1:登录日志;2:定时任务;
*/
String regular();
/**
* 字符长度
*
* @return
*/
int length() default 0;
/**
* 日期格式 默认yyyy-MM-dd HH:mm:ss
* @return
*/
String dateFormat() default "yyyy-MM-dd HH:mm:ss";
}