From 57d6339beed962962cffee7645f53f22482f45de Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 4 Mar 2026 14:47:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(cost):=20=E4=BF=AE=E6=94=B9=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 ReplyCostAdd 结构体定义,包含 CostId 字段 - 修改 Add 方法返回值,从无返回改为返回 ReplyCostAdd 结构 - 更新方法实现以正确处理新返回结构 - 保持原有的客户端调用逻辑不变 --- erp/request/cost.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erp/request/cost.go b/erp/request/cost.go index 7556c32..277b766 100644 --- a/erp/request/cost.go +++ b/erp/request/cost.go @@ -54,15 +54,18 @@ type ArgsCostAdd struct { Remarks string // 备注 InvoiceSerial string // 发票号 } +type ReplyCostAdd struct { + CostId int64 `json:"costId"` +} // Add @TITLE 添加 -func (c *cost) Add(ctx context.Context, args ArgsCostAdd) (err error) { +func (c *cost) Add(ctx context.Context, args ArgsCostAdd) (reply ReplyCostAdd, err error) { xClient, err := client.GetClient(c) if err != nil { return } - reply := 0 - return xClient.Call(ctx, "Add", args, &reply) + err = xClient.Call(ctx, "Add", args, &reply) + return } type ArgsCostEdit struct {