地址管理

Version  next Preview

地址管理

收货地址管理接口

  1. 添加地址接口
  2. 更新地址接口
  3. 删除地址接口
  4. 获取地址信息
  5. 获取地址列表(Deprecated)

apis

1. 添加地址接口

author: alovn

POST /user/address/create

Request:

parameterparameterTypedataTyperequiredvalidateexampledescription
addressformstringtruerequired地址
city_idformint64truerequired城市ID

body:

{  //object(handler.CreateAddressRequest), 添加地址请求参数
  "address": "string",  //string, validate:"required", 地址
  "city_id": 0  //int64, validate:"required", 城市ID
}

Response:

//StatusCode: 200 
{  //object(common.Response), 通用返回结果
  "code": 0,  //int, 返回状态码
  "msg": "success"  //string, 返回消息
}

2. 更新地址接口

author: alovn

POST /user/address/update

Request:

parameterparameterTypedataTyperequiredvalidateexampledescription
addressformstringtruerequired地址
idformint64truerequired地址ID

Response:

//StatusCode: 200 
{  //object(common.Response), 通用返回结果
  "code": 0,  //int, 返回状态码
  "msg": "success"  //string, 返回消息
}

3. 删除地址接口

author: alovn

POST /user/address/delete

Request:

parameterparameterTypedataTyperequiredvalidateexampledescription
idformint64truerequired地址ID

Response:

//StatusCode: 200 
{  //object(common.Response), 通用返回结果
  "code": 0,  //int, 返回状态码
  "msg": "success"  //string, 返回消息
}

4. 获取地址信息

author: alovn

GET /user/address/get/:id

Request:

parameterparameterTypedataTyperequiredvalidateexampledescription
idparamint64false地址ID

Response:

//StatusCode: 200 
{  //object(common.Response), 通用返回结果
  "code": 0,  //int, 返回状态码
  "data": {  //object(handler.AddressResponse), 返回地址信息
    "address": "string",  //string, 地址信息
    "city_id": 0,  //int64, 城市ID
    "id": 0  //int64, 地址ID
  },
  "msg": "success"  //string, 返回消息
}

5. 获取地址列表

Deprecated

获取收货地址列表

author: alovn

GET /user/address/list

Response:

//StatusCode: 200 
{  //object(common.Response), 通用返回结果
  "code": 0,  //int, 返回状态码
  "data": [  //array[handler.AddressResponse]
    {  //object(handler.AddressResponse), 返回地址信息
      "address": "string",  //string, 地址信息
      "city_id": 0,  //int64, 城市ID
      "id": 0  //int64, 地址ID
    }
  ],
  "msg": "success"  //string, 返回消息
}

Generated by apidocgen