clean code
This commit is contained in:
parent
8b23fb63d6
commit
46a3e90ecb
|
|
@ -1,80 +0,0 @@
|
||||||
package com.electromagnetic.industry.software.manage.pojo.other;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class EDDataParams implements Serializable {
|
|
||||||
private static final long serialVersionUID = -4835122199589863011L;
|
|
||||||
/**
|
|
||||||
* 当前页
|
|
||||||
*/
|
|
||||||
private Integer pageIndex = 1;
|
|
||||||
/**
|
|
||||||
* 每页数据
|
|
||||||
*/
|
|
||||||
private Integer pageSize = 10;
|
|
||||||
/**
|
|
||||||
* 操作用户id
|
|
||||||
*/
|
|
||||||
private String userId;
|
|
||||||
/**
|
|
||||||
* 用户名
|
|
||||||
*/
|
|
||||||
private String userName;
|
|
||||||
/**
|
|
||||||
* 上级文件夹数据码,为空是顶级
|
|
||||||
*/
|
|
||||||
private String parentId;
|
|
||||||
/**
|
|
||||||
* 文件数据编码
|
|
||||||
*/
|
|
||||||
private String dataId;
|
|
||||||
/**
|
|
||||||
* 文件夹名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 文件类型
|
|
||||||
*/
|
|
||||||
private String dataType;
|
|
||||||
/**
|
|
||||||
* 创建日期排序
|
|
||||||
*/
|
|
||||||
private String gmtCreate;
|
|
||||||
/**
|
|
||||||
* 文件数据状态
|
|
||||||
*/
|
|
||||||
private String dataStatus;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String note;
|
|
||||||
/**
|
|
||||||
* 是否有效
|
|
||||||
*/
|
|
||||||
private String effectFlag;
|
|
||||||
/**
|
|
||||||
* 关键词
|
|
||||||
*/
|
|
||||||
private String keyWord;
|
|
||||||
/**
|
|
||||||
* 批量上传时间
|
|
||||||
*/
|
|
||||||
private Date gmtBatchUpload;
|
|
||||||
/**
|
|
||||||
* 保存状态
|
|
||||||
*/
|
|
||||||
private String saveStatus;
|
|
||||||
/**
|
|
||||||
* 文件数据编码数组
|
|
||||||
*/
|
|
||||||
private String[] dataIdArr;
|
|
||||||
/**
|
|
||||||
* 文件数据
|
|
||||||
*/
|
|
||||||
private MultipartFile fileData;
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +1,9 @@
|
||||||
package com.electromagnetic.industry.software.common.util;
|
package com.electromagnetic.industry.software.common.util;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class SignUtils {
|
public class SignUtils {
|
||||||
|
|
||||||
public static char[] hexDigits =
|
|
||||||
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
|
||||||
|
|
||||||
public static String md5(String string) {
|
|
||||||
try {
|
|
||||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
|
||||||
byte[] bytes = md5.digest(string.getBytes("utf-8"));
|
|
||||||
char[] chars = new char[bytes.length * 2];
|
|
||||||
|
|
||||||
for (int i = 0; i < bytes.length; ++i) {
|
|
||||||
int b = bytes[i];
|
|
||||||
chars[i * 2] = hexDigits[(b & 240) >> 4];
|
|
||||||
chars[i * 2 + 1] = hexDigits[b & 15];
|
|
||||||
}
|
|
||||||
|
|
||||||
return new String(chars);
|
|
||||||
} catch (Exception var6) {
|
|
||||||
var6.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取MD5加密后的字符串
|
* 获取MD5加密后的字符串
|
||||||
*
|
*
|
||||||
|
|
@ -54,54 +31,4 @@ public class SignUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean equals(String v1, String v2) {
|
|
||||||
if (v1 == null && v2 == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (v1 != null && v2 != null && v1.equals(v2)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getString(Map<String, Object> params, String key, String defaultValue) {
|
|
||||||
String temp = null;
|
|
||||||
if (params.get(key) == null) {
|
|
||||||
return defaultValue;
|
|
||||||
} else if (params.get(key).getClass().isArray()) {
|
|
||||||
temp = getArray(params, key)[0];
|
|
||||||
} else {
|
|
||||||
temp = params.get(key).toString();
|
|
||||||
}
|
|
||||||
if (temp != null) {
|
|
||||||
temp = temp.replaceAll("%", "\\%");
|
|
||||||
}
|
|
||||||
if (temp == null) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] getArray(Map<String, Object> params, String key) {
|
|
||||||
return getArray(params, key, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] getArray(Map<String, Object> params, String
|
|
||||||
key, String[] defaultValue) {
|
|
||||||
if (params == null) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
if (params.get(key) == null) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
String[] values = (String[]) params.get(key);
|
|
||||||
return values;
|
|
||||||
} catch (ClassCastException e) {
|
|
||||||
return defaultValue;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue