Navigation Menu

Skip to content

MrWindlike/BabyShopServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BabyShop Api说明

请求说明

GET

wx.fetch({
  url: 'addresses',
  data: {

  }
})

POST

wx.fetch({
  url: 'addresses',
  method: 'POST',
  data: {
    name: {{name}},
    phone: {{phone}},
    province: {{province}},
    city: {{city}},
    detail: {{detail}},
  }
})

DELETE

wx.fetch({
  url: 'addresses',
  method: 'DELETE',
  data: {
    int_id: {{int_id}},
    bool_default: {{bool_default}}
  }
})

接口

1. 地址

1.1 获取用户地址列表

  • URL: addresses
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
weixinId string 微信openid

1.2 添加地址

  • URL: addresses
  • METHOD: POST
  • PARAMS:
参数名 必须 类型 说明
weixinId string 微信openid
name string 姓名
phone string 手机
province string
city string
county string 区县
detail string 详细地址

1.3 编辑地址信息

  • URL: addresses
  • METHOD: PUT
  • PARAMS:
参数名 必须 类型 说明
weixinId string 微信openid
name string 姓名
phone string 手机
province string
city string
county string 区县
detail string 详细地址

1.4 设置默认地址

  • URL: addresses
  • METHOD: PUT
  • PARAMS:
参数名 必须 类型 说明
weixinId string 微信openid
int_id int 地址ID

1.5 删除地址

  • URL: addresses
  • METHOD: DELETE
  • PARAMS:
参数名 必须 类型 说明
weixinId string 微信openid
int_id int 地址ID
bool_default bool 是否为默认地址

2. 分类

2.1 添加分类

  • URL: categories
  • METHOD: POST
  • PARAMS:
参数名 必须 类型 说明
name string 分类名

2.2 获取分类列表

  • URL: categories
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
page int 当前页数
pageSize int 每页条数
  • RETURN:
{
  code: 200,
  data: {
    list: [
      {
        id: 1,
        name: '奶粉',
        property: '重量,品牌',
      }
    ],
    total: 1
  },
  msg: '获取分类列表成功'
}

2.3 删除分类

  • URL: categories
  • METHOD: DELETE
  • PARAMS:
参数名 必须 类型 说明
int_id int 分类id

2.4 更新分类

  • URL: categories
  • METHOD: PUT
  • PARAMS:
参数名 必须 类型 说明
int_id int 分类id
name string 分类名
property string 属性,字符串。如:'大小,颜色'

3. 商品

3.1 获取热门商品列表

  • URL: goods
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
bool_hot string 只需传1

3.2 获取推荐商品列表

  • URL: goods
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
bool_recomment string 只需传1

3.3 获取分类商品列表

  • URL: goods
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
int_categoryId string 分类ID

3.4 获取商品列表

  • URL: goods
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
page string 页数
pageSize string 每页条数

3.5 获取商品详情

  • URL: goods
  • METHOD: GET
  • PARAMS:
参数名 必须 类型 说明
int_id int 商品ID

3.6 更新商品信息

  • URL: goods
  • METHOD: PUT
  • PARAMS:
参数名 必须 类型 说明
int_id int 商品ID
name int 名称
float_price float 价格
preview string 预览图
detail string 详情图
property string 属性。传字符串,如:'300g,红色'
bool_hot bool 是否热卖
bool_recomment bool 是否推荐
int_categoryId int 分类ID

About

BabyShop服务端

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages