From b8e902a6857c64a02947e92b2185d57c458c47d7 Mon Sep 17 00:00:00 2001 From: kanade Date: Sun, 25 Sep 2022 16:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=94=AE=E5=90=8E=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/error.go | 56 +++++++++++++++++--------------- supply/interface/afterService.go | 11 ++++--- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/rpc/error.go b/rpc/error.go index f837c89..1892574 100644 --- a/rpc/error.go +++ b/rpc/error.go @@ -5,36 +5,38 @@ type Error uint const ( ErrorSystem Error = 11001 // 系统错误 - ErrorOrderRepeat Error = 11002 // 重复下单 - ErrorOrderFreightFee Error = 11003 // 运费错误 - ErrorOrderSubmit Error = 11004 // 下单失败 - ErrorOrderShipment Error = 11005 // 无法配送 - ErrorOrderSkuPrice Error = 11006 // 商品价格错误 - ErrorOrderAmount Error = 11007 // 订单金额错误 - ErrorOrderLadingBill Error = 11008 // 订单已提单 - ErrorOrderClose Error = 11009 // 订单已关闭 - ErrorOrderTimeOut Error = 11010 // 订单超时 - ErrorOrderError Error = 11011 // 订单错误 - ErrorOrderUnPay Error = 11012 // 订单未支付 - ErrorOrderInvalid Error = 11013 // 订单失效 - ErrorOrderSkuInvalid Error = 11014 // 订单商品错误 + ErrorOrderRepeat Error = 11002 // 重复下单 + ErrorOrderFreightFee Error = 11003 // 运费错误 + ErrorOrderSubmit Error = 11004 // 下单失败 + ErrorOrderShipment Error = 11005 // 无法配送 + ErrorOrderSkuPrice Error = 11006 // 商品价格错误 + ErrorOrderAmount Error = 11007 // 订单金额错误 + ErrorOrderLadingBill Error = 11008 // 订单已提单 + ErrorOrderClose Error = 11009 // 订单已关闭 + ErrorOrderTimeOut Error = 11010 // 订单超时 + ErrorOrderError Error = 11011 // 订单错误 + ErrorOrderUnPay Error = 11012 // 订单未支付 + ErrorOrderInvalid Error = 11013 // 订单失效 + ErrorOrderSkuInvalid Error = 11014 // 订单商品错误 + ErrorAfterServiceTypeError Error = 11015 // 售后类型错误 ) var ErrorCodes = map[Error]string{ - ErrorSystem: "系统错误", - ErrorOrderRepeat: "重复下单", - ErrorOrderFreightFee: "运费错误", - ErrorOrderSubmit: "下单失败", - ErrorOrderShipment: "无法配送", - ErrorOrderSkuPrice: "商品价格错误", - ErrorOrderAmount: "订单金额错误", - ErrorOrderLadingBill: "订单已提单", - ErrorOrderClose: "订单已关闭", - ErrorOrderTimeOut: "订单超时", - ErrorOrderError: "订单错误", - ErrorOrderUnPay: "订单未支付", - ErrorOrderInvalid: "订单失效", - ErrorOrderSkuInvalid: "订单商品错误", + ErrorSystem: "系统错误", + ErrorOrderRepeat: "重复下单", + ErrorOrderFreightFee: "运费错误", + ErrorOrderSubmit: "下单失败", + ErrorOrderShipment: "无法配送", + ErrorOrderSkuPrice: "商品价格错误", + ErrorOrderAmount: "订单金额错误", + ErrorOrderLadingBill: "订单已提单", + ErrorOrderClose: "订单已关闭", + ErrorOrderTimeOut: "订单超时", + ErrorOrderError: "订单错误", + ErrorOrderUnPay: "订单未支付", + ErrorOrderInvalid: "订单失效", + ErrorOrderSkuInvalid: "订单商品错误", + ErrorAfterServiceTypeError: "售后类型错误", } func (e Error) Error() string { diff --git a/supply/interface/afterService.go b/supply/interface/afterService.go index 04c4194..2c58390 100644 --- a/supply/interface/afterService.go +++ b/supply/interface/afterService.go @@ -5,15 +5,18 @@ import ( ) const ( - AfterServiceCanApplyFalse = 1 // 不可申请 - AfterServiceCanApplyTrue = 2 // 可申请 + AfterServiceCanApplyTrue = 1 // 可申请 + AfterServiceCanApplyFalse = 2 // 不可申请 + + AfterServiceNeedPictureTrue = 1 // 需要上传 + AfterServiceNeedPictureFalse = 2 // 不需要上传 ) type AfterServiceInterface interface { // Can 获取是否可发起售后 Can(ctx context.Context, args ArgsAfterServiceCan, reply *ReplyAfterServiceCan) error // Reason 获取售后原因 - Reason(ctx context.Context, args ArgsAfterServiceReason, reply *ReplyAfterServiceReason) error + Reason(ctx context.Context, args ArgsAfterServiceReason, reply *[]ReplyAfterServiceReason) error // Apply @Title 发起售后 Apply(ctx context.Context, args ArgsAfterServiceApply, reply *ReplyAfterServiceApply) error // LogisticsAddress @Title 寄回地址 @@ -28,7 +31,7 @@ type ArgsAfterServiceCan struct { SkuId string // skuId } type ReplyAfterServiceCan struct { - CanApply uint `json:"canApply"` // 是否可申请售后 0=不可申请 1=可申请 + CanApply uint `json:"canApply"` // 是否可申请售后 1=可申请 2=不可申请 SkuId string `json:"skuId"` // skuId AppliedNum uint `json:"appliedNum"` // 已申请售后商品数量 CannotApplyTip string `json:"cannotApplyTip"` // 不可申请原因