代码拉取完成,页面将自动刷新
We are using these awesome projects as necessary libraries.
You can install this service in the following three ways.
Note: You need to create the database and modify the configuration of the database in the configuration file before starting.
go get:
go get github.com/qichengzx/seqsvr
seqsvr
Compile By Yourself:
git clone git@github.com:qichengzx/seqsvr.git
cd seqsvr
go build .
./seqsvr
Docker:
The Docker "multi-stage" build feature is used, be ensure the Docker version is 17.05 or above. See:Use multi-stage builds
git clone git@github.com:qichengzx/seqsvr.git
cd seqsvr
docker build seqsvr:latest .
docker run -p 8000:8000 seqsvr:latest
The database name can be customized, modify config.yml.
Then import the following SQL to generate the data table.
CREATE TABLE `generator_table` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uuid` char(36) NOT NULL COMMENT 'Machine identification',
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `stub_UNIQUE` (`uuid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
The configuration file is using YAML.
#app
port: ':8000'
#service
step: 100
#db
mysql:
user: 'root'
password: ''
host: 'tcp(localhost:3306)'
database: 'sequence'
maxidle: 2
maxopen: 10
curl http://localhost:8000/new
{"code":0,"msg":"ok","data":{"id":101}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。