From b54cac2dff81b11c66a0cbe9248248bdfcbe1853 Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Thu, 15 Jul 2021 10:51:18 +0800 Subject: [PATCH] refactor:fix --- api/rest/order/method.go | 16 ++++++++-------- api/rest/order/order.go | 2 +- api/rest/order/submit.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/rest/order/method.go b/api/rest/order/method.go index 540c7bb..4f162b2 100644 --- a/api/rest/order/method.go +++ b/api/rest/order/method.go @@ -37,17 +37,17 @@ type GetMethodResponse struct { } `json:"result"` } -type shipmentType uint +type ShipmentType uint const ( - JdSelf shipmentType = iota + 1 + JdSelf ShipmentType = iota + 1 JdOther Third Normal NotSupport = 9 ) -var shipmentTypeMap = map[shipmentType]string{ +var shipmentTypeMap = map[ShipmentType]string{ JdSelf: "京东配送", JdOther: "京配转三方配送", Third: "第三方配送", @@ -55,7 +55,7 @@ var shipmentTypeMap = map[shipmentType]string{ NotSupport: "不支持配送", } -func (o shipmentType) String() string { +func (o ShipmentType) String() string { if value, ok := shipmentTypeMap[o]; !ok { return rest.UnKnow } else { @@ -64,7 +64,7 @@ func (o shipmentType) String() string { } type GetMethodParams struct { - ShipmentType shipmentType `json:"shipmentType"` + ShipmentType ShipmentType `json:"ShipmentType"` ShipmentInfoList []ShipmentInfoParams `json:"shipmentInfoList"` } @@ -74,17 +74,17 @@ type ShipmentInfoParams struct { } type ShipmentDetailParams struct { - ShipmentType shipmentType `json:"shipmentType"` + ShipmentType ShipmentType `json:"ShipmentType"` AttachmentList []Attachment `json:"attachmentList"` GiftList []Gift `json:"giftList"` } type Attachment struct { SkuID string `json:"skuId"` - ShipmentType shipmentType `json:"shipmentType"` + ShipmentType ShipmentType `json:"ShipmentType"` } type Gift struct { SkuID string `json:"skuId"` - ShipmentType shipmentType `json:"shipmentType"` + ShipmentType ShipmentType `json:"ShipmentType"` } diff --git a/api/rest/order/order.go b/api/rest/order/order.go index 03999c7..38e6380 100644 --- a/api/rest/order/order.go +++ b/api/rest/order/order.go @@ -45,7 +45,7 @@ type Detail struct { } type ShipmentParam struct { - ShipmentType uint `json:"shipmentType"` + ShipmentType uint `json:"ShipmentType"` } type RelateFee struct { diff --git a/api/rest/order/submit.go b/api/rest/order/submit.go index 1ae05fa..948ac7d 100644 --- a/api/rest/order/submit.go +++ b/api/rest/order/submit.go @@ -19,7 +19,7 @@ type Param struct { Address rest.Address `json:"address"` Receiver ReceiverParam `json:"receiver"` PaymentType uint `json:"paymentType"` - ShipmentType shipmentType `json:"shipmentType"` + ShipmentType ShipmentType `json:"ShipmentType"` ChannelOrderSource string `json:"channelOrderSource"` SendGoods uint `json:"sendGoods"` UserIp string `json:"userIp"`