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.
91 lines
2.2 KiB
91 lines
2.2 KiB
package order
|
|
|
|
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 {
|
|
Address rest.Address `json:"address"`
|
|
Pin string `json:"pin"`
|
|
PaymentType uint `json:"paymentType"`
|
|
SkuList []rest.SkuParam `json:"skuList"`
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
type ShipmentType uint
|
|
|
|
const (
|
|
JdSelf ShipmentType = iota + 1
|
|
JdOther
|
|
Third
|
|
Normal
|
|
NotSupport = 9
|
|
)
|
|
|
|
var shipmentTypeMap = map[ShipmentType]string{
|
|
JdSelf: "京东配送",
|
|
JdOther: "京配转三方配送",
|
|
Third: "第三方配送",
|
|
Normal: "普通快递配送",
|
|
NotSupport: "不支持配送",
|
|
}
|
|
|
|
func (o ShipmentType) String() string {
|
|
if value, ok := shipmentTypeMap[o]; !ok {
|
|
return rest.UnKnow
|
|
} else {
|
|
return value
|
|
}
|
|
}
|
|
|
|
type GetMethodParams struct {
|
|
ShipmentType ShipmentType `json:"ShipmentType"`
|
|
ShipmentInfoList []ShipmentInfoParams `json:"shipmentInfoList"`
|
|
}
|
|
|
|
type ShipmentInfoParams struct {
|
|
SkuID string `json:"skuId"`
|
|
ShipmentDetail ShipmentDetailParams `json:"shipmentDetail"`
|
|
}
|
|
|
|
type ShipmentDetailParams struct {
|
|
ShipmentType ShipmentType `json:"ShipmentType"`
|
|
AttachmentList []Attachment `json:"attachmentList"`
|
|
GiftList []Gift `json:"giftList"`
|
|
}
|
|
|
|
type Attachment struct {
|
|
SkuID string `json:"skuId"`
|
|
ShipmentType ShipmentType `json:"ShipmentType"`
|
|
}
|
|
|
|
type Gift struct {
|
|
SkuID string `json:"skuId"`
|
|
ShipmentType ShipmentType `json:"ShipmentType"`
|
|
}
|