接口文档

2019-03-04  本文已影响0人  lovinglili

小易

1.约定

1.1 请求数据成功返回

{
     "data":{} || [] || '',
     "success":true
}

1.2 请求数据失败返回

{
       "message":"提示词",
       "success":false
 }

1.3 登录

登录成功后,后端会返回登录成功的标志,当再其他设备上再次登录的时候,若标志已显示登录,那就不允许此次登录。

1.4 status = 0 代表商品没有卖出/未下架,为1 代表已经卖出;

2.首页

2.1 商品分类

请求方法:get
请求路径:/xiaoyi/homePage/categoryPage
返回结果:
    {
           'data': [
 {
categoryTitle: "手机数码",
categoryId: 111,
list: [
  { id: "1", name: "蓝牙耳机" },
  { id: "2", name: "数据线" },
  { id: "3", name: "手环" },
  { id: "4", name: "相机" },
  { id: "5", name: "其他手机数码" }
    ],
   },
 {
categoryTitle: "服饰",
list: [
  { id: "6", name: "半身裙" },
  { id: "7", name: "牛仔裤" },
  { id: "8", name: "衬衫" },
  { id: "9", name: "外套" },
  { id: "10", name: "其他服饰" }
],
categoryId: 222
 },
{
categoryTitle: "美妆",
list: [
  { id: "11", name: "洁面用品" },
  { id: "12", name: "防晒" },
  { id: "13", name: "粉底液" },
  { id: "14", name: "香水" },
  { id: "15", name: "其他美妆" }
],
categoryId: 333
}
 ]
 }

2.2 商品详情

请求方法:get
请求路径:/xiaoyi/detail
请求参数:goodId
返回结果:
   {
          "data":{
                  "desc": "冰柜60L-经典白  买来放母乳的一起送了",
                   "goodId":7895,
                    "cityId": 2830,
                    "cityName": "浦东新区",
                     "title": "惠乳冷冻柜办公室小冰箱BD-40/60/106L 冰柜60L-经典白",
                     "status":"0",
                     "price": "1100",
                     "pics": ["img","img"],
                    "position": "上海 浦东新区",
                    "provinceId": "2",
                    "provinceName": "上海",
                      "categoryId":222,
                   "categoryTitle":"服饰","id":2,// id是某一类的id,
                    "name":"数据线",
               }
    }

3.获取某一类别的数据,返回所有数据

请求方法:get
请求路径:/xiaoyi/goodsList
返回结果:
      {
             "data":{
                    "list":[
                         { "title":"华为手机","desc":"全新","nickname": "微微一笑很倾城123","price": "99.00","status":0, "originalPrice": "1999.00",goodId:12,"pics": ["img","img"],"categoryId":222,
          "categoryTitle":"服饰","id":2,// id是某一类的id,
                    "name":"数据线"},
                      ]
              }
       }

4.发布二手

请求方法:post
请求路径:/xiaoyi/publish
请求参数: // 发布之后的状态是未下架/未卖出,所以后端应加个状态:status:0
    {
          "title":"电脑",
           "desc":"全新",
            "nickName":"asd",
           "pics":["img",],
           "privanceId":12,
            "privanceName":"北京",
           "cityId":12,
            "cityName":"密云区" ,
            "price": "99.00",
            "originalPrice": "1999.00",
            "postage":"12",
             "categoryId":222,
              "categoryTitle":"服饰",
          "id":2,// id是某一类的id,
                    "name":"数据线"
    }

5.某人已发布的列表

请求方法:get
请求路径:/xiaoyi/publishList
请求参数:nickName
返回结果:
    {
      list:[{
          "title":"电脑",
           "desc":"全新",
            time:'xxx',
           "pics":["img",],
           "privanceId":12,
            "privanceName":"北京",
           "cityId":12,
            "cityName":"密云区" ,
            "price": "99.00",
            "originalPrice": "1999.00",
            "postage":"12",
             "categoryId":222,
              "categoryTitle":"服饰",
             "id":2,// id是某一类的id,
                    "name":"数据线",
               "status":0
          },]
    }

6.删除某个发布

请求方法:post
请求路径:/xiaoyi/delete
请求参数:goodId
返回结果:如约定;

7.地区

请求方法:get
请求路径:/xiaoyi/cities
返回结果:
  {
     "data":{
           "list":[{
            "id": 1,
           "name": "北京",
            "children":[
                   {"id": 2816, "name": "密云区"}, ]
            }, ]
     }
  }

8.注册

请求方法:post
请求路径:/xiaoyi/add
请求参数:
 {
      "nickName":"dsf",
       "phoneNumber":4567645,
       "pasword":"asdads",
 }
.返回结果:
 {
      "data":{
              "isAssign":true,
       }
 }

9.登录

请求方法:post,
请求路径:/xiaoyi/assign
请求参数:
  {
        "nickName":"asd", // "phoneNumber":456456
        "password":"dsasa"
   }
返回结果:
 {
      "data":{
              "isAssign":true,// 退出的时候置为false;
       }
 }

10. 增加收货地址

请求方法:post,
请求路径:/xiaoyi/address
请求参数:
  {
         
          "privanceId":12,
            "privanceName":"北京",
           "cityId":12,
            "cityName":"密云区" ,
             "more":"xx街道xx小区"
   }
返回结果:如约定;

11.获取收获地址列表

请求方法:get,
请求路径:/xiaoyi/addressList
请求参数: nickName='xxx"
返回结果:
 {
   data:[
   {
     "privanceId":12,
     "privanceName":"北京",
       "cityId":12,
       "cityName":"密云区",
     "more":"xx街道xx小区
    addressId:123
       },
  ]}

12.提交订单

请求方法:post,
请求路径:/xiaoyi/addOrder
请求参数:
 {
    data:{
          nickName:'xxx',
        " addressId":123,
          goodId:'所要购买的商品的id',
   }
 }

13.获取订单列表

请求方法:get
请求路径:/xiaoyi/orderList
请求参数:nickName ="xxx"
返回结果:
{
       data:{
                orderId:123,
               addressId:123
                time:'xxx',
                goodId:12, // 购买商品的ID
        }
}

14.商品状态的改变

请求方法:get
请求路径:/xiaoyi/changeStatus
请求参数:goodId=12,status=1/0;
返回结果:如约定;

15.退出登录

请求方法:get
请求路径:/xiaoyi/quit
返回结果:如约定;

16.判断nickName是否重复

请求方法:get
请求路径:/xiaoyi/isExit
返回结果:
                {
                        data:{
                                "isExit":true/false
                              }
                 }
上一篇下一篇

猜你喜欢

热点阅读