mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-18 19:16:37 +08:00
commit:同步1.3版本
This commit is contained in:
@@ -13,7 +13,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
*/
|
||||
public class BasicIdGenerator implements MyIdGenerator {
|
||||
|
||||
private Snowflake snowflake;
|
||||
private final Snowflake snowflake;
|
||||
|
||||
/**
|
||||
* 构造函数。
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SnowflakeIdGenerator implements MyIdGenerator {
|
||||
private static final long SEQUENCE_BITS = 12L;
|
||||
private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
|
||||
private static final long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
|
||||
private long workerId;
|
||||
private final long workerId;
|
||||
private long sequence = 0L;
|
||||
private long lastTimestamp = -1L;
|
||||
private static final Random RANDOM = RandomUtil.getRandom();
|
||||
|
||||
Reference in New Issue
Block a user