xuefei
2020-12-10 eeeb7233935ea9b10e99043bdbf740ef86c9bf20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cn.cetc54.platform.core.common.utils;
 
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
 
/**
 * @author
 */
@Slf4j
public class SnowFlakeUtil {
 
    /**
     * 派号器workid:0~31
     * 机房datacenterid:0~31
     */
    private static Snowflake snowflake = IdUtil.createSnowflake(1, 1);
 
    public static Long nextId() {
        return snowflake.nextId();
    }
}