添加消费接口

finance
杨赟 2 years ago
parent 2c2b6059dc
commit 96877af572

@ -36,3 +36,52 @@ func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error
} }
return xClient.Call(ctx, "Direct", args, &reply) return xClient.Call(ctx, "Direct", args, &reply)
} }
type ArgsWalletCreate struct {
UserId uint // 客户id
WalletType walletType // 收支类型
Amount decimal.Decimal // 金额 正数
ServiceId uint // 服务id
Remark string // 备注信息
CancelSecond int64 // 自动取消秒
}
// Create @Title 创建消费
func (w *wallet) Create(ctx context.Context, args ArgsWalletCreate) (walletId uint, err error) {
xClient, err := client.GetClient(w)
if err != nil {
return
}
err = xClient.Call(ctx, "Create", args, &walletId)
return
}
type ArgsWalletSuccess struct {
UserId uint // 客户id
WalletId uint // 消费id
}
// Success @Title 成功
func (w *wallet) Success(ctx context.Context, args ArgsWalletSuccess) (walletId uint, err error) {
xClient, err := client.GetClient(w)
if err != nil {
return
}
err = xClient.Call(ctx, "Success", args, &walletId)
return
}
type ArgsWalletFail struct {
UserId uint // 客户id
WalletId uint // 消费id
}
// Fail @Title 失败
func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) (walletId uint, err error) {
xClient, err := client.GetClient(w)
if err != nil {
return
}
err = xClient.Call(ctx, "Fail", args, &walletId)
return
}

Loading…
Cancel
Save