|
|
@ -76,7 +76,11 @@ type SkuAttribute struct {
|
|
|
|
// Add @Title 添加商品
|
|
|
|
// Add @Title 添加商品
|
|
|
|
func (s *sku) Add(ctx context.Context, args ArgsSkuAdd) error {
|
|
|
|
func (s *sku) Add(ctx context.Context, args ArgsSkuAdd) error {
|
|
|
|
reply := 0
|
|
|
|
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 {
|
|
|
|
type ArgsSkuAdjust struct {
|
|
|
@ -89,7 +93,11 @@ type ArgsSkuAdjust struct {
|
|
|
|
// Adjust @Title 加价
|
|
|
|
// Adjust @Title 加价
|
|
|
|
func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error {
|
|
|
|
func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error {
|
|
|
|
reply := 0
|
|
|
|
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 {
|
|
|
|
type ArgsSkuLists struct {
|
|
|
@ -138,12 +146,52 @@ type SkuItem struct {
|
|
|
|
AdjustType uint // 加价类型
|
|
|
|
AdjustType uint // 加价类型
|
|
|
|
AdjustPrice decimal.Decimal // 加价金额
|
|
|
|
AdjustPrice decimal.Decimal // 加价金额
|
|
|
|
Handle uint // 1=未处理 2=已处理
|
|
|
|
Handle uint // 1=未处理 2=已处理
|
|
|
|
Imgs []SkuImg
|
|
|
|
Reason string // 驳回原因
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) (reply ReplySkuList, err error) {
|
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type SkuInfo struct {
|
|
|
|
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
|
|
SourceSkuId string `json:"jdSkuId"`
|
|
|
|
|
|
|
|
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
|
|
|
|
|
|
|
GuidePrice decimal.Decimal `json:"guidePrice"`
|
|
|
|
|
|
|
|
Profit decimal.Decimal `json:"profit"`
|
|
|
|
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
|
|
|
|
Color string `json:"color"`
|
|
|
|
|
|
|
|
Size string `json:"size"`
|
|
|
|
|
|
|
|
FirstCategoryName string `json:"firstCategoryName"`
|
|
|
|
|
|
|
|
SecondCategoryName string `json:"secondCategoryName"`
|
|
|
|
|
|
|
|
ThirdCategoryName string `json:"thirdCategoryName"`
|
|
|
|
|
|
|
|
BrandName string `json:"brandName"`
|
|
|
|
|
|
|
|
Content string `json:"content"`
|
|
|
|
|
|
|
|
Tax string `json:"tax"`
|
|
|
|
|
|
|
|
Unit string `json:"unit"`
|
|
|
|
|
|
|
|
Imgs []SkuImg `json:"imgs"`
|
|
|
|
|
|
|
|
Reason string `json:"reason"`
|
|
|
|
|
|
|
|
Specifications []SkuSpecification `json:"specification"`
|
|
|
|
|
|
|
|
PlatformStatus uint `json:"platformStatus"`
|
|
|
|
|
|
|
|
SourceName string `json:"sourceName"`
|
|
|
|
|
|
|
|
AdjustType uint `json:"adjustType"`
|
|
|
|
|
|
|
|
AdjustPrice decimal.Decimal `json:"adjustPrice"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Info @Title 商品信息
|
|
|
|
|
|
|
|
func (s *sku) Info(ctx context.Context, skuId uint) (reply SkuInfo, err error) {
|
|
|
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = xClient.Call(ctx, "Info", skuId, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -158,13 +206,21 @@ type ArgsSkuDownShelves struct {
|
|
|
|
// OnShelves @Title 上架
|
|
|
|
// OnShelves @Title 上架
|
|
|
|
func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error {
|
|
|
|
func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error {
|
|
|
|
reply := 0
|
|
|
|
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 下架
|
|
|
|
// DownShelves @Title 下架
|
|
|
|
func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error {
|
|
|
|
func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error {
|
|
|
|
reply := 0
|
|
|
|
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 {
|
|
|
|
type ArgsSkuAdjustType struct {
|
|
|
@ -177,5 +233,9 @@ type ArgsSkuAdjustType struct {
|
|
|
|
// EditAdjust @Title 修改改价类型
|
|
|
|
// EditAdjust @Title 修改改价类型
|
|
|
|
func (s *sku) EditAdjust(ctx context.Context, args ArgsSkuAdjustType) error {
|
|
|
|
func (s *sku) EditAdjust(ctx context.Context, args ArgsSkuAdjustType) error {
|
|
|
|
reply := 0
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|