用户列表

这是一行说明

作者: yedaxia

请求URL

/api/user/list GET POST

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
page int 页数
limit int 每页条数
sort string 排序
status int 用户状态
name string 用户名

返回结果

{
	"body":{
		"total":"int //总记录数",
		"pageCount":"int //页数",
		"currentPage":"int //当前页",
		"pageSize":"int //每页记录数",
		"list":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}",
			"friends":[{
				"userId":"string //用户id",
				"userName":"string //用户名",
				"friend":"SimpleUser{}"
			}],
			"readBooks":[{
				"bookId":"long //图书id",
				"bookName":"string //图书名称",
				"price":{
					"price":"double //价格",
					"country":"int //国家"
				}
			}],
			"isFollow":"boolean //是否关注",
			"follower":"UserVO[]"
		}],
		"hasMore":"boolean //是否还有更多"
	},
	"code":"int",
	"errMsg":"string",
	"data":{
		"total":"int //总记录数",
		"pageCount":"int //页数",
		"currentPage":"int //当前页",
		"pageSize":"int //每页记录数",
		"list":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}",
			"friends":[{
				"userId":"string //用户id",
				"userName":"string //用户名",
				"friend":"SimpleUser{}"
			}],
			"readBooks":[{
				"bookId":"long //图书id",
				"bookName":"string //图书名称",
				"price":{
					"price":"double //价格",
					"country":"int //国家"
				}
			}],
			"isFollow":"boolean //是否关注",
			"follower":"UserVO[]"
		}],
		"hasMore":"boolean //是否还有更多"
	},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

用户信息

作者: 周杰伦

请求URL

/api/user/user-info/{userId} GET

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
userId long 用户id

请求体 application/json

{
	"id":"long //用户ID",
	"name":"string //用户名【必须】",
	"phone":"long //电话【必须】",
	"avatar":"string //头像【必须】",
	"gender":"byte //性别"
}

返回结果

{
	"body":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"code":"int",
	"errMsg":"string",
	"data":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

保存用户

作者: yeguozhong

请求URL

/api/user/save POST

请求体 application/json

{
	"id":"long //用户ID",
	"name":"string //用户名【必须】",
	"phone":"long //电话【必须】",
	"avatar":"string //头像【必须】",
	"gender":"byte //性别"
}

返回结果

{
	"body":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"code":"int",
	"errMsg":"string",
	"data":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

上传头像

作者: yeguozhong

请求URL

/api/user/upload-avatar POST

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
avatar file

返回结果

{
	"body":{},
	"code":"int",
	"errMsg":"string",
	"data":{},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

修改用户信息

作者: yeguozhong

请求URL

/api/user/modify POST

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
id long 用户ID
name string 用户名
phone long 电话
avatar string 头像
gender byte 性别

返回结果

{
	"body":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"code":"int",
	"errMsg":"string",
	"data":{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

删除用户

作者: yeguozhong

请求URL

/api/user/delete POST

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
userId long 用户ID

返回结果

{
	"body":{},
	"code":"int",
	"errMsg":"string",
	"data":{},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

获取图片

作者: yeguozhong

请求URL

/api/user/get-image GET

返回结果

{}

用户列表2

作者: yeguozhong

请求URL

/api/user/list2 GET

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
userId long 用户ID

请求体 application/json

{
	"id":"long //用户ID",
	"name":"string //用户名【必须】",
	"phone":"long //电话【必须】",
	"avatar":"string //头像【必须】",
	"gender":"byte //性别"
}

返回结果

{
	"body":[{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	}],
	"code":"int",
	"errMsg":"string",
	"data":[{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}",
		"friends":[{
			"userId":"string //用户id",
			"userName":"string //用户名",
			"friend":"SimpleUser{}"
		}],
		"readBooks":[{
			"bookId":"long //图书id",
			"bookName":"string //图书名称",
			"price":{
				"price":"double //价格",
				"country":"int //国家"
			}
		}],
		"isFollow":"boolean //是否关注",
		"follower":"UserVO[]"
	}],
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

用户列表3

作者: yeguozhong

请求URL

/api/user/list3 GET

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
page int 页数
limit int 每页条数
sort string 排序

返回结果

[{
	"userId":"string //用户id",
	"userName":"string //用户名",
	"friend":"SimpleUser{}",
	"friends":[{
		"userId":"string //用户id",
		"userName":"string //用户名",
		"friend":"SimpleUser{}"
	}],
	"readBooks":[{
		"bookId":"long //图书id",
		"bookName":"string //图书名称",
		"price":{
			"price":"double //价格",
			"country":"int //国家"
		}
	}],
	"isFollow":"boolean //是否关注",
	"follower":"UserVO[]"
}]

List测试

作者: yeguozhong

请求URL

/api/user/list-by-ids GET

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
ids long[] 用户id

返回结果

{
	"body":{},
	"code":"int",
	"errMsg":"string",
	"data":{},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

枚举参数测试

作者: yeguozhong

请求URL

/api/user/getByUserType GET

请求参数 application/x-www-form-urlencoded

参数名 类型 必须 描述
userType enum

返回结果

{
	"body":{},
	"code":"int",
	"errMsg":"string",
	"data":{},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}

字符串结果

作者: yeguozhong

请求URL

/api/user/custom-json GET

返回结果

{
	"code":0,
	"data":"success"
}

泛型参数

作者: yeguozhong

请求URL

/api/user/generic-form GET

请求体 application/json

{
	"form":{
		"id":"long //用户ID",
		"name":"string //用户名【必须】",
		"phone":"long //电话【必须】",
		"avatar":"string //头像【必须】",
		"gender":"byte //性别"
	}
}

返回结果

{
	"body":{},
	"code":"int",
	"errMsg":"string",
	"data":{},
	"errType":"enum // [SUCCESS,WARN,ERROR]"
}