添加消费记录

detached
杨赟 1 year ago
parent f9afc8d7ef
commit 36bedabe8c

@ -6,4 +6,5 @@ type User struct {
Wallet wallet // 钱包 Wallet wallet // 钱包
Cash cash // 余额提现 Cash cash // 余额提现
Message message // 消息 Message message // 消息
WalletHistory walletHistory // 消费记录
} }

@ -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
}
Loading…
Cancel
Save