接口文档2

API

商品列表

GET /sell/buyer/product/list

参数

返回

{
    "code": 0,
    "msg": "成功",
    "data": [
        {
            "name": "热榜",
            "type": 1,
            "foods": [
                {
                    "id": "123456",
                    "name": "皮蛋粥",
                    "price": 1.2,
                    "description": "好吃的皮蛋粥",
                    "icon": "http://xxx.com",
                }
            ]
        },
        {
            "name": "好吃的",
            "type": 2,
            "foods": [
                {
                    "id": "123457",
                    "name": "慕斯蛋糕",
                    "price": 10.9,
                    "description": "美味爽口",
                    "icon": "http://xxx.com",
                }
            ]
        }
    ]
}

创建订单

POST /sell/buyer/order/create

参数

name: "张三"
phone: "18868822111"
address: "蓝鸥"
openid: "ew3euwhd7sjw9diwkq" //用户的微信openid
items: [{
    productId: "1423113435324",
    productQuantity: 2 //购买数量
}]

返回

{
  "code": 0,
  "msg": "成功",
  "data": {
      "orderId": "147283992738221" 
  }
}

订单列表

GET /sell/buyer/order/list

参数

openid: 18eu2jwk2kse3r42e2e
page: 0 //从第0页开始
size: 10

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "orderId": "161873371171128075",
      "buyerName": "张三",
      "buyerPhone": "18868877111",
      "buyerAddress": "蓝鸥",
      "buyerOpenid": "18eu2jwk2kse3r42e2e",
      "orderAmount": 0,
      "orderStatus": 0,
      "payStatus": 0,
      "createTime": 1490171219,
      "updateTime": 1490171219,
      "orderDetailList": null
    },
    {
      "orderId": "161873371171128076",
      "buyerName": "张三",
      "buyerPhone": "18868877111",
      "buyerAddress": "慕课网总部",
      "buyerOpenid": "18eu2jwk2kse3r42e2e",
      "orderAmount": 0,
      "orderStatus": 0,
      "payStatus": 0,
      "createTime": 1490171219,
      "updateTime": 1490171219,
      "orderDetailList": null
    }]
}

查询订单详情

GET /sell/buyer/order/detail

参数

openid: 18eu2jwk2kse3r42e2e
orderId: 161899085773669363

返回

{
    "code": 0,
    "msg": "成功",
    "data": {
          "orderId": "161899085773669363",
          "buyerName": "李四",
          "buyerPhone": "18868877111",
          "buyerAddress": "蓝鸥",
          "buyerOpenid": "18eu2jwk2kse3r42e2e",
          "orderAmount": 18,
          "orderStatus": 0,
          "payStatus": 0,
          "createTime": 1490177352,
          "updateTime": 1490177352,
          "orderDetailList": [
            {
                "detailId": "161899085974995851",
                "orderId": "161899085773669363",
                "productId": "157875196362360019",
                "productName": "招牌奶茶",
                "productPrice": 9,
                "productQuantity": 2,
                "productIcon": "http://xxx.com",
                "productImage": "http://xxx.com"
            }
        ]
    }
}

取消订单

POST /sell/buyer/order/cancel

参数

openid: 18eu2jwk2kse3r42e2e
orderId: 161899085773669363

返回

{
    "code": 0,
    "msg": "成功",
    "data": null
}

获取openid

重定向到 /sell/wechat/authorize

参数

returnUrl: http://xxx.com/abc  //【必填】

返回

http://xxx.com/abc?openid=oZxSYw5ldcxv6H0EU67GgSXOUrVg

支付订单

重定向 /sell/pay/create

参数

orderId: 161899085773669363
returnUrl: http://xxx.com/abc/order/161899085773669363

返回

http://xxx.com/abc/order/161899085773669363

获取产品评价列表

GET /sell/rating/productRatingList

参数

productId:1544520031189401114

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "ratingId": "1545617426726904009",
      "productId": "1544520031189401114",
      "username": "烤肉哥",
      "rateType": 0,
      "text": "好吃",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "30",
      "score": 5,
      "rateTime": 1545617419000,
      "recommend": [
        "南瓜粥",
        "皮蛋瘦肉粥"
      ]
    },
    {
      "ratingId": "1545617569958547010",
      "productId": "1544520031189401114",
      "username": "烤肉妹",
      "rateType": 1,
      "text": "不好吃",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 2,
      "rateTime": 1545617562000,
      "recommend": [
        
      ]
    },
    {
      "ratingId": "1545619922404690855",
      "productId": "1544520031189401114",
      "username": "小兔子",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545619915000,
      "recommend": [
        
      ]
    }
  ]
}

