GET 查询全部用户GET /api/user/list接口名称查询全部用户接口描述查询所有用户信息列表返回用户数组返回示例200 Response{code:1,msg:success,data:[{id:1,username:admin,phone:13800000000,role:1,createTime:2026-06-07 16:01:12},{id:2,username:111,phone:222,role:0,createTime:2026-06-07 21:42:39}]}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构DELETE 根据ID删除用户DELETE /api/user/delete/{id}请求参数名称位置类型必选说明idpathinteger是none返回示例200 Response{code:1,msg:删除成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构GET 查询单个用户GET /api/user/{id}根据用户ID查询指定用户信息请求参数名称位置类型必选说明idpathinteger是用户ID返回示例200 Response{code:1,msg:success,data:{id:1,username:admin,phone:13800000000,role:1,createTime:2026-06-07 16:01:12}}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构POST 新增用户POST /api/user添加新用户Body 请求参数{username:newuser,password:123456,phone:13900000000}请求参数名称位置类型必选说明bodybodyobject是none返回示例200 Response{code:1,msg:添加成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构PUT 修改用户PUT /api/user修改用户信息Body 请求参数{id:1,username:admin_new,phone:13800000001,role:1}请求参数名称位置类型必选说明bodybodyobject是none返回示例200 Response{code:1,msg:修改成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构数据模型User{id:0,username:string,phone:string,role:0,createTime:string}属性名称类型必选约束中文名说明idintegertruenone用户IDusernamestringtruenone用户名phonestringtruenone手机号roleintegerfalsenone0普通/1管理createTimestringfalsenone注册时间效果展示
web应用技术-第九次课后作业
发布时间:2026/6/29 20:18:31
GET 查询全部用户GET /api/user/list接口名称查询全部用户接口描述查询所有用户信息列表返回用户数组返回示例200 Response{code:1,msg:success,data:[{id:1,username:admin,phone:13800000000,role:1,createTime:2026-06-07 16:01:12},{id:2,username:111,phone:222,role:0,createTime:2026-06-07 21:42:39}]}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构DELETE 根据ID删除用户DELETE /api/user/delete/{id}请求参数名称位置类型必选说明idpathinteger是none返回示例200 Response{code:1,msg:删除成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构GET 查询单个用户GET /api/user/{id}根据用户ID查询指定用户信息请求参数名称位置类型必选说明idpathinteger是用户ID返回示例200 Response{code:1,msg:success,data:{id:1,username:admin,phone:13800000000,role:1,createTime:2026-06-07 16:01:12}}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构POST 新增用户POST /api/user添加新用户Body 请求参数{username:newuser,password:123456,phone:13900000000}请求参数名称位置类型必选说明bodybodyobject是none返回示例200 Response{code:1,msg:添加成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构PUT 修改用户PUT /api/user修改用户信息Body 请求参数{id:1,username:admin_new,phone:13800000001,role:1}请求参数名称位置类型必选说明bodybodyobject是none返回示例200 Response{code:1,msg:修改成功,data:null}返回结果状态码状态码含义说明数据模型200OKnoneInline返回数据结构数据模型User{id:0,username:string,phone:string,role:0,createTime:string}属性名称类型必选约束中文名说明idintegertruenone用户IDusernamestringtruenone用户名phonestringtruenone手机号roleintegerfalsenone0普通/1管理createTimestringfalsenone注册时间效果展示