From 866d1754634860754d8084a3872dcadbcae993a5 Mon Sep 17 00:00:00 2001 From: kanade Date: Sun, 25 Sep 2022 16:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/afterService.go | 19 +++++++++++++------ supply/interface/afterService.go | 12 ++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index 8ab9367..68c28af 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -8,22 +8,29 @@ import ( type afterService struct { } -type ArgsAfterServiceType struct { +type ArgsAfterServiceCan struct { OrderSn string // 订单编号 SkuId uint // skuId } -type ReplyAfterServiceType struct { - Type string `json:"type"` // 类型 +type ReplyAfterServiceCan struct { + CanApply uint `json:"canApply"` // 是否可申请售后 1=可申请 2=不可申请 + SkuId uint `json:"skuId"` // skuId + AppliedNum uint `json:"appliedNum"` // 已申请售后商品数量 + CannotApplyTip string `json:"cannotApplyTip"` // 不可申请原因 + Types []AfterServiceType `json:"types"` +} +type AfterServiceType struct { + TypeId string `json:"typeId"` // 类型 TypeName string `json:"typeName"` // 类型名称 } -// Type @Title 获取可发起的售后类型 -func (a *afterService) Type(ctx context.Context, channelId string, args ArgsAfterServiceType) (reply []ReplyAfterServiceType, err error) { +// Can @Title 获取是否可发起售后 +func (a *afterService) Can(ctx context.Context, channelId string, args ArgsAfterServiceCan) (reply []ReplyAfterServiceCan, err error) { xClient, err := client.GetClient(a) if err != nil { return } - err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Type", args, &reply) + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Can", args, &reply) return } diff --git a/supply/interface/afterService.go b/supply/interface/afterService.go index 2c58390..0c546b5 100644 --- a/supply/interface/afterService.go +++ b/supply/interface/afterService.go @@ -31,13 +31,13 @@ type ArgsAfterServiceCan struct { SkuId string // skuId } type ReplyAfterServiceCan struct { - CanApply uint `json:"canApply"` // 是否可申请售后 1=可申请 2=不可申请 - SkuId string `json:"skuId"` // skuId - AppliedNum uint `json:"appliedNum"` // 已申请售后商品数量 - CannotApplyTip string `json:"cannotApplyTip"` // 不可申请原因 - Types []ReplyAfterServiceType `json:"types"` + CanApply uint `json:"canApply"` // 是否可申请售后 1=可申请 2=不可申请 + SkuId string `json:"skuId"` // skuId + AppliedNum uint `json:"appliedNum"` // 已申请售后商品数量 + CannotApplyTip string `json:"cannotApplyTip"` // 不可申请原因 + Types []AfterServiceType `json:"types"` } -type ReplyAfterServiceType struct { +type AfterServiceType struct { TypeId string `json:"type"` // 类型 TypeName string `json:"typeName"` // 类型名称 }