提交 1c321ad1 编写于 作者: 又有人误人子弟了's avatar 又有人误人子弟了

docs: highlight code blocks `Java` readme.md

上级 ad3fc5f3
......@@ -5,7 +5,7 @@
JDK 1.8+
## 引用 maven 包
```
```xml
<dependency>
<groupId>com.github.yitter</groupId>
<artifactId>yitter-idgenerator</artifactId>
......@@ -16,7 +16,7 @@ JDK 1.8+
## 调用示例(Java)
第1步,**全局** 初始化(应用程序启动时执行一次):
```
```java
// 创建 IdGeneratorOptions 对象,可在构造函数中输入 WorkerId:
IdGeneratorOptions options = new IdGeneratorOptions(Your_Unique_Worker_Id);
// options.WorkerIdBitLength = 10; // 默认值6,限定 WorkerId 最大值为2^6-1,即默认最多支持64个节点。
......@@ -31,7 +31,7 @@ YitIdHelper.setIdGenerator(options);
```
第2步,生成ID:
```
```java
// 初始化后,在任何需要生成ID的地方,调用以下方法:
long newId = YitIdHelper.nextId();
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册