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/interface/order.go

89 lines
2.9 KiB

package _interface
import (
"context"
"github.com/shopspring/decimal"
)
type OrderInterface interface {
// FreightFee 获取运费
FreightFee(ctx context.Context, args ArgsOrderFreightFee, freightFee *ReplyOrderFreightFee) error
// Submit 下单
Submit(ctx context.Context, args ArgsOrderSubmit, sourceOrderSn *string) error
// LadingBill @Title 提单
LadingBill(ctx context.Context, orderSn string, reply *int) error
// Close @Title 关闭订单
Close(ctx context.Context, orderSn string, reply *int) error
// Cancel @Title 取消订单
Cancel(ctx context.Context, args ArgsOrderCancel, reply *int) error
// Trajectory @Title 物流轨迹
Trajectory(ctx context.Context, orderSn string, reply *[]ReplyTrajectory) error
// Finish @Title 确认收货
Finish(ctx context.Context, orderSn string, reply *int) error
// SubmitData @Title 订单下单数据
SubmitData(ctx context.Context, supplyOrderSn string, reply *ReplySubmitData) error
}
type ArgsOrderCancel struct {
OrderSn string // 订单编号
Reason string // 取消原因
}
type ArgsOrderFreightFee struct {
Skus []OrderFreightFeeSkuItem // 商品信息
Address string // 地址
}
type ReplyOrderFreightFee struct {
FreightFee decimal.Decimal // 运费
ErrMsg string // 错误信息
}
type OrderFreightFeeSkuItem struct {
SourceSkuId string // 源skuId
SourceSkuPrice decimal.Decimal // 采购价
Quantity uint // 数量
}
type ArgsOrderSubmit struct {
2 years ago
OrderSn uint64 // 订单号
Skus []OrderFreightFeeSkuItem // 商品信息
Address string // 地址
FreightFee decimal.Decimal // 运费
Receiver OrderReceiver // 收件信息
UserIp string // 用户ip
5 months ago
BuyerMsg string // 用户备注
}
type OrderReceiver struct {
Name string // 姓名
Phone string // 手机号
Email string // 邮件
ZipCode string // 邮编
}
type ReplyTrajectory struct {
LogisticsName string `json:"logisticsName"`
WaybillCode string `json:"waybillCode"`
Steps []PackageStep `json:"steps"`
}
type PackageStep struct {
State string `json:"state"`
Content string `json:"content"`
OperatorAt int64 `json:"operatorAt"`
}
type ReplySubmitData struct {
OrderSn string `json:"orderSn"`
Status int64 `json:"status"`
OrderFee decimal.Decimal `json:"orderFee"`
FreightFee decimal.Decimal `json:"freightFee"`
LadingBillAt int64 `json:"ladingBillAt"`
Skus []ReplySubmitDataSku `json:"skus"`
}
type ReplySubmitDataSku struct {
SkuId string `json:"skuId"`
Name string `json:"name"`
Quantity int64 `json:"quantity"`
SupplyPrice decimal.Decimal `json:"supplyPrice"`
GuidePrice decimal.Decimal `json:"guidePrice"`
Amount decimal.Decimal `json:"amount"`
}