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

102 lines
3.3 KiB

3 years ago
package order
import (
"git.oa00.com/go/jcook-sdk/api/rest"
)
// SubmitOrderRequest 提交order.
type SubmitOrderRequest struct {
CtpProtocol rest.CtpProtocol `json:"protocol"`
OrderParam Param `json:"param"`
}
type Param struct {
ChannelOrderID string `json:"channelOrderId"`
Pin string `json:"pin"`
ProductList []ProductParam `json:"productList"`
OrderFee float64 `json:"orderFee"`
FreightFee float64 `json:"freightFee"`
Address rest.Address `json:"address"`
Receiver ReceiverParam `json:"receiver"`
PaymentType uint `json:"paymentType"`
3 years ago
ShipmentType ShipmentType `json:"ShipmentType"`
3 years ago
ChannelOrderSource string `json:"channelOrderSource"`
SendGoods uint `json:"sendGoods"`
UserIp string `json:"userIp"`
}
type ProductParam struct {
3 years ago
MainSku rest.SkuParam `json:"mainSku"`
3 years ago
}
type ReceiverParam struct {
ReceiverName string `json:"receiverName"`
ReceiverMobile string `json:"receiverMobile"`
ReceiverEmail string `json:"receiverEmail"`
ZipCode string `json:"zipCode"`
}
type VatAddressParam struct {
VatProvinceID uint `json:"vatProvinceId"`
VatCityID uint `json:"vatCityId"`
VatCountyID uint `json:"vatCountyId"`
VatTownID uint `json:"vatTownId"`
VatFullAddress string `json:"vatFullAddress"`
}
type VatInvoiceParam struct {
CompanyName string `json:"companyName"`
Code string `json:"code"`
RegAddr string `json:"regAddr"`
RegPhone string `json:"regPhone"`
RegBank string `json:"regBank"`
RegBankAccount string `json:"regBankAccount"`
ConsigneeName string `json:"consigneeName"`
ConsigneeMobile string `json:"consigneeMobile"`
VatAddress VatAddressParam `json:"vatAddress"`
}
type ElectronicInvoiceParam struct {
SelectedInvoiceTitle string `json:"selectedInvoiceTitle"`
ElectCompanyName string `json:"electCompanyName"`
ElectCode string `json:"electCode"`
InvoiceConsigneeEmail string `json:"invoiceConsigneeEmail"`
InvoiceConsigneePhone string `json:"invoiceConsigneePhone"`
}
type InvoiceParam struct {
InvoiceType uint `json:"invoiceType"`
VatInvoice VatInvoiceParam `json:"vatInvoice"`
ElectronicInvoice ElectronicInvoiceParam `json:"electronicInvoice"`
}
func (o SubmitOrderRequest) GetApiName() string {
return "jingdong.ctp.order.submitOrder"
}
func (o SubmitOrderRequest) GetRespName() string {
return "jingdong_ctp_order_submitOrder_responce"
}
func (o SubmitOrderRequest) GetRespObj() interface{} {
return SubmitOrderResponse{}
}
//SubmitOrderResponse 提交订单返回.
type SubmitOrderResponse struct {
Result struct {
ErrCode uint `json:"errCode"`
ErrMsg string `json:"errMsg"`
Success bool `json:"success"`
Data SubmitOrderParam `json:"data"`
SubErrCode string `json:"subErrCode"`
SubErrMsg string `json:"subErrMsg"`
3 years ago
} `json:"result"`
}
type SubmitOrderParam struct {
ChannelID uint `json:"channelId"`
ChannelOrderID string `json:"channelOrderId"`
OrderID uint `json:"orderId"`
}