refactor:fix

master v1.0.7
大虾 4 years ago
parent cddb3ce7a0
commit b54cac2dff

@ -37,17 +37,17 @@ type GetMethodResponse struct {
} `json:"result"` } `json:"result"`
} }
type shipmentType uint type ShipmentType uint
const ( const (
JdSelf shipmentType = iota + 1 JdSelf ShipmentType = iota + 1
JdOther JdOther
Third Third
Normal Normal
NotSupport = 9 NotSupport = 9
) )
var shipmentTypeMap = map[shipmentType]string{ var shipmentTypeMap = map[ShipmentType]string{
JdSelf: "京东配送", JdSelf: "京东配送",
JdOther: "京配转三方配送", JdOther: "京配转三方配送",
Third: "第三方配送", Third: "第三方配送",
@ -55,7 +55,7 @@ var shipmentTypeMap = map[shipmentType]string{
NotSupport: "不支持配送", NotSupport: "不支持配送",
} }
func (o shipmentType) String() string { func (o ShipmentType) String() string {
if value, ok := shipmentTypeMap[o]; !ok { if value, ok := shipmentTypeMap[o]; !ok {
return rest.UnKnow return rest.UnKnow
} else { } else {
@ -64,7 +64,7 @@ func (o shipmentType) String() string {
} }
type GetMethodParams struct { type GetMethodParams struct {
ShipmentType shipmentType `json:"shipmentType"` ShipmentType ShipmentType `json:"ShipmentType"`
ShipmentInfoList []ShipmentInfoParams `json:"shipmentInfoList"` ShipmentInfoList []ShipmentInfoParams `json:"shipmentInfoList"`
} }
@ -74,17 +74,17 @@ type ShipmentInfoParams struct {
} }
type ShipmentDetailParams struct { type ShipmentDetailParams struct {
ShipmentType shipmentType `json:"shipmentType"` ShipmentType ShipmentType `json:"ShipmentType"`
AttachmentList []Attachment `json:"attachmentList"` AttachmentList []Attachment `json:"attachmentList"`
GiftList []Gift `json:"giftList"` GiftList []Gift `json:"giftList"`
} }
type Attachment struct { type Attachment struct {
SkuID string `json:"skuId"` SkuID string `json:"skuId"`
ShipmentType shipmentType `json:"shipmentType"` ShipmentType ShipmentType `json:"ShipmentType"`
} }
type Gift struct { type Gift struct {
SkuID string `json:"skuId"` SkuID string `json:"skuId"`
ShipmentType shipmentType `json:"shipmentType"` ShipmentType ShipmentType `json:"ShipmentType"`
} }

@ -45,7 +45,7 @@ type Detail struct {
} }
type ShipmentParam struct { type ShipmentParam struct {
ShipmentType uint `json:"shipmentType"` ShipmentType uint `json:"ShipmentType"`
} }
type RelateFee struct { type RelateFee struct {

@ -19,7 +19,7 @@ type Param struct {
Address rest.Address `json:"address"` Address rest.Address `json:"address"`
Receiver ReceiverParam `json:"receiver"` Receiver ReceiverParam `json:"receiver"`
PaymentType uint `json:"paymentType"` PaymentType uint `json:"paymentType"`
ShipmentType shipmentType `json:"shipmentType"` ShipmentType ShipmentType `json:"ShipmentType"`
ChannelOrderSource string `json:"channelOrderSource"` ChannelOrderSource string `json:"channelOrderSource"`
SendGoods uint `json:"sendGoods"` SendGoods uint `json:"sendGoods"`
UserIp string `json:"userIp"` UserIp string `json:"userIp"`

Loading…
Cancel
Save