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.
jcook-sdk/api/rest/order/method.go

91 lines
2.2 KiB

package order
3 years ago
import "git.oa00.com/go/jcook-sdk/api/rest"
// GetMethodRequest 获取物流方法.
type GetMethodRequest struct {
CtpProtocol rest.CtpProtocol `json:"protocol"`
ApiShipmentTypeParam ApiShipmentTypeParam `json:"apiShipmentTypeParam"`
}
type ApiShipmentTypeParam struct {
3 years ago
Address rest.Address `json:"address"`
Pin string `json:"pin"`
PaymentType uint `json:"paymentType"`
SkuList []rest.SkuParam `json:"skuList"`
3 years ago
}
func (o GetMethodRequest) GetApiName() string {
return "jingdong.ctp.order.getShipmentType"
}
func (o GetMethodRequest) GetRespName() string {
return "jingdong_ctp_order_getShipmentType_responce"
}
func (o GetMethodRequest) GetRespObj() interface{} {
return GetMethodResponse{}
}
// GetMethodResponse 获取物流轨迹返回.
type GetMethodResponse struct {
Result struct {
Data GetMethodParams `json:"data"`
ErrCode uint `json:"errCode"`
ErrMsg string `json:"errMsg"`
Success bool `json:"success"`
} `json:"result"`
}
3 years ago
type ShipmentType uint
3 years ago
const (
3 years ago
JdSelf ShipmentType = iota + 1
3 years ago
JdOther
Third
Normal
NotSupport = 9
)
3 years ago
var shipmentTypeMap = map[ShipmentType]string{
3 years ago
JdSelf: "京东配送",
JdOther: "京配转三方配送",
Third: "第三方配送",
Normal: "普通快递配送",
NotSupport: "不支持配送",
}
3 years ago
func (o ShipmentType) String() string {
3 years ago
if value, ok := shipmentTypeMap[o]; !ok {
return rest.UnKnow
} else {
return value
}
}
type GetMethodParams struct {
3 years ago
ShipmentType ShipmentType `json:"ShipmentType"`
3 years ago
ShipmentInfoList []ShipmentInfoParams `json:"shipmentInfoList"`
}
type ShipmentInfoParams struct {
SkuID string `json:"skuId"`
ShipmentDetail ShipmentDetailParams `json:"shipmentDetail"`
}
type ShipmentDetailParams struct {
3 years ago
ShipmentType ShipmentType `json:"ShipmentType"`
3 years ago
AttachmentList []Attachment `json:"attachmentList"`
GiftList []Gift `json:"giftList"`
}
type Attachment struct {
SkuID string `json:"skuId"`
3 years ago
ShipmentType ShipmentType `json:"ShipmentType"`
3 years ago
}
type Gift struct {
SkuID string `json:"skuId"`
3 years ago
ShipmentType ShipmentType `json:"ShipmentType"`
3 years ago
}