forked from baomidou/mybatis-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修改默认Id生成器类名,过时GlobalConfig中workerId,datacenterId属性.
- Loading branch information
1 parent
f0d9ac8
commit 606c5f0
Showing
6 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,21 @@ | |
import com.baomidou.mybatisplus.core.toolkit.Sequence; | ||
|
||
/** | ||
* 默认 主键 生成器 | ||
* 雪花算法ID生成器 | ||
* | ||
* @author [email protected] | ||
* @date 2019/10/15 | ||
*/ | ||
public class DefaultIdGenerator implements IdGenerator { | ||
public class SnowflakeIdGenerator implements IdGenerator { | ||
|
||
private Sequence sequence; | ||
private final Sequence sequence; | ||
|
||
public DefaultIdGenerator() { | ||
sequence = new Sequence(); | ||
public SnowflakeIdGenerator() { | ||
this.sequence = new Sequence(); | ||
} | ||
|
||
public DefaultIdGenerator(long workerId, long dataCenterId) { | ||
sequence = new Sequence(workerId, dataCenterId); | ||
public SnowflakeIdGenerator(long workerId, long dataCenterId) { | ||
this.sequence = new Sequence(workerId, dataCenterId); | ||
} | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters