Coder Social home page Coder Social logo

babyshopserver's Introduction

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

babyshopserver's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.