- 后台接口
- 邮件处理器
- 后台部门管理
- 后台菜单管理
- 后台角色管理
- 后台用户管理
- 用户登录
- 个人信息
- 后台字典值管理
- 后台字典管理
- 邮件配置
- 商品管理
- 订单管理
- banner图片管理
- 商城栏目管理
- 会员管理
- 用户收获地址管理
- 评论管理
- 金刚区管理
- 关键字管理
- 商城分类管理
- 优惠券管理
- 前台接口
- 支付接口
- 购物车接口
- 首页接口
- 用户接口
- 商品接口
- 登录相关接口
- 订单接口
- 搜索接口
- 用户地址接口
- 用户评论接口
- 金刚区接口
- 商品分类接口
- 支付成功回调接口
- 退款接口
- 搜索历史接口
- 邮件回调接口
- 下单回调接口
- 未支付订单取消回调
- 优惠券接口
添加商品
POST
/shop/goods
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
goods
object (Goods)
可选
createTime
string | null
创建时间
updateTime
string | null
更新时间
id
integer | null
可选
goodsSn
string | null
商品编号
name
string | null
商品名称
categoryId
integer | null
商品所属类目ID
>= 0
brandId
integer | null
可选
gallery
array[string] | null
可选
keywords
string | null
可选
brief
string | null
商品简介
isOnSale
boolean | null
可选
sort
integer | null
排序
picUrl
string | null
商品页面商品图片
shareUrl
string | null
商品分享海报
isNew
boolean | null
可选
isHot
boolean | null
可选
unit
string | null
必需
counterPrice
number | null
专柜价格
retailPrice
number | null
零售价格
actualSales
integer | null
实际销量
virtualSales
integer | null
虚拟销量
detail
string | null
可选
delFlag
boolean | null
可选
specifications
array[object (GoodsSpecification[]) {8}] | null
可选
createTime
string | null
创建时间
updateTime
string | null
更新时间
id
integer | null
可选
goodsId
integer | null
商品表的商品ID
specification
string | null
商品规格名称
value
string | null
商品规格值
picUrl
string | null
商品规格图片
delFlag
boolean | null
逻辑删除
attributes
array[object (GoodsAttribute[]) {7}] | null
可选
createTime
string | null
创建时间
updateTime
string | null
更新时间
id
integer | null
可选
goodsId
integer | null
商品表的商品ID
attribute
string | null
商品参数名称
value
string | null
商品参数值
delFlag
boolean | null
可选
products
array[object (GoodsProduct[]) {10}] | null
可选
createTime
string | null
创建时间
updateTime
string | null
更新时间
id
integer | null
可选
goodsId
integer | null
商品表的商品ID
specifications
array[string] | null
可选
>= 1 items
price
number | null
商品货品价格
>= 0.0001
defaultSelected
boolean | null
可选
number
integer | null
商品货品数量
>= 0
url
string | null
商品货品图片
delFlag
boolean | null
可选
示例
{
"goods": {
"createTime": "string",
"updateTime": "string",
"id": 0,
"goodsSn": "string",
"name": "string",
"categoryId": 0,
"brandId": 0,
"gallery": [
"string"
],
"keywords": "string",
"brief": "string",
"isOnSale": true,
"sort": 0,
"picUrl": "string",
"shareUrl": "string",
"isNew": true,
"isHot": true,
"unit": "string",
"counterPrice": 0,
"retailPrice": 0,
"actualSales": 0,
"virtualSales": 0,
"detail": "string",
"delFlag": true
},
"specifications": [
{
"createTime": "string",
"updateTime": "string",
"id": 0,
"goodsId": 0,
"specification": "string",
"value": "string",
"picUrl": "string",
"delFlag": true
}
],
"attributes": [
{
"createTime": "string",
"updateTime": "string",
"id": 0,
"goodsId": 0,
"attribute": "string",
"value": "string",
"delFlag": true
}
],
"products": [
{
"createTime": "string",
"updateTime": "string",
"id": 0,
"goodsId": 0,
"specifications": [
"string"
],
"price": 0.0001,
"defaultSelected": true,
"number": 0,
"url": "string",
"delFlag": true
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:81/shop/goods' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
code
integer | null
可选
msg
string | null
返回消息
data
boolean | null
返回数据
示例
{
"code": 0,
"msg": "",
"data": false
}
修改于 2024-05-06 03:44:54