Skip to content

Commit

Permalink
v3.1.1 新增方法
Browse files Browse the repository at this point in the history
  • Loading branch information
ALI1416 committed Dec 26, 2023
1 parent b72ead9 commit 248bae6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## v3.1.1 `2023.12.26`

- 新增方法

## v3.1.0 `2023.12.23`

- 新增方法
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>cn.404z</groupId>
<artifactId>id</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>id</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>

<parent>
<groupId>cn.404z</groupId>
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/cn/z/id/Id.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,19 @@ public static long format(long machineId, long machineBits, long sequenceBits, l
| sequence; // 序列号
}

/**
* 根据配置参数构造id
*
* @param machineId 机器码
* @param timestamp 时间戳
* @param sequence 序列号
* @return id
* @since 3.1.1
*/
public static long format(long machineId, long timestamp, long sequence) {
return format(machineId, MACHINE_BITS, SEQUENCE_BITS, timestamp, sequence);
}

/**
* 根据配置参数构造id
*
Expand Down

0 comments on commit 248bae6

Please sign in to comment.