RESTful 风格 API 接口文档模板

1 接口名称

用户注册接口

2 接口描述

  1. 用户信息注册
  2. 用户可以通过 手机号/邮箱 进行注册
  3. 同一个 手机号/邮箱只能注册一个账号

3 请求地址

{apiAddress}/api/user/signup

4 请求方式

POST

5 请求参数

5.1 Header 参数

参数名 必选 类型/参数值 说明
Content-Type application/json 请求参数类型

5.2 Body 参数

参数名 必选 类型 限制条件 说明 示例值
account string 1 < length < 50 用户账号
passcode string 1 < length < 50 密码
checkCode string length = 6 验证码

注意事项: 密码(passcode) 的加密方式为 xxxxxx

需要调用到的其他接口:

接口名称 接口地址 用途说明
获取验证码 {apiAddress}/api/common/getCheckCode 获取注册所需验证码

5.3 请求示例

{
    
    
"account" : 1001,
"passcode" : 123456,
"checkCode" : 1
}

6 响应参数

6.1 返回参数

参数名 必选 类型 限制条件 说明 示例值
account string 1 < length < 50 用户账号
passcode string 1 < length < 50 密码
checkCode string length = 6 验证码

6.2 返回示例

{
    
    
    "code": 200,  // 状态码
    "msg": "成功",  // 提示信息
    "data": null  // 返回内容
}

7 备注

更多返回错误码请查看首页返回状态码表

8 错误响应码(选用)

错误码 错误描述 原因 解决方案 示例值
SYSTEMERROR 接口返回错误 系统超时 请使用相同 参数再次调用 API。 001

猜你喜欢

转载自blog.csdn.net/fengling_smile/article/details/121195038