From 36bedabe8c0dcab00fe18b60d3644c852533d649 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 6 Jun 2023 16:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E8=B4=B9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user/user.go | 11 ++++--- customer/user/walletHistory.go | 57 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 customer/user/walletHistory.go diff --git a/customer/user/user.go b/customer/user/user.go index e9440b0..07fff2d 100644 --- a/customer/user/user.go +++ b/customer/user/user.go @@ -1,9 +1,10 @@ package user type User struct { - Deposit deposit // 充值 - DepositAudit depositAudit // 充值审核 - Wallet wallet // 钱包 - Cash cash // 余额提现 - Message message // 消息 + Deposit deposit // 充值 + DepositAudit depositAudit // 充值审核 + Wallet wallet // 钱包 + Cash cash // 余额提现 + Message message // 消息 + WalletHistory walletHistory // 消费记录 } diff --git a/customer/user/walletHistory.go b/customer/user/walletHistory.go new file mode 100644 index 0000000..0a19c41 --- /dev/null +++ b/customer/user/walletHistory.go @@ -0,0 +1,57 @@ +package user + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type walletHistory struct { +} + +const ( + WalletHistoryOrderIdAsc = 1 // 排序 id正序 + WalletHistoryOrderIdDesc = 2 // 排序 id 倒序 +) + +type ArgsWalletHistoryLists struct { + Search WalletHistorySearch + Page bean.Page + Orders []uint +} + +type WalletHistorySearch struct { + StartTime string // 格式 2006-01-02 15:04:05 开始时间 + EndTime string // 格式 2006-01-02 15:04:05 截止时间 +} + +type ReplyWalletHistoryList struct { + Lists []WalletHistoryItem `json:"lists"` + Total int64 `json:"total"` +} +type WalletHistoryItem struct { + Id uint `json:"id"` + UserId uint `json:"userId"` + UserName string `json:"userName"` + Type uint `json:"type"` + Title string `json:"title"` + BeforeAmount decimal.Decimal `json:"beforeAmount"` + Amount decimal.Decimal `json:"amount"` + AfterAmount decimal.Decimal `json:"afterAmount"` + TradeChannel string `json:"tradeChannel"` + TradeSerialSn string `json:"tradeSerialSn"` + Remark string `json:"remark"` + ServiceId uint `json:"serviceId"` + CreatedAt int64 `json:"createdAt"` +} + +// Lists @Title 消费记录 +func (w *walletHistory) Lists(ctx context.Context, args ArgsWalletHistoryLists) (reply ReplyWalletHistoryList, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +}