CommonUtil.java
829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cn.csbr.app.util;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.Base64Utils;
import org.springframework.util.DigestUtils;
import java.sql.Timestamp;
import java.util.UUID;
/**
* @program: api
* @description: some util
* @author: Huanglh
* @create: 2019-04-29 16:09
**/
@Component
public class CommonUtil {
/**
* 生成GUID
*
* @return
*/
public static String getGuid() {
return UUID.randomUUID().toString().replace("-", "");
}
/**
* 获取当前时间的时间戳
*
* @return
*/
public static Timestamp nowTs() {
Timestamp result = new Timestamp(System.currentTimeMillis());
return result;
}
}