user-getter接口文档
概述
系统分为账号管理与账号池管理,通过账号管理接口来进行账号的添加、删除、获取等操作,通过账号池管理接口来进行初始化、出队、入队等操作。
账号管理
添加账号
POST http://10.9.11.167:8081/users
request
参数名 |
类型 |
必填/选填 |
name |
String |
必填 |
password |
String |
必填 |
response
成功
HTTP/1.1 201
{
"id" : 4,
"name" : "testuser3" ,
"password" : "test-user-password"
}
|
查找账号
GET http://10.9.11.167:8081/users/{uid}
request
参数名 |
类型 |
必填/选填 |
uid |
String |
必填 |
response
成功
HTTP/1.1 200
{
"id" : 4,
"name" : "testuser3" ,
"password" : "test-user-password"
}
|
失败
HTTP/1.1 404
通过用户名查找账号
GET http://10.9.11.167:8081/users/findByName/{name}
request
参数名 |
类型 |
必填/选填 |
name |
String |
必填 |
response
成功
HTTP/1.1 200
{
"id" : 4,
"name" : "testuser3" ,
"password" : "test-user-password"
}
|
失败
HTTP/1.1 404
删除账号
DELETE http://10.9.11.167:8081/users/{uid}
request
参数名 |
类型 |
必填/选填 |
uid |
String |
必填 |
response
成功
HTTP/1.1 200
{
"id" : 4,
"name" : "testuser3" ,
"password" : "test-user-password"
}
|
失败
HTTP/1.1 404
获取账号列表
GET http://10.9.11.167:8081/users
response
HTTP/1.1 200
成功
[
{
"id" : 7,
"name" : "testuser5" ,
"password" : "test-user-password"
},
{
"id" : 6,
"name" : "testuser4" ,
"password" : "test-user-password"
},
{
"id" : 5,
"name" : "testuser2" ,
"password" : "test-user-password"
}
]
|
账号池管理
账号池初始化
GET http://10.9.11.167:8081/userPool/init
response
HTTP/1.1 200
成功
[
{
"id" : 7,
"name" : "testuser5" ,
"password" : "test-user-password"
},
{
"id" : 6,
"name" : "testuser4" ,
"password" : "test-user-password"
},
{
"id" : 5,
"name" : "testuser2" ,
"password" : "test-user-password"
}
]
|
账号池出队
GET http://10.9.11.167:8081/userPool/pop
response
成功
HTTP/1.1 200
{
"id" : 4,
"name" : "testuser3" ,
"password" : "test-user-password"
}
|
失败
HTTP/1.1 404
账号池入队
GET http://10.9.11.167:8081/userPool/push
request
参数名 |
类型 |
必填/选填 |
name |
String |
必填 |
成功
HTTP/1.1 200
true
|
失败
HTTP/1.1 200
false
|