修改渠道参数

finance
杨赟 2 years ago
parent b79986a288
commit d3d514dad2

@ -4,6 +4,7 @@ import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
"github.com/smallnest/rpcx/share"
)
type order struct {
@ -25,8 +26,8 @@ type ReplyOrderFreightFee struct {
}
// FreightFee @Title 获取运费
func (o *order) FreightFee(ctx context.Context, args ArgsOrderFreightFee) (reply []ReplyOrderFreightFee, err error) {
err = client.GetClient(o).Call(ctx, "FreightFee", args, &reply)
func (o *order) FreightFee(ctx context.Context, channelId string, args ArgsOrderFreightFee) (reply []ReplyOrderFreightFee, err error) {
err = client.GetClient(o).Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "FreightFee", args, &reply)
return
}
@ -50,7 +51,7 @@ type ReplyOrderSubmit struct {
}
// Submit @Title 下单
func (o *order) Submit(ctx context.Context, args ArgsOrderSubmit) (reply []ReplyOrderSubmit, err error) {
err = client.GetClient(o).Call(ctx, "Submit", args, &reply)
func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply []ReplyOrderSubmit, err error) {
err = client.GetClient(o).Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply)
return
}

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

Loading…
Cancel
Save