获取全部评价

GET /sell/rating/list

参数

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "ratingId": "1545617426726904009",
      "productId": "1544520031189401114",
      "username": "烤肉哥",
      "rateType": 0,
      "text": "好吃",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "30",
      "score": 5,
      "rateTime": 1545617419000,
      "recommend": [
        "南瓜粥",
        "皮蛋瘦肉粥"
      ]
    },
    {
      "ratingId": "1545617569958547010",
      "productId": "1544520031189401114",
      "username": "烤肉妹",
      "rateType": 1,
      "text": "不好吃",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 2,
      "rateTime": 1545617562000,
      "recommend": [
        
      ]
    },
    {
      "ratingId": "1545619173524558644",
      "productId": "1231443",
      "username": "烤肉妹",
      "rateType": 1,
      "text": "不好吃",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 2,
      "rateTime": 1545619166000,
      "recommend": [
        
      ]
    },
    {
      "ratingId": "1545619922404690855",
      "productId": "1544520031189401114",
      "username": "小兔子",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545619915000,
      "recommend": [
        
      ]
    },
    {
      "ratingId": "1545636071756650113",
      "productId": "1544520031189401114",
      "username": "吃货",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545636064000,
      "recommend": [
        "扁豆焖面",
        "娃娃菜炖豆腐",
        "牛肉馅饼"
      ]
    },
    {
      "ratingId": "1545637436275269477",
      "productId": "1544520031189401114",
      "username": "吃货",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545637454000,
      "recommend": [
        "扁豆焖面",
        "娃娃菜炖豆腐",
        "牛肉馅饼"
      ]
    },
    {
      "ratingId": "1545637530909574576",
      "productId": "1544520031189401114",
      "username": "吃货",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545637523000,
      "recommend": [
        "扁豆焖面",
        "娃娃菜炖豆腐",
        "牛肉馅饼"
      ]
    },
    {
      "ratingId": "1545637761032991578",
      "productId": "1544520031189401114",
      "username": "吃货",
      "rateType": 0,
      "text": "发票开的不对",
      "avatar": "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
      "deliveryTime": "40",
      "score": 4,
      "rateTime": 1545637753000,
      "recommend": [
        "扁豆焖面",
        "娃娃菜炖豆腐",
        "牛肉馅饼"
      ]
    }
  ]
}

创建评价

POST /sell/rating/create

参数

productId:1544520031189401114
username:吃货
deliveryTime:40
score:4
rateType:0
text:发票开的不对
avatar:http://static.galileo.xiaojukeji.com/static/tms/default_header.png
recommend:["扁豆焖面","娃娃菜炖豆腐","牛肉馅饼"]

返回

{
    "code": 0,
    "msg": "评价提交成功"
}

后端

订单列表

GET /sell/seller/order/list

参数

page:1
size:10

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "orderId": "1234567",
      "buyerName": "小欧",
      "buyerPhone": "123456789123",
      "buyerAddress": "蓝鸥",
      "buyerOpenid": "110110",
      "orderAmount": 2.50,
      "orderStatus": 0,
      "payStatus": 0,
      "createTime": 1544402704,
      "updateTime": 1544402704
    },
    {
      "orderId": "1544434347689267181",
      "buyerName": "张三",
      "buyerPhone": "18868822111",
      "buyerAddress": "蓝鸥",
      "buyerOpenid": "ew3euwhd7sjw9diwkq",
      "orderAmount": 6.40,
      "orderStatus": 0,
      "payStatus": 0,
      "createTime": 1544405547,
      "updateTime": 1544405547
    }
  ]
}

取消订单

GET /sell/seller/order/cancel

参数

orderId=1544434347689267181

返回

{
    "code": 0,
    "msg": "成功",
    "data": null
}

订单详情

GET /sell/seller/order/detail

参数

orderId=1544434347689267181

返回

{
  "code": 0,
  "msg": "成功",
  "data": {
    "orderId": "1544434347689267181",
    "buyerName": "张三",
    "buyerPhone": "18868822111",
    "buyerAddress": "蓝鸥",
    "buyerOpenid": "ew3euwhd7sjw9diwkq",
    "orderAmount": 6.40,
    "orderStatus": 0,
    "payStatus": 0,
    "createTime": 1544405547,
    "updateTime": 1544405547,
    "orderDetailList": [
      {
        "detailId": "1544434347717374884",
        "orderId": "1544434347689267181",
        "productId": "1231443",
        "productName": "皮蛋粥",
        "productPrice": 3.20,
        "productQuantity": 2,
        "productIcon": "http://xxxx.jpg"
      }
    ]
  }
}

