目录
jmeter脚本演示:阿里云盘分享https://www.aliyundrive.com/s/BnWxhybdW7f
接口文档
jmeter脚本演示:阿里云盘分享https://www.aliyundrive.com/s/BnWxhybdW7f
1.注册接口
1.1.URL/接口地址
http://www.qabujiaban.com/user/regi
ster
1.2 Method/请求方式
POST
1.3 Request headers/请求头
User-Agent (非必填)获取浏览器信息
X-Real-IP (非必填)ip地址
Content-Type:application/json;charset=UTF-8(必填)
1.4 请求参数
名称 |
类型 |
是否必须 |
说明 |
|
username |
String |
True |
长度4~10,不能重复 |
|
password |
String |
True |
长度8~12,必须包含大写字母、小写字母、数字、特殊字符(!@.#) |
|
mobile |
String |
True |
合法手机号格式 |
|
age |
String |
False |
18<= and <=120 |
|
sex |
String |
True |
1/男,2/女 |
|
请求示例:
{
"username":"uuuu222都44",
"password":"WJHasb124*1",
"mobile":"17712350127",
"age":"18",
"sex":"2"
}
1.5 返回值
{
"code": "0000",
"message": "注册成功",
"data": "User [id=660, username=uuuu222都4, password=5f4dcc3b5aa765d61d8327deb882cf99, mobile=17712350127, age=18, sex=1, administration_id=1, ip=192.168.2.3, create_time=Fri Dec 17 16:56:29 CST 2021]"
}
{
"code": "0001",
"message": "注册失败,用户名长度4~10,不能重复,请检查后重新输入",
"data": "User [id=0, username=uuuu222都3, password=WJHasb124*, mobile=17712350127, age=18, sex=1, administration_id=1, ip=192.168.2.3, create_time=Fri Dec 17 16:55:14 CST 2021]"
}
{
"code": "0002",
"message": "注册失败,密码长度8~12,必须包含大写字母、小写字母、数字、特殊字符(!@.#),请检查后重新输入",
"data": "User [id=0, username=uuuu222都4, password=WJHasb124*111111111111, mobile=17712350127, age=18, sex=1, administration_id=1, ip=192.168.2.3, create_time=Fri Dec 17 16:55:40 CST 2021]"
}
{
"code": "0003",
"message": "注册失败,输入手机号格式非法,请检查后重新输入",
"data": "User [id=0, username=uuuu222都4, password=5f4dcc3b5aa765d61d8327deb882cf99, mobile=177123501271, age=18, sex=1, administration_id=1, ip=192.168.2.3, create_time=Fri Dec 17 16:56:11 CST 2021]"
}
{
"code": "0004",
"message": "注册失败,输入性别非法,请检查后重新输入",
"data": "User [id=0, username=2,2,2, password=5f4dcc3b5aa765d61d8327deb882cf99, mobile=17701784339, age=18, sex=null, administration_id=1, ip=192.168.2.3, create_time=Fri Dec 17 18:21:07 CST 2021]"
}
2.登陆接口
2.1 URL/接口地址
服务地址[W5] /user/login
2.2 Method/请求方式
POST
2.3 Request headers/请求头
User-Agent (非必填)获取浏览器信息
X-Real-IP (非必填)ip地址
Content-Type:application/json;charset=UTF-8(必填)
2.4 请求参数
名称 |
类型 |
是否必须 |
说明 |
username |
String |
True |
|
password |
String |
True |
请求示例:
{
"username":"wwww",
"password":"WJHabc123*2"
}
2.5 返回值
{
"code": "0000",
"message": "登陆成功",
"login_time": "2021-53-20 06:12:14",
"create_time": "2021-43-20 06:12:33"
}
{
"code": "0001",
"message": "登陆失败,用户名不存在"
}
{
"code": "0002",
"message": "登陆失败,密码错误"
}
3.查询接口
3.1 URL/接口地址
服务地址[W9] /user/query
3.2 Method/请求方式
GET
3.3 Request headers/请求头
User-Agent (非必填)获取浏览器信息
X-Real-IP (非必填)ip地址
Content-Type:application/json;charset=UTF-8(必填)
3.4 请求参数
名称 |
类型 |
是否必须 |
说明 |
请求示例:
{}
3.5 返回值
{
"code": "0000",
"message": "SUCCESS",
"Set-Cookie": "222423EABE0FEE61DAA14B2EF7E7B404"
}
{
"code": "0001",
"message": "cookie过期请重新登录",
"Set-Cookie": "222423EABE0FEE61DAA14B2EF7E7B404"
}
3.删除接口
3.1 URL/接口地址
服务地址[W13] /user/delete
3.2 Method/请求方式
POST
3.3 Request headers/请求头
User-Agent (非必填)获取浏览器信息
X-Real-IP (非必填)ip地址
Set-Cookie (必填,登陆成功响应头中获取)
Content-Type:application/json;charset=UTF-8(必填)
3.4 请求参数
名称 |
类型 |
是否必须 |
说明 |
username |
String |
True |
|
请求示例:
{
"username":"ddd222114"
}
3.5 返回值
{
"code": "0000",
"message": "SUCCESS",
"Set-Cookie": "ddd222114,454ef26d45475354253ab38003282d3b"
}
{
"code": "0001",
"message": "cookie无效",
"Set-Cookie": "cookie无效"
}
{
"code": "0002",
"message": "用户与操作用户不匹配",
"Set-Cookie": "javax.servlet.http.Cookie@2f67348b",
"deleteuser": "ddd222112"
}