You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
service/supply/channel/order.go

58 lines
1.6 KiB

package channel
import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
"github.com/smallnest/rpcx/share"
)
type order struct {
}
type ArgsOrderFreightFee struct {
Address string // 地址
Skus []SkuFreightFeeItem // sku信息
}
type SkuFreightFeeItem struct {
SkuId uint // skuId
Price decimal.Decimal // 价格
Quantity uint // 数量
}
type ReplyOrderFreightFee struct {
SkuIds []uint `json:"skuIds"`
FreightFee decimal.Decimal `json:"freightFee"`
}
// FreightFee @Title 获取运费
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
}
type ArgsOrderSubmit struct {
Address string // 地址
Skus []SkuFreightFeeItem // sku信息
Receiver Receiver // 收件信息
OrderFee decimal.Decimal // 订单金额-不含运费
FreightFee decimal.Decimal // 运费
UserIp string // 下单用户ip
}
type Receiver struct {
Name string // 姓名
Mobile string // 手机号
Email string // 邮箱
ZipCode string // 邮编
}
type ReplyOrderSubmit struct {
}
// Submit @Title 下单
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
}