张天森
2022-12-08 79e0d3094c1fcf9025938479b6e46d2e9dfebdb6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.dg.core.util;
 
 
import cn.hutool.core.util.IdUtil;
 
/**
 * 雪花id获取工具类
 * @author lyq
 * @date 2022-03-04
 */
public class Snowflake {
    public static long getId() {
        cn.hutool.core.lang.Snowflake snowflake = IdUtil.getSnowflake(1, 1);
        long id = snowflake.nextId();
        return id;
    }
}