Sign inSign up

dreamplay/hello_snowflake

By dreamplay

•Updated over 3 years ago

高性能雪花ID生成服务

Image
API management
0

224

dreamplay/hello_snowflake repository overview

⁠hello_snowflake

⁠介绍

高性能雪花ID生成服务

⁠配置

新建docker-compose.yml配置文件,内容如下:

version: "3"
services:
  hello_snowflake:
    image: dreamplay/hello_snowflake
    restart: always
    ports:
      - 8080:8080
⁠安装
docker-compose up -d
⁠使用

接口: http://ip:8080/create⁠

方法:GET

请求参数:

字段是否必填类型描述
worker_id否int机器ID,取值范围0-1023,默认0

返回示例:

{
  "code": 200, //200-成功,其他-错误,查看错误信息message
  "data": {
    "id": 652956844595085312, //雪花ID
    "worker_id": 0  //机器ID
  },
  "message": "创建成功"
}

Tag summary

Content type

Image

Digest

sha256:30589ed61…

Size

191.1 MB

Last updated

over 3 years ago

docker pull dreamplay/hello_snowflake