|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
"git.oa00.com/supply-chain/service/lib/bean"
|
|
|
|
"git.oa00.com/supply-chain/service/lib/bean"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
|
|
|
|
"github.com/smallnest/rpcx/share"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type sku struct {
|
|
|
|
type sku struct {
|
|
|
@ -49,8 +50,8 @@ type ReplySkuList struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
func (s *sku) Lists(ctx context.Context, args ArgsSkuList) (reply ReplySkuList, err error) {
|
|
|
|
func (s *sku) Lists(ctx context.Context, channelId string, args ArgsSkuList) (reply ReplySkuList, err error) {
|
|
|
|
err = client.GetClient(s).Call(ctx, "Lists", args, &reply)
|
|
|
|
err = client.GetClient(s).Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Lists", args, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -101,8 +102,8 @@ type SkuAttribute struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Details @Title 获取sku详情
|
|
|
|
// Details @Title 获取sku详情
|
|
|
|
func (s *sku) Details(ctx context.Context, args ArgsSkuDetails) (reply []SkuDetailItem, err error) {
|
|
|
|
func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails) (reply []SkuDetailItem, err error) {
|
|
|
|
err = client.GetClient(s).Call(ctx, "Details", args, &reply)
|
|
|
|
err = client.GetClient(s).Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Details", args, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -122,7 +123,7 @@ type ReplySkuStock struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Stock @Title 库存查询
|
|
|
|
// Stock @Title 库存查询
|
|
|
|
func (s *sku) Stock(ctx context.Context, args ArgsSkuStock) (reply []ReplySkuStock, err error) {
|
|
|
|
func (s *sku) Stock(ctx context.Context, channelId string, args ArgsSkuStock) (reply []ReplySkuStock, err error) {
|
|
|
|
err = client.GetClient(s).Call(ctx, "Stock", args, &reply)
|
|
|
|
err = client.GetClient(s).Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Stock", args, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|