文档
测试

添加商品

POST
/mall/admin/goods/create

接口描述

这个接口 后台管理 要把旧的 参数改一下 : products 对象 下的 specifications属性存的是数组 要改为specification 这个参数 只存一个规格值

请求头

参数名
类型
描述
必填
token
String
必填

请求参数

参数名
类型
描述
必填
goods
Object
商品信息
必填
name
String
商品名称
必填
brandId
int
系列id
必填
gallery
array
宣传画廊 图片数组
必填
keywords
String
关键字
必填
brief
String
商品简介
必填
isOnSale
Boolean
是否在售 true 在售
必填
sortOrder
int
排序编号
必填
picUrl
String
商品图片
必填
isNew
int
是否为新品 true 是 ,false 不是
必填
isHot
int
是否推荐 true 是, false 不是
必填
unit
String
商品单位 件/套/个
必填
counterPrice
float
港元价格, 用于谷歌支付和苹果支付的金额
必填
retailPrice
float
(点券)零售价格
必填
detail
String
商品详细介绍
必填
goodsType
int
商品类型 1 普通商品 2 预售商品 3 VIP商品
必填
firstPrice
float
定金,只有商品类型为 预售商品才有
必填
lastPrice
float
尾款,只有商品类型为 预售商品才有
必填
isFreeMall
int
是否包邮 2 到付 1 包邮 0 不包邮
必填
freight
float
运费 ,包邮和到付 为0
必填
receivingWay
int
商品支持配送支持方式 0 快递配送 1 门店自取 2 都支持
必填
lastPayTime
String
预售商品尾款开始支付时间
可选
depoCloseDay
int
预售商品指定天数内未支付尾款关闭订单
可选
storesIds
array
门店id列表,只有配送方式为门店自取的时候才需要传递
必填
closeTimeUnit
int
未付尾款超时时间单位 1: 天 2: 小时 3: 分钟
必填
depositIsRefund
int
预售商品定金是否可退款 1 可退款 2 不可退款
必填
payFirstCloseTime
String
定金支付截止时间
必填
firstPriceHkd
float
港元定金,只有商品类型为 预售商品才有
必填
lastPriceHkd
float
港元尾款,只有商品类型为 预售商品才有
必填
freightHkd
float
港元运费
必填
products
array
商品库存信息 数组
必填
specification
String
商品规格值 例如 尺寸: X XL
必填
number
int
库存数量
必填
url
String
商品图片
必填
priceHkd
folat
港元货品价格
必填
price
float
点券货品价格
必填

响应参数

参数名
类型
描述
必填
code
int
请求状态码 0 成功 其他失败
必填
msg
String
请求响应信息
必填

说明 / 示例

## `请求示例` ```java {"goods":{"depoCloseDay": 1,"lastPayTime":"2021-12-20 16:00:00", "closeTimeUnit":1,"depositIsRefund":1,"payFirstCloseTime":"2021-12-30 00:00:00", "goodsSn":"","name":"猥琐老","brandId":1001000,"storesIds":[1],"gallery":["https://mall-1308127790.cos.ap-hongkong.myqcloud.com/u%3D2966786415%2C1776373023%26fm%3D26%26fmt%3Dauto.webp"],"keywords":null,"brief":"","isOnSale":true,"sortOrder":"","isFreeMall":1,"picUrl":"https://mall-1308127790.cos.ap-hongkong.myqcloud.com/u%3D2966786415%2C1776373023%26fm%3D26%26fmt%3Dauto.webp","isNew":true,"isHot":false,"unit":"件","counterPrice":"1231","receivingWay":0,"detail":"<p>99块钱就能买一个马老还要什么自行车,给我冲</p>","firstPrice":"10","lastPrice":"10","retailPrice":"23123","goodsType":2},"products":[{"id":"","specification":"究极版","number":1,"url":"https://mall-1308127790.cos.ap-hongkong.myqcloud.com/u%3D2966786415%2C1776373023%26fm%3D26%26fmt%3Dauto.webp","price":"99"}]} ``` |参数|说明| |-|-| |goods| 商品信息| |products| 商品库存信息,数组格式| `请求示例` ```java { "goods": { "goodsSn": "", "name": "aiwan", "brandId": 1001030, "storesIds": [], "gallery": [ "https://mall-1308127790.cos.ap-hongkong.myqcloud.com/1641174890pqmih" ], "keywords": "", "brief": "", "isOnSale": true, "sortOrder": "", "isFreeMall": 1, "picUrl": "https://mall-1308127790.cos.ap-hongkong.myqcloud.com/1641174887y7jws", "isNew": true, "isHot": true, "unit": "件", "counterPrice": "12", "receivingWay": 0, "detail": "<p>123213</p>", "firstPrice": "10", "firstPriceHkd": "10", "lastPrice": "10", "lastPriceHkd": "10", "depositIsRefund": 2, "retailPrice": "10", "goodsType": 2, "lastPayTime": "2022-01-04 00:00:00", "depoCloseDay": "10", "closeTimeUnit": 1, "payFirstCloseTime": "2022-01-03 10:55:25" }, "products": [ { "id": "", "specification": "大", "number": 1, "url": "https://mall-1308127790.cos.ap-hongkong.myqcloud.com/1641174906acs53", "price": "10", "priceHkd": "10" } ] } ``` `返回示例` ```java { "code": 0, "msg": "请求成功" } ```