From b5f043b55a541c4014d2d73b039d9194ae633b36 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 12:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 52 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index 85c9113..cb0a898 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -92,20 +92,62 @@ func (a *afterService) Receipt(ctx context.Context, args ArgsAfterServiceReceipt return } -type ArgsAfterServiceReject struct { +type ArgsAfterServiceClose struct { + Source source `json:"source"` SourceAfsSn string `json:"sourceAfsSn"` SourceSkuId string `json:"sourceSkuId"` - SourceOrderSN string `json:"sourceOrderSN"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` +} + +// Close @Title 关闭售后单 +func (a *afterService) Close(ctx context.Context, args ArgsAfterServiceClose) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + err = xClient.Call(ctx, "Close", args, &reply) + return +} + +type ArgsAfterServiceRefund struct { + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + RefundFee decimal.Decimal `json:"refundFee"` +} + +// Refund @Title 退款 +func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceClose) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + err = xClient.Call(ctx, "Refund", args, &reply) + return +} + +type ArgsAfterServiceNewOrder struct { + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + NewSourceOrderSn decimal.Decimal `json:"newSourceOrderSn"` } -// Reject @Title 驳回 -func (a *afterService) Reject(ctx context.Context, args ArgsAfterServiceReject) (err error) { +// NewOrder @Title 新订单 +func (a *afterService) NewOrder(ctx context.Context, args ArgsAfterServiceNewOrder) (err error) { xClient, err := client.GetClient(a) if err != nil { return err } reply := 0 - err = xClient.Call(ctx, "Reject", args, &reply) + err = xClient.Call(ctx, "NewOrder", args, &reply) return }