addSellerProduct.md
5.79 KB
1、新增基础商品
新增基础商品(/SellerProductController/addProduct)
请求参数
参数名称 | 参数类型 | 可否为空 | 示例 | 备注 |
---|---|---|---|---|
productName | string | 否 | 商品名称 | 名称 |
brandId | int | 否 | 22 | 品牌的ID号 |
shopId | int | 否 | 22 | 店铺的ID号 |
maxSortId | int | 否 | 1 | 一级品类的Id |
middleSortId | int | 否 | 22 | 二级品类的ID |
smallSortId | int | 否 | 33 | 三级品类的ID |
gender | string | 否 | 1 | 1代表男 2代表女 3代表通用 |
factoryCode | string | 是 | 厂家编码 | 厂家编码 |
retailPrice | double | 否 | 188.00 | 吊牌价 |
salesPrice | double | 否 | 188.00 | 销售价 |
goodsYears | int | 否 | 2018 | 商品年 |
phrase | string | 是 | 卖点 | 卖点 |
goodsSeason | int | 否 | 1 | 货品季 1代表春 2夏 3秋 4冬 5春夏 6秋冬 |
ageLevel | string | 否 | 1 | 年龄层1成人2大童3小童 4中童 5幼童 多选用单竖线分隔 |
seasons | string | 否 | spring | 是 |
sellerGoodsInfoStr | string | 否 | 商品信息 | json串 |
商品颜色的参数说明
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
factoryCode | string | 是 | 款型编码 | 编码 | |
factoryGoodsName | string | 否 | 亚红色 | 颜色展示名称 | |
goodsName | string | 否 | 红色 | 色系名称 | |
colorId | int | 否 | 22 | 色系ID | |
isDefault | string | 否 | Y | 是否主推,不是则传N | |
goodsColorImage | string | 否 | 图片的url | 图片的绝对路径 | |
goodsSizeList | string | 是 | JSON串 | 当前颜色下面尺码列表json |
尺码的参数说明
参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
---|---|---|---|---|---|
factoryCode | string | 是 | 条码 | 条码 | |
sizeId | int | 是 | 22 | 尺码ID |
注意,通用的头部没有列出。
请求示例
http://127.0.0.1:8088/platform/SellerProductController/addProduct
请求样例数据
请求样例:
{"productName":"商品名", "brandId":4, "shopId":4, "maxSortId":12, "middleSortId" : 144, "smallSortId":145 , "gender" : "1", "retailPrice":"44.44", "salesPrice": "33.33", "phrase" :"商品卖点",
"goodsYears":2019, "goodsSeason":1, "factoryCode":"厂家编号", "ageLevel":"1|2", "seasons":"1", "sellerGoodsInfoStr" : "[{\"factoryCode\":\"123123123\",\"factoryGoodsName\":\"蓝色1111\",\"goodsColorImage\":\"http://img12.static.yhbimg.com/goodsimg/2017/04/18/11/02c52592f14a13be1014aa8c116b5d4e1c.jpg\",\"goodsName\":\"蓝色\",\"colorId\":36,\"goodsSizeList\":[{\"sizeId\":\"203\",\"factoryCode\":\"12dad%%\"},{\"sizeId\":\"207\",\"factoryCode\":\"adasd%%\"}],\"isDefault\":\"N\"},{\"factoryCode\":\"aas23123\",\"factoryGoodsName\":\"蓝色3333\",\"goodsColorImage\":\"http://img12.static.yhbimg.com/goodsimg/2017/04/18/11/028adf5dd962895c11feb2fec8ef0c5b32.jpg\",\"goodsName\":\"蓝色\",\"colorId\":33,\"goodsSizeList\":[{\"sizeId\":\"207\",\"factoryCode\":\"asdasd$$\"},{\"sizeId\":\"203\",\"factoryCode\":\"##sdasd\"}],\"isDefault\":\"Y\"}]"
}
正常返回:
{
"code": 200,
"data": {
"ageLevel": "1|2",
"brandId": 4,
"factoryCode": "厂家编号",
"founder": 222,
"gender": "1",
"goodsSeason": 1,
"goodsYears": 2019,
"id": 508550,
"maxSortId": 12,
"middleSortId": 144,
"phrase": "商品埋点",
"productName": "商品名",
"productSkn": 512587888,
"retailPrice": 44.44,
"salesPrice": 33.33,
"seasons": "1",
"sellerGoodList": [
{
"colorId": 36,
"factoryCode": "123123123",
"factoryGoodsName": "蓝色1111",
"goodsColorImage": "/2017/04/18/11/02c52592f14a13be1014aa8c116b5d4e1c.jpg",
"goodsName": "蓝色",
"goodsSizeList": [
{
"factoryCode": "12d112ad%%",
"goodsId": 671188,
"marketPrice": 44.44,
"productId": 508550,
"productSkc": 680400,
"productSkn": 512587888,
"productSku": 2027098,
"salePrice": 33.33,
"sizeId": 203
},
{
"factoryCode": "adas122d%%",
"goodsId": 671188,
"marketPrice": 44.44,
"productId": 508550,
"productSkc": 680400,
"productSkn": 512587888,
"productSku": 2027100,
"salePrice": 33.33,
"sizeId": 207
}
],
"id": 671188,
"isDefault": "N",
"productId": 508550,
"productSkc": 680400,
"productSkn": 512587888
},
{
"colorId": 33,
"factoryCode": "aas23123",
"factoryGoodsName": "蓝色3333",
"goodsColorImage": "/2017/04/18/11/028adf5dd962895c11feb2fec8ef0c5b32.jpg",
"goodsName": "蓝色",
"goodsSizeList": [
{
"factoryCode": "asda2s12d$$",
"goodsId": 671190,
"marketPrice": 44.44,
"productId": 508550,
"productSkc": 680402,
"productSkn": 512587888,
"productSku": 2027102,
"salePrice": 33.33,
"sizeId": 207
},
{
"factoryCode": "##s2da12sd",
"goodsId": 671190,
"marketPrice": 44.44,
"productId": 508550,
"productSkc": 680402,
"productSkn": 512587888,
"productSku": 2027104,
"salePrice": 33.33,
"sizeId": 203
}
],
"id": 671190,
"isDefault": "Y",
"productId": 508550,
"productSkc": 680402,
"productSkn": 512587888
}
],
"shopId": 948,
"smallSortId": 145
},
"md5": "7933e91dbb30b00cc353aef76c598e32",
"message": "商品添加成功."
}
异常返回:
{
"code": 1001,
"data": ["错误一", "错误二"],
"md5": "d751713988987e9331980363e24189ce",
"message": "参数校验错误"
}