Skip to content

Latest commit

 

History

History
301 lines (220 loc) · 5.91 KB

AllInOne-V202001091931.md

File metadata and controls

301 lines (220 loc) · 5.91 KB
Version Update Time Status Author Description
V1.0 2020/01/09 create deng test

用户基本信息操作API

获取所有用户

URL: http://localhost:8080/user/getAllUser

Type: GET

Author: dengzhiming

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 测试获取所有用户的GET接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-example:

http://localhost:8080/user/getAllUser

Response-fields:

Field Type Description Since
id int32 用户id -
name string 用户名 -
age int32 年龄 -
sex string 性别 -
address string 家庭住址 -

Response-example:

[
	{
		"id":394,
		"name":"楷瑞.梁",
		"age":12,
		"sex":"bxnl9i",
		"address":"冯路90067号, 泰州, 黔 018986"
	}
]

根据id获取用户

URL: http://localhost:8080/user/getUserById

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 测试根据用户id获取用户信息的GET接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-parameters:

Parameter Type Description Required Since
id int64 用户id true -

Request-example:

curl -X GET -i 'http://localhost:8080/user/getUserById?id=187'

Response-fields:

Field Type Description Since
id int32 用户id -
name string 用户名 -
age int32 年龄 -
sex string 性别 -
address string 家庭住址 -

Response-example:

{
	"id":293,
	"name":"楷瑞.梁",
	"age":12,
	"sex":"wgja9p",
	"address":"冯路90067号, 泰州, 黔 018986"
}

根据姓名和性别获取用户信息

URL: http://localhost:8080/user/getUserByNameAndSex

Type: POST

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 测试根据name和sex获取用户的POST接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-parameters:

Parameter Type Description Required Since
userName string 用户名 true -
userSex string 用户性别 true -

Request-example:

curl -X POST -i http://localhost:8080/user/getUserByNameAndSex --data 'userName=楷瑞.梁&userSex=ekuc3a'

Response-fields:

Field Type Description Since
id int32 用户id -
name string 用户名 -
age int32 年龄 -
sex string 性别 -
address string 家庭住址 -

Response-example:

{
	"id":156,
	"name":"楷瑞.梁",
	"age":12,
	"sex":"0ir4tk",
	"address":"冯路90067号, 泰州, 黔 018986"
}

新增用户

URL: http://localhost:8080/user/insertUser

Type: POST

Content-Type: application/json; charset=utf-8

Description: 传入JSON字符串进行新增用户的POST接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-parameters:

Parameter Type Description Required Since
body string 包含用户信息的JSON字符串 true

Request-example:

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://localhost:8080/user/insertUser --data '{
	"body":"i9l1nq"
}
'

Response-fields:

Field Type Description Since
success boolean 是否成功 -
message string 错误提示(成功succeed) -
data object 成功返回的数据 -
└─any object object any object. -
code string 错误代码 -
timestamp string 响应时间 -

Response-example:

{
	"success":true,
	"message":"success",
	"data":{
		
	},
	"code":"86148",
	"timestamp":"2020-01-09 19:31:16"
}

修改用户

URL: http://localhost:8080/user/updateUser

Type: POST

Content-Type: application/json; charset=utf-8

Description: 传入JSON字符串进行修改用户的POST接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-parameters:

Parameter Type Description Required Since
body string 包含用户信息的JSON字符串 true

Request-example:

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -i http://localhost:8080/user/updateUser --data '{
	"body":"zzlm08"
}
'

Response-fields:

Field Type Description Since
No field string The api directly returns the string type value. -

Response-example:

vaa7de

删除用户

URL: http://localhost:8080/user/deleteUser

Type: POST

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 根据用户id进行删除用户的POST接口

Request-headers:

Header Type Description Required Since
access_token string Basic auth credentials(Global) true v1.0.0
user_uuid string User Uuid key(Global) false -

Request-parameters:

Parameter Type Description Required Since
id int64 用户id true -

Request-example:

curl -X POST -i http://localhost:8080/user/deleteUser --data 'id=444'

Response-fields:

Field Type Description Since
No field string The api directly returns the string type value. -

Response-example:

mqchcc

错误码列表

Error code Description
200 ok
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
415 Unsupported Media Type
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable