diff --git a/api/rest/afs/afsCanQuery.go b/api/rest/afs/afsCanQuery.go index fe024e9..752300f 100644 --- a/api/rest/afs/afsCanQuery.go +++ b/api/rest/afs/afsCanQuery.go @@ -14,19 +14,19 @@ type CanApplyInfoParam struct { OrderID uint `json:"orderId"` } -type canApplyType uint +type CanApplyType uint const ( - CannotApply canApplyType = iota + CannotApply CanApplyType = iota CanApply ) -var canApplyTypeMap = map[canApplyType]string{ +var canApplyTypeMap = map[CanApplyType]string{ CannotApply: "不可申请", CanApply: "可申请", } -func (o canApplyType) String() string { +func (o CanApplyType) String() string { if value, ok := canApplyTypeMap[o]; !ok { return rest.UnKnow } else { @@ -34,19 +34,19 @@ func (o canApplyType) String() string { } } -type returnType uint +type ReturnType uint const ( - Return returnType = 10 - Exchange returnType = 20 + Return ReturnType = 10 + Exchange ReturnType = 20 ) -var returnTypeMap = map[returnType]string{ +var returnTypeMap = map[ReturnType]string{ Return: "退货", Exchange: "换货", } -func (o returnType) String() string { +func (o ReturnType) String() string { if value, ok := returnTypeMap[o]; !ok { return rest.UnKnow } else { @@ -77,7 +77,7 @@ type CanAfterSaleResponse struct { } type CanAfterSaleParams struct { - CanApply canApplyType `json:"canApply"` + CanApply CanApplyType `json:"canApply"` SkuID uint `json:"skuId"` AppliedNum uint `json:"appliedNum"` CannotApplyTip string `json:"cannotApplyTip"` @@ -87,5 +87,5 @@ type CanAfterSaleParams struct { type SupportParams struct { AfsTypeName string `json:"afsTypeName"` - AfsType returnType `json:"afsType"` + AfsType ReturnType `json:"afsType"` } diff --git a/api/rest/afs/afsCancel.go b/api/rest/afs/afsCancel.go index 3b1bd21..43bc6de 100644 --- a/api/rest/afs/afsCancel.go +++ b/api/rest/afs/afsCancel.go @@ -30,21 +30,21 @@ type CancelAfsResponse struct { } `json:"result"` } -type cancelState uint +type CancelState uint const ( - CancelStateNot cancelState = iota + 1 + CancelStateNot CancelState = iota + 1 CancelStateSuccess CancelStateFail ) -var cancelStateMap = map[cancelState]string{ +var cancelStateMap = map[CancelState]string{ CancelStateNot: "不可取消", CancelStateSuccess: "取消成功", CancelStateFail: "取消失败", } -func (o cancelState) String() string { +func (o CancelState) String() string { if value, ok := cancelStateMap[o]; !ok { return rest.UnKnow } else { @@ -53,5 +53,5 @@ func (o cancelState) String() string { } type CancelAfsParams struct { - CancelState cancelState `json:"cancelState"` + CancelState CancelState `json:"CancelState"` } diff --git a/api/rest/afs/afsCreate.go b/api/rest/afs/afsCreate.go index 6e1c128..ac9fa82 100644 --- a/api/rest/afs/afsCreate.go +++ b/api/rest/afs/afsCreate.go @@ -19,7 +19,7 @@ type ApplyParam struct { ApplyReasonID uint `json:"applyReasonId"` Pin string `json:"pin"` ChannelAfsApplyID string `json:"channelAfsApplyId"` - AfsType returnType `json:"afsType"` + AfsType ReturnType `json:"afsType"` QuestionPic string `json:"questionPic"` OrderID uint `json:"orderId"` SkuQuantity SkuQuantityParam `json:"skuQuantity"` diff --git a/api/rest/afs/afsDetail.go b/api/rest/afs/afsDetail.go index 71c247f..135c7d2 100644 --- a/api/rest/afs/afsDetail.go +++ b/api/rest/afs/afsDetail.go @@ -36,25 +36,25 @@ type GetAfsResponse struct { } type GetAfsParams struct { - ProcessResult uint `json:"processResult"` - CustomerName string `json:"customerName"` - ApplyReasonID uint `json:"applyReasonId"` - ApplyReasonName string `json:"applyReasonName"` - ApproveResult uint `json:"approveResult"` - AfsApplyTime int64 `json:"afsApplyTime"` - ApproveResultName string `json:"approveResultName"` - ProcessResultName string `json:"processResultName"` - AfsType returnType `json:"afsType"` - ReturnWareType uint `json:"returnWareType"` - CustomerMobile string `json:"customerMobile"` - QuestionPic string `json:"questionPic"` - ApproveNotes string `json:"approveNotes"` - ApprovedDate int64 `json:"approvedDate"` - CustomerEmail string `json:"customerEmail"` - ProcessedDate int64 `json:"processedDate"` - AfsApplyID uint `json:"afsApplyId"` - AfsTypeName string `json:"afsTypeName"` - Pin string `json:"pin"` + ProcessResult uint `json:"processResult"` + CustomerName string `json:"customerName"` + ApplyReasonID uint `json:"applyReasonId"` + ApplyReasonName string `json:"applyReasonName"` + ApproveResult uint `json:"approveResult"` + AfsApplyTime int64 `json:"afsApplyTime"` + ApproveResultName string `json:"approveResultName"` + ProcessResultName string `json:"processResultName"` + AfsType ReturnType `json:"afsType"` + ReturnWareType uint `json:"returnWareType"` + CustomerMobile string `json:"customerMobile"` + QuestionPic string `json:"questionPic"` + ApproveNotes string `json:"approveNotes"` + ApprovedDate int64 `json:"approvedDate"` + CustomerEmail string `json:"customerEmail"` + ProcessedDate int64 `json:"processedDate"` + AfsApplyID uint `json:"afsApplyId"` + AfsTypeName string `json:"afsTypeName"` + Pin string `json:"pin"` AfsServiceState uint `json:"afsServiceState"` AfsServiceID uint `json:"afsServiceId"` NewOrderID uint `json:"newOrderId"` diff --git a/api/rest/afs/afsReason.go b/api/rest/afs/afsReason.go index e4b0378..9a46a72 100644 --- a/api/rest/afs/afsReason.go +++ b/api/rest/afs/afsReason.go @@ -6,7 +6,7 @@ type ApplyReasonParam struct { Pin string `json:"pin"` SkuID uint `json:"skuId"` OrderID uint `json:"orderId"` - AfsType returnType `json:"afsType"` + AfsType ReturnType `json:"afsType"` } // QueryAfterSaleReasonRequest 查询售后原因. diff --git a/api/rest/order/cancel.go b/api/rest/order/cancel.go index 2fd0d22..1b8a304 100644 --- a/api/rest/order/cancel.go +++ b/api/rest/order/cancel.go @@ -34,21 +34,21 @@ type CancelOrderResponse struct { } `json:"result"` } -type cancelStatus uint +type CancelStatus uint const ( - CancelNot cancelStatus = 0 - CancelFail cancelStatus = 1 - CancelSuccess cancelStatus = 3 + CancelNot CancelStatus = 0 + CancelFail CancelStatus = 1 + CancelSuccess CancelStatus = 3 ) -var cancelStatusMap = map[cancelStatus]string{ +var cancelStatusMap = map[CancelStatus]string{ CancelNot: "不可取消", CancelFail: "取消失败", CancelSuccess: "取消成功", } -func (o cancelStatus) String() string { +func (o CancelStatus) String() string { if value, ok := cancelStatusMap[o]; !ok { return rest.UnKnow } else { @@ -57,5 +57,5 @@ func (o cancelStatus) String() string { } type CancelParam struct { - CancelStatus cancelStatus `json:"cancelStatus"` + CancelStatus CancelStatus `json:"CancelStatus"` } diff --git a/api/rest/order/order.go b/api/rest/order/order.go index 38e6380..fb25f10 100644 --- a/api/rest/order/order.go +++ b/api/rest/order/order.go @@ -67,10 +67,10 @@ type SkuDetailParam struct { MainSkuID uint `json:"mainSkuId"` } -type status int +type Status int const ( - Submit status = 0 + Submit Status = 0 WaitPay = 1 IsPay = 4 WaitPrint = 6 @@ -83,7 +83,7 @@ const ( Cancel = -100 ) -var statusMap = map[status]string{ +var statusMap = map[Status]string{ Submit: "提单成功", WaitPay: "等待付款", IsPay: "已支付", @@ -97,7 +97,7 @@ var statusMap = map[status]string{ Cancel: "已取消", } -func (o status) String() string { +func (o Status) String() string { if value, ok := statusMap[o]; !ok { return rest.UnKnow } else { @@ -131,7 +131,7 @@ func (o typeState) String() string { type BaseOrder struct { RootOrderID uint `json:"rootOrderId"` - OrderStatus status `json:"orderStatus"` + OrderStatus Status `json:"orderStatus"` SubmitTime int64 `json:"submitTime"` CompleteTime int64 `json:"completeTime"` PayTime int64 `json:"payTime"`