From 144ac0bb5d6a2308c4de2d8a1bfadb8580e41ce6 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 29 Jul 2025 17:57:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sale):=20=E4=BC=98=E5=8C=96=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=B5=81=E7=A8=8B=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 Append、Change 和 Benefit 函数的返回类型 - 从返回错误改为同时返回 workflowId 和错误 - 移除了不必要的 reply 变量,直接使用 workflowId 接收结果 --- erp/sale/audit.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/erp/sale/audit.go b/erp/sale/audit.go index e59be1e..649aea1 100644 --- a/erp/sale/audit.go +++ b/erp/sale/audit.go @@ -36,13 +36,12 @@ func (a *audit) Cancel(ctx context.Context, args ArgsAuditSubmit) (err error) { } // Append @TITLE 追加商品审核 -func (a *audit) Append(ctx context.Context, args ArgsAuditSubmit) (err error) { +func (a *audit) Append(ctx context.Context, args ArgsAuditSubmit) (workflowId int64, err error) { xClient, err := client.GetClient(a) if err != nil { return } - reply := 0 - err = xClient.Call(ctx, "Append", args, &reply) + err = xClient.Call(ctx, "Append", args, &workflowId) return } @@ -58,13 +57,12 @@ type ChangeProductItem struct { } // Change @TITLE 编辑商品审核 -func (a *audit) Change(ctx context.Context, args ArgsAuditChange) (err error) { +func (a *audit) Change(ctx context.Context, args ArgsAuditChange) (workflowId int64, err error) { xClient, err := client.GetClient(a) if err != nil { return } - reply := 0 - err = xClient.Call(ctx, "Change", args, &reply) + err = xClient.Call(ctx, "Change", args, &workflowId) return } @@ -76,12 +74,11 @@ type ArgsAuditBenefit struct { } // Benefit @TITLE 效益测算审核 -func (a *audit) Benefit(ctx context.Context, args ArgsAuditBenefit) (err error) { +func (a *audit) Benefit(ctx context.Context, args ArgsAuditBenefit) (workflowId int64, err error) { xClient, err := client.GetClient(a) if err != nil { return } - reply := 0 - err = xClient.Call(ctx, "Benefit", args, &reply) + err = xClient.Call(ctx, "Benefit", args, &workflowId) return }