[ { "type": "post", "url": "/home/activity", "title": "activity", "description": "

获取首页轮播下活动分类商品的接口

", "name": "activity", "group": "Home", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "id", "description": "

活动的id,取值对应为:1->限时白嫖,2->新品推荐,3->低价高配,4->超值特卖

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/activity" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/home/banner", "title": "banner", "description": "

获取首页的banner数据

", "name": "banner", "group": "Home", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/banner" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/home/index", "title": "index", "description": "

获取首页商品列表,默认返回20条数据(不需要参数,传空对象 {} 即可 )

", "name": "index", "group": "Home", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/index" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/home/info", "title": "info", "description": "

获取商品的详情接口

", "name": "info", "group": "Home", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "id", "description": "

商品的id参数,从 /home/index 接口中获得 wares_id 作为id参数传入即可

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/info" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/home/recommend", "title": "recommend", "description": "

获取首页推荐分类的数据

", "name": "recommend", "group": "Home", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/recommend" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/home/search", "title": "search", "description": "

搜索接口,用于首页搜索商品

", "name": "search", "group": "Home", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "keyword", "description": "

搜索关键词,例如:小米

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/home/search" } ], "version": "1.0.0", "filename": "routes/index.js", "groupTitle": "Home" }, { "type": "post", "url": "/car/addCar", "title": "addCar", "description": "

详情页添加商品到购物车

", "name": "addCar", "group": "car", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "waresid", "description": "

需要被收藏的商品id,wares_id字段

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"成功添加购物车\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"不要重复收藏\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/addCar" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/car/checkCar", "title": "checkCar", "description": "

检查商品是否已经被用户添加到购物车,已添加 result 为true,未添加 result 为false

", "name": "checkCar", "group": "car", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "waresid", "description": "

商品id,wares_id字段

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"商品已添加购物车\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 200,\n \"message\" : \"商品未添加购物车\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/checkCar" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/car/deleteCar", "title": "deleteCar", "description": "

删除被添加到购物车的商品

", "name": "deleteCar", "group": "car", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Array", "optional": false, "field": "carid", "description": "

购物车商品id,从getCarList接口中获得car_id即可。参数格式:"[1,2,3]"

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"删除成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 200,\n \"message\" : \"删除失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/deleteCar" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/car/getCarList", "title": "getCarList", "description": "

获取用户的购物车商品数据(不需要参数,传空对象 {} 即可 )

", "name": "getCarList", "group": "car", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"购物车没有数据\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/getCarList" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/car/submitCar", "title": "submitCar", "description": "

更新购物车需要购买的商品数量,提交的数据是个对象,例如:"{"carList":[{"waresid":113,"goodsnum":2,"goodsprice":1000},{"waresid":114,"goodsnum":1,"goodsprice":1100}]}"

", "name": "submitCar", "group": "car", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Object", "optional": false, "field": "carList", "description": "

为对象,包含下面三个参数,需要前端自己构造数组

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "waresid", "description": "

商品的waresid

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "goodsnum", "description": "

购买的数量

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "goodsprice", "description": "

购买的单价

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"订单增加成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 200,\n \"message\" : \"订单增加失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/submitCar" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/car/updateCarNum", "title": "updateCarNum", "description": "

更新购物车需要购买的商品数量

", "name": "updateCarNum", "group": "car", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "carid", "description": "

购物车商品id,从getCarList接口中获得car_id即可

" }, { "group": "Parameter", "type": "number", "optional": false, "field": "quantity", "description": "

购物车商品的数量

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"更新成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 200,\n \"message\" : \"更新失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/car/updateCarNum" } ], "version": "1.0.0", "filename": "routes/car.js", "groupTitle": "car" }, { "type": "post", "url": "/order/allOrder", "title": "allOrder", "description": "

获取不同状态的订单

", "name": "allOrder", "group": "order", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "status", "description": "

查询的订单状态,0:待付款,1:待发货,2:待收货,3:退款/售后,-1:查看所有订单

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/order/allOrder" } ], "version": "1.0.0", "filename": "routes/order.js", "groupTitle": "order" }, { "type": "post", "url": "/order/buyOrder", "title": "buyOrder", "description": "

submitCar提交订单后,订单页面购买支付后需要用的接口,更改订单状态为待发货

", "name": "buyOrder", "group": "order", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Array", "optional": false, "field": "goodsid", "description": "

订单的goods_id,从allOrder接口中获得。参数格式:"[5,6]"

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"购买成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"购买失败,余额不足\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/order/buyOrder" } ], "version": "1.0.0", "filename": "routes/order.js", "groupTitle": "order" }, { "type": "post", "url": "/type/list", "title": "list", "description": "

分类页面获取分类商品的接口

", "name": "list", "group": "type", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "typename", "description": "

分类的中文名称,例如:小米

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/type/list" } ], "version": "1.0.0", "filename": "routes/type.js", "groupTitle": "type" }, { "type": "post", "url": "/user/add", "title": "add", "description": "

用户注册的接口

", "name": "add", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "name", "description": "

用户名

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "pwd", "description": "

用户密码

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "phone", "description": "

用户手机号

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"注册成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"注册失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/user/add" } ], "version": "1.0.0", "filename": "routes/users.js", "groupTitle": "user" }, { "type": "post", "url": "/user/getUserAddress", "title": "getUserAddress", "description": "

获取用户的收货地址(不需要参数,传空对象 {} 即可 )

", "name": "getUserAddress", "group": "user", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 200,\n \"message\" : \"没有收货地址\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/user/getUserAddress" } ], "version": "1.0.0", "filename": "routes/users.js", "groupTitle": "user" }, { "type": "post", "url": "/user/like", "title": "like", "description": "

用户在详情页收藏商品使用的接口

", "name": "like", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "number", "optional": false, "field": "shopid", "description": "

需要被收藏商品的id,这里是商品的 wares_id 字段

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"收藏成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"抱歉,请勿重复收藏\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/user/like" } ], "version": "1.0.0", "filename": "routes/users.js", "groupTitle": "user" }, { "type": "post", "url": "/user/likeList", "title": "likeList", "description": "

获取用户收藏的商品(不需要参数,后端会解密请求头token获取user_id)

", "name": "likeList", "group": "user", "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求失败\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/user/likeList" } ], "version": "1.0.0", "filename": "routes/users.js", "groupTitle": "user" }, { "type": "post", "url": "/user/login", "title": "login", "description": "

用户登录的接口,注意用户登录成功后会在result中包含token参数,请前端本地保存token。

", "name": "login", "group": "user", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "name", "description": "

用户名

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "pwd", "description": "

用户密码

" } ] } }, "success": { "examples": [ { "title": "请求成功的返回:", "content": "{\n \"status\" : 200,\n \"message\" : \"请求成功\"\n \"result\" : \"asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ\"\n}", "type": "json" } ] }, "error": { "examples": [ { "title": "请求失败的返回", "content": "{\n \"status\": 404,\n \"message\" : \"请求错误\"\n \"result\": null\n}", "type": "json" } ] }, "sampleRequest": [ { "url": "http://127.0.0.1:9090/user/login" } ], "version": "1.0.0", "filename": "routes/users.js", "groupTitle": "user" } ]