|
|
|
@ -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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|