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.
35 lines
922 B
35 lines
922 B
package supply
|
|
|
|
import "github.com/shopspring/decimal"
|
|
|
|
const (
|
|
orderFreightFee = "/order/freight_fee" // 获取运费
|
|
|
|
ReplyOrderFreightFeeErrCodeNone = 0 // 无错误
|
|
ReplyOrderFreightFeeErrCodeErr = 1 // 有错误
|
|
)
|
|
|
|
type order struct {
|
|
}
|
|
|
|
type OrderFreightFeeItem struct {
|
|
SkuId uint `binding:"required" label:"skuId"`
|
|
Quantity uint `binding:"required" label:"数量"`
|
|
Price decimal.Decimal `binding:"required" label:"价格"`
|
|
}
|
|
type ReplyOrderFreightFee struct {
|
|
SkuIds []uint `json:"skuIds"`
|
|
FreightFee float64 `json:"freightFee"`
|
|
ErrCode uint `json:"errCode"`
|
|
ErrMsg string `json:"errMsg"`
|
|
}
|
|
|
|
// FreightFee @Title 获取运费
|
|
func (o *order) FreightFee(address string, skus []OrderFreightFeeItem) (result []ReplyOrderFreightFee, err error) {
|
|
err = exec(orderFreightFee, map[string]interface{}{
|
|
"address": address,
|
|
"skus": skus,
|
|
}, &result)
|
|
return
|
|
}
|