diff --git a/file-common/src/main/java/com/mac/common/cbb/DateUtil.java b/file-common/src/main/java/com/mac/common/cbb/DateUtil.java new file mode 100644 index 0000000..55069e6 --- /dev/null +++ b/file-common/src/main/java/com/mac/common/cbb/DateUtil.java @@ -0,0 +1,126 @@ +package com.mac.common.cbb; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +public class DateUtil { + /** + * 获取系统当前时间 + * + * @return 系统当前时间 + */ + public static String getCurrentTime() { + Date date = new Date(); + String stringDate = String.format("%tF % { + private T data; + private int count; + private String msg; + private boolean success = true; + private int code = 0; + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + +} diff --git a/file-common/src/main/java/com/mac/common/util/PasswordUtil.java b/file-common/src/main/java/com/mac/common/util/PasswordUtil.java new file mode 100644 index 0000000..91f2f25 --- /dev/null +++ b/file-common/src/main/java/com/mac/common/util/PasswordUtil.java @@ -0,0 +1,19 @@ +package com.mac.common.util; + +import java.util.Random; + +public class PasswordUtil { + public static String getSaltValue() { + Random r = new Random(); + StringBuilder sb = new StringBuilder(16); + sb.append(r.nextInt(99999999)).append(r.nextInt(99999999)); + int len = sb.length(); + if (len < 16) { + for (int i = 0; i < 16 - len; i++) { + sb.append("0"); + } + } + String salt = sb.toString(); + return salt; + } +} diff --git a/file-web/pom.xml b/file-web/pom.xml index a25124c..44c5213 100644 --- a/file-web/pom.xml +++ b/file-web/pom.xml @@ -91,8 +91,8 @@ 1.3.3 - com.mac - scp-common + com.qiwen + file-common 0.0.1-SNAPSHOT