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 +}