订单完结

GET /sell/seller/order/finish

参数

orderId=1544434347689267181

返回

{
  "code": 0,
  "msg": "订单完结成功"
}

商品列表

GET /sell/seller/product/list

参数

page:1
size:10

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "productId": "1231443",
      "productName": "皮蛋粥",
      "productPrice": 3.20,
      "productStock": 94,
      "productDescription": "来喝粥啊",
      "productIcon": "http://xxxx.jpg",
      "productStatus": 0,
      "categoryType": 2,
      "createTime": 1535549077000,
      "updateTime": 1544408052000
    },
    {
      "productId": "123456",
      "productName": "皮皮虾",
      "productPrice": 3.20,
      "productStock": 100,
      "productDescription": "好吃的虾",
      "productIcon": "http://xxxx.jpg",
      "productStatus": 1,
      "categoryType": 2,
      "createTime": 1535708659000,
      "updateTime": 1544385342000
    }
  ]
}

商品上架

GET /sell/seller/product/on_sale

参数

productId:123456

返回

{
  "code": 0,
  "msg": "上架成功"
}

商品下架

GET /sell/seller/product/off_sale

参数

productId:123456

返回

{
  "code": 0,
  "msg": "下架成功"
}

商品类目和商品详情

GET  /sell/seller/product/index

参数

productId:1231443

返回

{
  "code": 0,
  "msg": "成功",
  "data": {
    "categoryList": [
      {
        "categoryId": 1,
        "categoryName": "热销榜",
        "categoryType": 2,
        "createTime": 1534933601000,
        "updateTime": 1534933601000
      },
      {
        "categoryId": 2,
        "categoryName": "男生最爱",
        "categoryType": 5,
        "createTime": 1534934262000,
        "updateTime": 1535412837000
      },
      {
        "categoryId": 4,
        "categoryName": "女生最爱",
        "categoryType": 1,
        "createTime": 1535413348000,
        "updateTime": 1535413348000
      },
      {
        "categoryId": 7,
        "categoryName": "儿童专享",
        "categoryType": 10,
        "createTime": 1535454828000,
        "updateTime": 1535454828000
      }
    ],
    "productInfo": {
      "productId": "1231443",
      "productName": "皮蛋粥",
      "productPrice": 3.20,
      "productStock": 94,
      "productDescription": "来喝粥啊",
      "productIcon": "http://xxxx.jpg",
      "productStatus": 0,
      "categoryType": 2,
      "createTime": 1535549077000,
      "updateTime": 1544408052000
    }
  }
}

商品修改提交

POST /sell/seller/product/save

参数

productId:1544520031189401114    (有更新,无则新增)
productName:烤肉饭
productPrice:10
productStock:100
productDescription:现烤烤肉饭
productIcon:https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1544530050398&di=cf7a38d86cf4fd32567fd865ea45d688&imgtype=0&src=http%3A%2F%2Fe.hiphotos.baidu.com%2Fbainuo%2Fwh%3D720%2C436%2Fsign%3D3c4002a5be389b5038aae855b705c9e9%2F472309f790529822789f2178d0ca7bcb0b46d4d8.jpg
categoryType:5

返回

{
    "code": 0,
    "msg": "商品信息保存成功"
}

商品类目列表

GET /sell/seller/category/list

参数

返回

{
  "code": 0,
  "msg": "成功",
  "data": [
    {
      "categoryId": 1,
      "categoryName": "热销榜",
      "categoryType": 2,
      "createTime": 1534933601000,
      "updateTime": 1534933601000
    },
    {
      "categoryId": 2,
      "categoryName": "男生最爱",
      "categoryType": 5,
      "createTime": 1534934262000,
      "updateTime": 1535412837000
    },
    {
      "categoryId": 4,
      "categoryName": "女生最爱",
      "categoryType": 1,
      "createTime": 1535413348000,
      "updateTime": 1535413348000
    },
    {
      "categoryId": 7,
      "categoryName": "儿童专享",
      "categoryType": 10,
      "createTime": 1535454828000,
      "updateTime": 1535454828000
    }
  ]
}

新增/保存类目

POST /sell/seller/category/save

参数

categoryId:7            (有更新,无则新增)      
categoryName:老人套餐
categoryType:10

返回

{
    "code": 0,
    "msg": "类目保存成功"
}

商铺信息

GET /sell/shop/info

