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 +} diff --git a/wholesale/channel/mq.go b/wholesale/channel/mq.go index 91f8e57..bc12fca 100644 --- a/wholesale/channel/mq.go +++ b/wholesale/channel/mq.go @@ -7,8 +7,13 @@ import ( ) const ( - MqSubscribeNameSkuPriceChange = "sku_price_change" // sku价格变动 - MqSubscribeNameSkuChange = "sku_change" // sku信息变动 + MqSubscribeNameSkuPriceChange = "sku_price_change" // sku价格变动 + MqSubscribeNameSkuChange = "sku_change" // sku信息变动 + MqSubscribeNameOrderFreightFee = "order_freight_fee" // 运费处理完成 + MqSubscribeNameOrderSplit = "order_split" // 拆单 + MqSubscribeNameOrderStockOut = "order_stock_out" // 订单出库 + MqSubscribeNameOrderFinish = "order_finish" // 订单完成 + MqSubscribeNameOrderCancel = "order_cancel" // 订单取消 ) type mq struct {