1.审计日志处理2
This commit is contained in:
@@ -61,6 +61,8 @@ public class LogInfoDTO implements Serializable {
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
private Integer roleType;
|
||||
|
||||
private String serviceName;
|
||||
|
||||
/**
|
||||
@@ -75,4 +77,19 @@ public class LogInfoDTO implements Serializable {
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
public LogInfoDTO(String loginName, String userName, String ip, String operate, String operateType, Integer result, String failReason, Integer level, Integer type, String serviceName, String userIndex, LocalDateTime createTime) {
|
||||
this.loginName = loginName;
|
||||
this.userName = userName;
|
||||
this.ip = ip;
|
||||
this.operate = operate;
|
||||
this.operateType = operateType;
|
||||
this.result = result;
|
||||
this.failReason = failReason;
|
||||
this.level = level;
|
||||
this.type = type;
|
||||
this.serviceName = serviceName;
|
||||
this.userIndex = userIndex;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,31 @@ public class FileUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断文件是否为excel格式
|
||||
*
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
public static boolean judgeFileIsZip(String fileName) {
|
||||
// 检查文件名是否为空
|
||||
if (StrUtil.isBlank(fileName)) {
|
||||
return false;
|
||||
}
|
||||
// 获取文件扩展名
|
||||
String fileExtension = getFileExtension(fileName);
|
||||
// 定义支持的文件类型
|
||||
String[] allowedExtensions = {"zip", "rar"};
|
||||
|
||||
// 检查扩展名是否在允许的列表中
|
||||
for (String ext : allowedExtensions) {
|
||||
if (ext.equalsIgnoreCase(fileExtension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从文件名中提取扩展名
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user