From 96877af57292819d999ebdff091cfe912ee0a83e Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 19 Aug 2022 19:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E8=B4=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user/wallet.go | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/customer/user/wallet.go b/customer/user/wallet.go index 1136b89..58a56ca 100644 --- a/customer/user/wallet.go +++ b/customer/user/wallet.go @@ -36,3 +36,52 @@ func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error } 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 +}