|
|
@ -40,6 +40,8 @@ type SkuItem struct {
|
|
|
|
Tax string `json:"tax"`
|
|
|
|
Tax string `json:"tax"`
|
|
|
|
Unit string `json:"unit"`
|
|
|
|
Unit string `json:"unit"`
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
|
|
|
|
TaxName string `json:"taxName"`
|
|
|
|
|
|
|
|
TaxCode string `json:"taxCode"`
|
|
|
|
Status uint `json:"status"`
|
|
|
|
Status uint `json:"status"`
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
|
@ -83,6 +85,8 @@ type SkuDetailItem struct {
|
|
|
|
Tax string `json:"tax"`
|
|
|
|
Tax string `json:"tax"`
|
|
|
|
Unit string `json:"unit"`
|
|
|
|
Unit string `json:"unit"`
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
|
|
|
|
TaxName string `json:"taxName"`
|
|
|
|
|
|
|
|
TaxCode string `json:"taxCode"`
|
|
|
|
Status uint `json:"status"`
|
|
|
|
Status uint `json:"status"`
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
|
@ -115,6 +119,49 @@ func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuPrices struct {
|
|
|
|
|
|
|
|
SkuIds []uint // sku数组
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
type SkuPrice struct {
|
|
|
|
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
|
|
Price decimal.Decimal `json:"price"`
|
|
|
|
|
|
|
|
GuidePrice decimal.Decimal `json:"guidePrice"`
|
|
|
|
|
|
|
|
Profit decimal.Decimal `json:"profit"`
|
|
|
|
|
|
|
|
Status uint `json:"status"`
|
|
|
|
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
|
|
|
|
UpdatedAt int64 `json:"updatedAt"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Prices @Title 获取sku价格
|
|
|
|
|
|
|
|
func (s *sku) Prices(ctx context.Context, channelId string, args ArgsSkuPrices) (reply []SkuPrice, err error) {
|
|
|
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Prices", args, &reply)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuGroups struct {
|
|
|
|
|
|
|
|
SkuIds []uint // sku数组
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type SkuGroup struct {
|
|
|
|
|
|
|
|
SkuId uint `json:"skuId"`
|
|
|
|
|
|
|
|
GroupSkuIds []uint `json:"groupSkuIds"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Groups @Title 获取sku分组信息
|
|
|
|
|
|
|
|
func (s *sku) Groups(ctx context.Context, channelId string, args ArgsSkuGroups) (reply []SkuGroup, err error) {
|
|
|
|
|
|
|
|
xClient, err := client.GetClient(s)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Groups", args, &reply)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuStock struct {
|
|
|
|
type ArgsSkuStock struct {
|
|
|
|
Address string // 地址
|
|
|
|
Address string // 地址
|
|
|
|
Skus []SkuStockItem // sku信息
|
|
|
|
Skus []SkuStockItem // sku信息
|
|
|
|