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 ( CancelFail cancelStatus = 1 CancelSuccess cancelStatus = 3 ) var cancelStatusMap = map[cancelStatus]string{ 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"` }