代码功能修改
This commit is contained in:
+42
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user