|
|
|
@ -57,6 +57,7 @@ type ArgsSkuAdd struct {
|
|
|
|
|
Content string // 商品详情
|
|
|
|
|
Imgs []SkuImg // 商品图片 第一张主图
|
|
|
|
|
Specifications []SkuSpecification // 商品参数信息
|
|
|
|
|
ImgUrl string // 商品主图
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SkuImg struct {
|
|
|
|
@ -76,7 +77,11 @@ type SkuAttribute struct {
|
|
|
|
|
// Add @Title 添加商品
|
|
|
|
|
func (s *sku) Add(ctx context.Context, args ArgsSkuAdd) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
return client.GetClient(s).Call(ctx, "Add", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "Add", args, &reply)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArgsSkuAdjust struct {
|
|
|
|
@ -89,7 +94,11 @@ type ArgsSkuAdjust struct {
|
|
|
|
|
// Adjust @Title 加价
|
|
|
|
|
func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
return client.GetClient(s).Call(ctx, "Adjust", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "Adjust", args, &reply)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArgsSkuLists struct {
|
|
|
|
@ -115,35 +124,39 @@ type SkuListsSearch struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ReplySkuList struct {
|
|
|
|
|
Lists []SkuItem
|
|
|
|
|
Total int64
|
|
|
|
|
Lists []SkuItem `json:"lists"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SkuItem struct {
|
|
|
|
|
Id uint
|
|
|
|
|
Name string // 名称
|
|
|
|
|
BrandName string // 品牌名称
|
|
|
|
|
FirstCategoryId uint // 一级分类id
|
|
|
|
|
SecondCategoryId uint // 二级分类id
|
|
|
|
|
ThirdCategoryId uint // 三级分类id
|
|
|
|
|
SupplyPrice decimal.Decimal // 采购价
|
|
|
|
|
GuidePrice decimal.Decimal // 指导价
|
|
|
|
|
ImgUrl string // 商品主图
|
|
|
|
|
PlatformStatus uint // 平台状态 1=上架 2=下架
|
|
|
|
|
SourceName string // 供应商名称
|
|
|
|
|
SourceSkuId string // 源skuId
|
|
|
|
|
SourceStatus uint // 供应商状态 1=上架 2=下架
|
|
|
|
|
CustomerPrice decimal.Decimal // 供货最高价
|
|
|
|
|
CustomerProfitRate decimal.Decimal // 供货利润率 供货利润/供货最高价%
|
|
|
|
|
AdjustType uint // 加价类型
|
|
|
|
|
AdjustPrice decimal.Decimal // 加价金额
|
|
|
|
|
Handle uint // 1=未处理 2=已处理
|
|
|
|
|
Reason string // 驳回原因
|
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
Name string `json:"name"` // 名称
|
|
|
|
|
BrandName string `json:"brandName"` // 品牌名称
|
|
|
|
|
FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id
|
|
|
|
|
SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id
|
|
|
|
|
ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id
|
|
|
|
|
SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价
|
|
|
|
|
GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价
|
|
|
|
|
ImgUrl string `json:"imgUrl"` // 商品主图
|
|
|
|
|
PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架
|
|
|
|
|
SourceName string `json:"sourceName"` // 供应商名称
|
|
|
|
|
SourceSkuId string `json:"sourceSkuId"` // 源skuId
|
|
|
|
|
SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架
|
|
|
|
|
CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价
|
|
|
|
|
CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价%
|
|
|
|
|
AdjustType uint `json:"adjustType"` // 加价类型
|
|
|
|
|
AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额
|
|
|
|
|
Handle uint `json:"handle"` // 1=未处理 2=已处理
|
|
|
|
|
Reason string `json:"reason"` // 驳回原因
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
|
func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) (reply ReplySkuList, err error) {
|
|
|
|
|
err = client.GetClient(s).Call(ctx, "Lists", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
err = xClient.Call(ctx, "Lists", args, &reply)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -175,7 +188,11 @@ type SkuInfo struct {
|
|
|
|
|
|
|
|
|
|
// Info @Title 商品信息
|
|
|
|
|
func (s *sku) Info(ctx context.Context, skuId uint) (reply SkuInfo, err error) {
|
|
|
|
|
err = client.GetClient(s).Call(ctx, "Info", skuId, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
err = xClient.Call(ctx, "Info", skuId, &reply)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -190,13 +207,21 @@ type ArgsSkuDownShelves struct {
|
|
|
|
|
// OnShelves @Title 上架
|
|
|
|
|
func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
return client.GetClient(s).Call(ctx, "OnShelves", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "OnShelves", args, &reply)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DownShelves @Title 下架
|
|
|
|
|
func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
return client.GetClient(s).Call(ctx, "DownShelves", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "DownShelves", args, &reply)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ArgsSkuAdjustType struct {
|
|
|
|
@ -209,5 +234,9 @@ type ArgsSkuAdjustType struct {
|
|
|
|
|
// EditAdjust @Title 修改改价类型
|
|
|
|
|
func (s *sku) EditAdjust(ctx context.Context, args ArgsSkuAdjustType) error {
|
|
|
|
|
reply := 0
|
|
|
|
|
return client.GetClient(s).Call(ctx, "EditAdjust", args, &reply)
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return xClient.Call(ctx, "EditAdjust", args, &reply)
|
|
|
|
|
}
|
|
|
|
|