feat(expense): 修改费用添加接口返回值结构

- 新增 ReplyCostAdd 结构体定义,包含 CostId 字段
- 修改 Add 方法返回值,从无返回值改为返回 ReplyCostAdd 结构
- 更新 RPC 调用逻辑,正确处理返回数据结构
- 移除局部变量声明,优化函数内部实现
This commit is contained in:
2026-03-04 14:37:49 +08:00
parent 97c554b554
commit e20507aaee

View File

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