From e20507aaeec65e60637c516daa2cb47408d8aeff Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 4 Mar 2026 14:37:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(expense):=20=E4=BF=AE=E6=94=B9=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=80=BC=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 结构 - 更新 RPC 调用逻辑,正确处理返回数据结构 - 移除局部变量声明,优化函数内部实现 --- erp/expense/cost.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erp/expense/cost.go b/erp/expense/cost.go index 8b126f2..811cd12 100644 --- a/erp/expense/cost.go +++ b/erp/expense/cost.go @@ -57,14 +57,18 @@ type ArgsCostAdd struct { 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 {