后台商品管理
sfyr111 edited this page Feb 26, 2018
·
1 revision
{{host}}/manage/product/saveOrUpdate
name
categoryId
subtitle
subImages
detail
price
stock
status
id: 指定商品 id 为更新, 无指定 id 添加商品
{
"status": 0,
"msg": "添加产品成功",
"data": {
"createTime": "2018-02-26T08:23:03.455Z",
"updateTime": "2018-02-26T08:23:03.455Z",
"id": 8,
"name": "产品名称5",
"categoryId": "1",
"subtitle": "副标题",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.17",
"stock": "1000",
"status": "1",
"mainImage": "url1"
}
}
{{host}}/manage/product/setSaleStatus
id
status: {"ON_SALE":{"CODE":1,"VALUE":"在售"},"NO_SALE":{"CODE":2,"VALUE":"下架"},"DEL_SALE":{"CODE":3,"VALUE":"删除"}}
{
"status": 0,
"msg": "修改产品销售状态成功",
"data": {
"id": 1,
"categoryId": 1,
"name": "产品名称1",
"subtitle": "副标题",
"mainImage": "url1",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.13",
"stock": 998,
"status": "1",
"createTime": "2018-02-14T17:39:36.000Z",
"updateTime": "2018-02-26T09:04:41.721Z"
}
}
{{host}}/manage/product/detail/:productId
{
"status": 0,
"msg": null,
"data": {
"id": 1,
"categoryId": 1,
"name": "产品名称1",
"subtitle": "副标题",
"mainImage": "url1",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.13",
"stock": 998,
"status": 1,
"createTime": "2018-02-14T17:39:36.000Z",
"updateTime": "2018-02-26T09:04:41.000Z"
}
}
{{host}}/manage/product/list?pageNum=1&pageSize=10
pageNum
pageSize
{
"status": 0,
"msg": null,
"data": {
"pageNum": "1",
"pageSize": "10",
"list": [
{
"id": 1,
"categoryId": 1,
"name": "产品名称1",
"subtitle": "副标题",
"mainImage": "url1",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.13",
"stock": 998,
"status": 1,
"createTime": "2018-02-14T17:39:36.000Z",
"updateTime": "2018-02-26T09:04:41.000Z"
}
],
"total": 5,
"host": "oss-cn-hangzhou.aliyuncs.com"
}
}
{{host}}/manage/product/search?productName=产品&pageNum=1&pageSize=10
productName: 关键字
pageNum
pageSize
{
"status": 0,
"msg": null,
"data": {
"pageNum": "1",
"pageSize": "10",
"list": [
{
"id": 1,
"categoryId": 1,
"name": "产品名称1",
"subtitle": "副标题",
"mainImage": "url1",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.13",
"stock": 998,
"status": 1,
"createTime": "2018-02-14T17:39:36.000Z",
"updateTime": "2018-02-26T09:04:41.000Z"
}
],
"total": 5,
"host": "oss-cn-hangzhou.aliyuncs.com"
}
}
{{host}}/manage/product/search?productId=1
productId
{
"status": 0,
"msg": null,
"data": {
"product": {
"id": 1,
"categoryId": 1,
"name": "产品名称1",
"subtitle": "副标题",
"mainImage": "url1",
"subImages": "url1,url2",
"detail": "详情",
"price": "12.13",
"stock": 998,
"status": 1,
"createTime": "2018-02-14T17:39:36.000Z",
"updateTime": "2018-02-26T09:04:41.000Z"
},
"host": "oss-cn-hangzhou.aliyuncs.com"
}
}
{{host}}/manage/upload
file: 文件
fields: {} 其他字段
form-data
{
"status": 0,
"msg": "上传图片成功",
"data": {
"filename": "shipping1519636340300.jpeg",
"url": "localhost:7001/public/shipping1519636340300.jpeg",
"fields": {
"a": "1"
}
}
}