bug
zhangzeli
2022-01-18 90d61b2122cfc96779bb658ca6f28e86540de128
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cn.exrick.xboot.core.common.utils;
 
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
 
/**
 * @author Exrickx
 */
@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();
    }
}