一 录入商品基本信息
二 设置商品的规格参数
三 设置商品销售属性
四 设置商品SKU信息
五 保存商品后,向后台提交的数据JSON
{
"spuName": "华为",
"spuDescription": "华为",
"catalogId": 225,
"brandId": 1,
"weight": 0,
"publishStatus": 0,
"decript": ["https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/c433ef80-0163-458e-8f1b-a1c843da1fa8_0d40c24b264aa511.jpg"],
"images": ["https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/7a304464-dba6-40f6-8a4a-56a53be5d166_528211b97272d88a.jpg", "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/42f1fbfc-9d83-46e9-8979-888380ab37c9_0d40c24b264aa511.jpg"],
"bounds": {
"buyBounds": 0,
"growBounds": 0
},
"baseAttrs": [{
"attrId": 7,
"attrValues": "以官网信息为准",
"showDesc": 0
}, {
"attrId": 8,
"attrValues": "2020",
"showDesc": 0
}, {
"attrId": 9,
"attrValues": "黑色",
"showDesc": 0
}, {
"attrId": 10,
"attrValues": "158",
"showDesc": 0
}, {
"attrId": 11,
"attrValues": "水晶",
"showDesc": 0
}, {
"attrId": 12,
"attrValues": "以官网信息为准",
"showDesc": 0
}, {
"attrId": 13,
"attrValues": "以官网信息为准",
"showDesc": 0
}],
"skus": [{
"attr": [{
"attrId": 14,
"attrName": "颜色",
"attrValue": "黑色"
}, {
"attrId": 15,
"attrName": "内存",
"attrValue": "4GB"
}],
"skuName": "华为 黑色 4GB",
"price": "5800",
"skuTitle": "华为 黑色 4GB主标题",
"skuSubtitle": "华为 黑色 4GB副标题",
"images": [{
"imgUrl": "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/7a304464-dba6-40f6-8a4a-56a53be5d166_528211b97272d88a.jpg",
"defaultImg": 0
}, {
"imgUrl": "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/42f1fbfc-9d83-46e9-8979-888380ab37c9_0d40c24b264aa511.jpg",
"defaultImg": 1
}],
"descar": ["黑色", "4GB"],
"fullCount": 3,
"discount": 0.98,
"countStatus": 1,
"fullPrice": 10000,
"reducePrice": 50,
"priceStatus": 1,
"memberPrice": []
}, {
"attr": [{
"attrId": 14,
"attrName": "颜色",
"attrValue": "黑色"
}, {
"attrId": 15,
"attrName": "内存",
"attrValue": "6GB"
}],
"skuName": "华为 黑色 6GB",
"price": "5900",
"skuTitle": "华为 黑色 6GB主标题",
"skuSubtitle": "华为 黑色 6GB副标题",
"images": [{
"imgUrl": "",
"defaultImg": 0
}, {
"imgUrl": "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/42f1fbfc-9d83-46e9-8979-888380ab37c9_0d40c24b264aa511.jpg",
"defaultImg": 1
}],
"descar": ["黑色", "6GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": []
}, {
"attr": [{
"attrId": 14,
"attrName": "颜色",
"attrValue": "白色"
}, {
"attrId": 15,
"attrName": "内存",
"attrValue": "4GB"
}],
"skuName": "华为 白色 4GB",
"price": "5800",
"skuTitle": "华为 白色 4GB主标题",
"skuSubtitle": "华为 白色 4GB副标题",
"images": [{
"imgUrl": "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/7a304464-dba6-40f6-8a4a-56a53be5d166_528211b97272d88a.jpg",
"defaultImg": 1
}, {
"imgUrl": "",
"defaultImg": 0
}],
"descar": ["白色", "4GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": []
}, {
"attr": [{
"attrId": 14,
"attrName": "颜色",
"attrValue": "白色"
}, {
"attrId": 15,
"attrName": "内存",
"attrValue": "6GB"
}],
"skuName": "华为 白色 6GB",
"price": "5900",
"skuTitle": "华为 白色 6GB主标题",
"skuSubtitle": "华为 白色 6GB副标题",
"images": [{
"imgUrl": "",
"defaultImg": 0
}, {
"imgUrl": "https://gulimall-cakin.oss-cn-chengdu.aliyuncs.com/2020-11-08/42f1fbfc-9d83-46e9-8979-888380ab37c9_0d40c24b264aa511.jpg",
"defaultImg": 1
}],
"descar": ["白色", "6GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": []
}]
}
六 API分析
1 请求
POST /product/spuinfo/save
2 请求参数
{
"spuName": "Apple XR",
"spuDescription": "Apple XR",
"catalogId": 225,
"brandId": 12,
"weight": 0.048,
"publishStatus": 0,
"decript": ["https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-22//66d30b3f-e02f-48b1-8574-e18fdf454a32_f205d9c99a2b4b01.jpg"],
"images": ["https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-22//dcfcaec3-06d8-459b-8759-dbefc247845e_5b5e74d0978360a1.jpg", "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-22//5b15e90a-a161-44ff-8e1c-9e2e09929803_749d8efdff062fb0.jpg"],
"bounds": {
"buyBounds": 500,
"growBounds": 6000
},
"baseAttrs": [{
"attrId": 7,
"attrValues": "aaa;bb",
"showDesc": 1
}, {
"attrId": 8,
"attrValues": "2019",
"showDesc": 0
}],
"skus": [{
"attr": [{
"attrId": 9,
"attrName": "颜色",
"attrValue": "黑色"
}, {
"attrId": 10,
"attrName": "内存",
"attrValue": "6GB"
}],
"skuName": "Apple XR 黑色 6GB",
"price": "1999",
"skuTitle": "Apple XR 黑色 6GB",
"skuSubtitle": "Apple XR 黑色 6GB",
"images": [{
"imgUrl": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-22//dcfcaec3-06d8-459b-8759-dbefc247845e_5b5e74d0978360a1.jpg",
"defaultImg": 1
}, {
"imgUrl": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-22//5b15e90a-a161-44ff-8e1c-9e2e09929803_749d8efdff062fb0.jpg",
"defaultImg": 0
}],
"descar": ["黑色", "6GB"],
"fullCount": 5,
"discount": 0.98,
"countStatus": 1,
"fullPrice": 1000,
"reducePrice": 10,
"priceStatus": 0,
"memberPrice": [{
"id": 1,
"name": "aaa",
"price": 1998.99
}]
}, {
"attr": [{
"attrId": 9,
"attrName": "颜色",
"attrValue": "黑色"
}, {
"attrId": 10,
"attrName": "内存",
"attrValue": "12GB"
}],
"skuName": "Apple XR 黑色 12GB",
"price": "2999",
"skuTitle": "Apple XR 黑色 12GB",
"skuSubtitle": "Apple XR 黑色 6GB",
"images": [{
"imgUrl": "",
"defaultImg": 0
}, {
"imgUrl": "",
"defaultImg": 0
}],
"descar": ["黑色", "12GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": [{
"id": 1,
"name": "aaa",
"price": 1998.99
}]
}, {
"attr": [{
"attrId": 9,
"attrName": "颜色",
"attrValue": "白色"
}, {
"attrId": 10,
"attrName": "内存",
"attrValue": "6GB"
}],
"skuName": "Apple XR 白色 6GB",
"price": "1998",
"skuTitle": "Apple XR 白色 6GB",
"skuSubtitle": "Apple XR 黑色 6GB",
"images": [{
"imgUrl": "",
"defaultImg": 0
}, {
"imgUrl": "",
"defaultImg": 0
}],
"descar": ["白色", "6GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": [{
"id": 1,
"name": "aaa",
"price": 1998.99
}]
}, {
"attr": [{
"attrId": 9,
"attrName": "颜色",
"attrValue": "白色"
}, {
"attrId": 10,
"attrName": "内存",
"attrValue": "12GB"
}],
"skuName": "Apple XR 白色 12GB",
"price": "2998",
"skuTitle": "Apple XR 白色 12GB",
"skuSubtitle": "Apple XR 黑色 6GB",
"images": [{
"imgUrl": "",
"defaultImg": 0
}, {
"imgUrl": "",
"defaultImg": 0
}],
"descar": ["白色", "12GB"],
"fullCount": 0,
"discount": 0,
"countStatus": 0,
"fullPrice": 0,
"reducePrice": 0,
"priceStatus": 0,
"memberPrice": [{
"id": 1,
"name": "aaa",
"price": 1998.99
}]
}]
}
七 JSON格式化和代码生成工具
该网站可根据JSON生成对应实体类