From 42c89a07964a1b7aa148df04b5c24067e860db4d Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 1 Aug 2023 14:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/data/data.go | 5 +++++ customer/data/wallet.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 customer/data/data.go create mode 100644 customer/data/wallet.go diff --git a/customer/data/data.go b/customer/data/data.go new file mode 100644 index 0000000..ec29b51 --- /dev/null +++ b/customer/data/data.go @@ -0,0 +1,5 @@ +package data + +type Data struct { + Wallet wallet +} diff --git a/customer/data/wallet.go b/customer/data/wallet.go new file mode 100644 index 0000000..21e3759 --- /dev/null +++ b/customer/data/wallet.go @@ -0,0 +1,33 @@ +package data + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "github.com/shopspring/decimal" +) + +type wallet struct { +} +type ArgsWalletMonthCount struct { + StartAt string // 年份 + EndAt string // 月份 +} +type WalletMonthCountItem struct { + UserId uint `json:"userId"` + UserName string `json:"userName"` + BeforePeriod decimal.Decimal `json:"beforePeriod"` // 期初 + RechargeAmount decimal.Decimal `json:"rechargeAmount"` // 充值 + PlaceAmount decimal.Decimal `json:"placeAmount"` // 下单 + RefundAmount decimal.Decimal `json:"refundAmount"` // 退款 + AfterPeriod decimal.Decimal `json:"afterPeriod"` // 期末 +} + +// MonthCount @Title 月消费统计 +func (w *wallet) MonthCount(ctx context.Context, args ArgsWalletMonthCount) (reply []WalletMonthCountItem, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "MonthCount", args, &reply) + return +}