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"` // 类型名称 }