Skip to content

Commit

Permalink
feat(doc): update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Jan 2, 2024
1 parent e13694d commit 7830aa3
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
87 changes: 86 additions & 1 deletion documentation/docs/guide/extensions/cosid-spring-boot-starter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,89 @@ _Spring-Boot-Starter_ 模块 集成了所有 _CosId_ 扩展,提供了自动装
</dependency>
</dependencies>
```
:::
:::

## Actuate

CosId-Spring-Boot-Starter 模块提供了 actuator 支持,可以通过 actuator 端点查看 CosId 的状态。

![CosId actuator](../../public/assets/spring-boot-starter/swagger-ui.png)

### CosIdEndpoint

用于查看所有定义的 Id 生成器状态信息。

:::code-group
```shell [curl]
curl -X GET "http://localhost:8080/actuator/cosid" -H "accept: */*"
```
```json [响应内容]
{
"cosid": {
"kind": "ClockSyncCosIdGenerator",
"actual": {
"kind": "Radix62CosIdGenerator",
"machineId": 252,
"lastTimestamp": 1704183358593,
"converter": {
"kind": "RadixCosIdStateParser",
"actual": null
}
},
"converter": {
"kind": "RadixCosIdStateParser",
"actual": null
}
},
"user": {
"kind": "StringSegmentId",
"actual": {
"kind": "SegmentChainId",
"fetchTime": 1703401907,
"maxId": 91658,
"offset": 91638,
"sequence": 91638,
"step": 20,
"isExpired": false,
"isOverflow": false,
"isAvailable": true,
"converter": {
"kind": "Radix62IdConverter",
"radix": 62,
"charSize": 11,
"padStart": true,
"maxId": 9223372036854776000
}
},
"converter": {
"kind": "Radix62IdConverter",
"radix": 62,
"charSize": 6,
"padStart": true,
"maxId": 56800235584
}
}
}
```
:::

### CosIdGeneratorEndpoint

提供了生成 `long` 类型 ID 的 API 接口。

### CosIdStringGeneratorEndpoint

提供了生成 `string` 类型 ID 的 API 接口。

### 配置

```yaml {6-8}
management:
endpoints:
web:
exposure:
include:
- cosid
- cosidGenerator
- cosidStringGenerator
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7830aa3

Please sign in to comment.