package order import "git.oa00.com/go/jcook-sdk/api/rest" // CancelOrderRequest 取消订单. type CancelOrderRequest struct { CustomerID uint `json:"customerId"` AppKey string `json:"appKey"` ChannelID uint `json:"channelId"` OrderID uint `json:"orderId"` Pin string `json:"pin"` CancelReasonCode uint `json:"cancelReasonCode"` } func (o CancelOrderRequest) GetApiName() string { return "jingdong.ctp.order.cancelOrder" } func (o CancelOrderRequest) GetRespName() string { return "jingdong_ctp_order_cancelOrder_responce" } func (o CancelOrderRequest) GetRespObj() interface{} { return CancelOrderResponse{} } // CancelOrderResponse 取消订单返回. type CancelOrderResponse struct { Result struct { ErrCode uint `json:"errCode"` ErrMsg string `json:"errMsg"` Success bool `json:"success"` Data CancelParam `json:"data"` } `json:"result"` } type CancelStatus uint const ( CancelNot CancelStatus = 0 CancelFail CancelStatus = 1 CancelSuccess CancelStatus = 3 ) var cancelStatusMap = map[CancelStatus]string{ CancelNot: "不可取消", CancelFail: "取消失败", CancelSuccess: "取消成功", } func (o CancelStatus) String() string { if value, ok := cancelStatusMap[o]; !ok { return rest.UnKnow } else { return value } } type CancelParam struct { CancelStatus CancelStatus `json:"CancelStatus"` }