参数

shopId:1544670774658295899

返回

视图
JSON数据
 
粘贴  
 
 
复制  
 
 
格式化 
 
 
删除空格    
 
 
删除空格并转义 
 
 
去除转义    
 
 
回到首页    
 
 
关于  
 

{
  "code": 0,
  "msg": "成功",
  "data": {
    "shopId": "1544670774658295899",
    "name": "粥品香坊(回龙观)",
    "description": "蜂鸟专送,美团转送,百度配送",
    "deliveryTime": 38,
    "score": 4.2,
    "serviceScore": 4.1,
    "foodScore": 4.3,
    "rankRate": 69.4,
    "minPrice": 0.00,
    "deliveryPrice": 0.00,
    "ratingCount": 24,
    "sellCount": 90,
    "bulletin": "粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。坚守纯天然、0添加的良心品质深得消费者青睐,发展至今成为粥类的引领品牌。是2008年奥运会和2013年园博会指定餐饮服务商。",
    "avatar": "http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg",
    "createTime": 1544481302000,
    "updateTime": 1544481302000,
    "pics": [
      {
        "picId": "1544683211798379954",
        "shopId": "1544670774658295899",
        "url": "http://fuss10.elemecdn.com/8/71/c5cf5715740998d5040dda6e66abfjpeg.jpeg?imageView2/1/w/180/h/180"
      },
      {
        "picId": "1544683282329277988",
        "shopId": "1544670774658295899",
        "url": "http://fuss10.elemecdn.com/b/6c/75bd250e5ba69868f3b1178afbda3jpeg.jpeg?imageView2/1/w/180/h/180"
      },
      {
        "picId": "1544683342818635471",
        "shopId": "1544670774658295899",
        "url": "http://fuss10.elemecdn.com/f/96/3d608c5811bc2d902fc9ab9a5baa7jpeg.jpeg?imageView2/1/w/180/h/180"
      }
    ],
    "infos": [
      {
        "infoId": "1544687880479931192",
        "shopId": "1544670774658295899",
        "info": "该商家支持发票,请下单写好发票抬头"
      },
      {
        "infoId": "1544688105541754233",
        "shopId": "1544670774658295899",
        "info": "品类:其他菜系,包子粥店"
      }
    ],
    "supports": [
      {
        "supportId": "1544691902309445127",
        "shopId": "1544670774658295899",
        "description": "在线支付满28减5",
        "type": 0
      },
      {
        "supportId": "1544692334050222446",
        "shopId": "1544670774658295899",
        "description": "VC无限橙果汁全场8折",
        "type": 1
      },
      {
        "supportId": "1544772226993822294",
        "shopId": "1544670774658295899",
        "description": "单人精彩套餐",
        "type": 2
      }
    ]
  }
}

保存商家信息

POST /sell/shop/save

参数

shopId:1544670774658295899
name:粥品香坊(回龙观)
description:蜂鸟专送
deliveryTime:38
score:4.2
serviceScore:4.1
foodScore:4.3
rankRate:69.4
minPrice:0
deliveryPrice:0
ratingCount:24
sellCount:90
bulletin:粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。坚守纯天然、0添加的良心品质深得消费者青睐,发展至今成为粥类的引领品牌。是2008年奥运会和2013年园博会指定餐饮服务商。
avatar:http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg

返回

{
    "code": 0,
    "msg": "商铺信息保存成功"
}

创建活动

POST /sell/shop/createSupport

参数

shopId:1544670774658295899
type:2
description:单人精彩套餐

返回

{
    "code": 0,
    "msg": "活动设置成功"
}

删除活动

POST /sell/shop/deleteSupport

参数

supportId:1544772226993822294

返回

{
  "code": 0,
  "msg": "活动删除成功"
}

提交修改商铺照片

POST /sell/shop/savePic

参数

shopId:1544670774658295899
url:https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1545306157757&di=316f96cb221d94d597a0ecda03c858d3&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimgad%2Fpic%2Fitem%2F9f2f070828381f304ce7d35da3014c086f06f04c.jpg
picId:1544683342818635471    有则更新,无则添加

返回

{
    "code": 0,
    "msg": "商铺照片修改成功"
}

提交修改商铺信息

POST /sell/shop/saveInfo

参数

shopId:1544670774658295899
info:这是一条测试数据
picId:1544683342818635471  有则更新,无则添加

返回

{
    "code": 0,
    "msg": "商铺信息修改成功"
}

猜你喜欢

转载自www.cnblogs.com/lzb1234/p/11387947.html