feat(expense): 修改费用添加接口返回值结构
- 新增 ReplyCostAdd 结构体定义,包含 CostId 字段 - 修改 Add 方法返回值,从无返回值改为返回 ReplyCostAdd 结构 - 更新 RPC 调用逻辑,正确处理返回数据结构 - 移除局部变量声明,优化函数内部实现
This commit is contained in:
@@ -57,14 +57,18 @@ type ArgsCostAdd struct {
|
|||||||
InvoiceSerial string // 发票编号
|
InvoiceSerial string // 发票编号
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ReplyCostAdd struct {
|
||||||
|
CostId int64 `json:"costId"`
|
||||||
|
}
|
||||||
|
|
||||||
// Add @TITLE 添加
|
// 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)
|
xClient, err := client.GetClient(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
reply := 0
|
err = xClient.Call(ctx, "Add", args, &reply)
|
||||||
return xClient.Call(ctx, "Add", args, &reply)
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsCostEdit struct {
|
type ArgsCostEdit struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user