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/cancel.go

62 lines
1.4 KiB

3 years ago
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
3 years ago
const (
CancelNot CancelStatus = 0
CancelFail CancelStatus = 1
CancelSuccess CancelStatus = 3
3 years ago
)
var cancelStatusMap = map[CancelStatus]string{
CancelNot: "不可取消",
3 years ago
CancelFail: "取消失败",
CancelSuccess: "取消成功",
}
func (o CancelStatus) String() string {
3 years ago
if value, ok := cancelStatusMap[o]; !ok {
return rest.UnKnow
} else {
return value
}
}
type CancelParam struct {
CancelStatus CancelStatus `json:"CancelStatus"`
3 years ago
}