diff --git a/api/rest/base.go b/api/rest/base.go index 1445334..2183d5e 100644 --- a/api/rest/base.go +++ b/api/rest/base.go @@ -20,6 +20,13 @@ type Requester interface { const UnKnow = "UnKnow" +type SkuParam struct { + SkuID string `json:"skuId"` + SkuPrice float64 `json:"skuPrice"` + Quantity uint `json:"quantity"` + SkuName string `json:"skuName"` +} + type Address struct { CityID uint `json:"cityId"` CountyID uint `json:"countyId"` diff --git a/api/rest/logisitics/fee.go b/api/rest/logisitics/fee.go index 5b6623e..1152250 100644 --- a/api/rest/logisitics/fee.go +++ b/api/rest/logisitics/fee.go @@ -10,19 +10,12 @@ type GetFeeRequest struct { ApiFreightFeeParam ApiFreightFeeParam `json:"apiFreightFeeParam"` } -type SkuInfo struct { - SkuPrice float64 `json:"skuPrice"` - SkuID string `json:"skuId"` - SkuName string `json:"skuName"` - Quantity uint `json:"quantity"` -} - type ApiFreightFeeParam struct { - Address rest.Address `json:"address"` - Pin string `json:"pin"` - PaymentType uint `json:"paymentType"` - OrderFee float64 `json:"orderFee"` - SkuList []SkuInfo `json:"skuList"` + Address rest.Address `json:"address"` + Pin string `json:"pin"` + PaymentType uint `json:"paymentType"` + OrderFee float64 `json:"orderFee"` + SkuList []rest.SkuParam `json:"skuList"` } func (o GetFeeRequest) GetApiName() string { diff --git a/api/rest/logisitics/method.go b/api/rest/logisitics/method.go index 3496095..cc55372 100644 --- a/api/rest/logisitics/method.go +++ b/api/rest/logisitics/method.go @@ -9,10 +9,10 @@ type GetMethodRequest struct { } type ApiShipmentTypeParam struct { - Address rest.Address `json:"address"` - Pin string `json:"pin"` - PaymentType uint `json:"paymentType"` - SkuList []SkuInfo `json:"skuList"` + Address rest.Address `json:"address"` + Pin string `json:"pin"` + PaymentType uint `json:"paymentType"` + SkuList []rest.SkuParam `json:"skuList"` } func (o GetMethodRequest) GetApiName() string { diff --git a/api/rest/order/submit.go b/api/rest/order/submit.go index 7bb33ed..1d6e7a7 100644 --- a/api/rest/order/submit.go +++ b/api/rest/order/submit.go @@ -26,14 +26,7 @@ type Param struct { } type ProductParam struct { - MainSku SkuParam `json:"mainSku"` -} - -type SkuParam struct { - SkuID string `json:"skuId"` - SkuPrice float64 `json:"skuPrice"` - Quantity uint `json:"quantity"` - SkuName string `json:"skuName"` + MainSku rest.SkuParam `json:"mainSku"` } type ReceiverParam struct {