代码初始化
This commit is contained in:
36
model/entity/wallet/wallet.go
Normal file
36
model/entity/wallet/wallet.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
walletConsts "shop-user-trade/consts/wallet"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type walletCol struct {
|
||||
beans.SQLBaseCol
|
||||
UserID string
|
||||
Balance string
|
||||
Currency string
|
||||
Status string
|
||||
Version string
|
||||
}
|
||||
|
||||
var WalletCol = walletCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
UserID: "user_id",
|
||||
Balance: "balance",
|
||||
Currency: "currency",
|
||||
Status: "status",
|
||||
Version: "version",
|
||||
}
|
||||
|
||||
// Wallet 钱包实体
|
||||
type Wallet struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
|
||||
UserID int64 `orm:"user_id" json:"userId,string" description:"用户ID"`
|
||||
Balance int64 `orm:"balance" json:"balance" description:"余额(分)"`
|
||||
Currency string `orm:"currency" json:"currency" description:"货币类型:CNY-人民币"`
|
||||
Status walletConsts.WalletStatus `orm:"status" json:"status" description:"状态:1启用/0禁用/-1冻结"`
|
||||
Version int64 `orm:"version" json:"version" description:"乐观锁版本号"`
|
||||
}
|
||||
24
model/entity/wallet/wallet_log.go
Normal file
24
model/entity/wallet/wallet_log.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
walletConsts "shop-user-trade/consts/wallet"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// WalletLog 钱包操作日志实体
|
||||
type WalletLog struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
|
||||
UserID int64 `orm:"user_id" json:"userId,string" description:"用户ID"`
|
||||
WalletID int64 `orm:"wallet_id" json:"walletId,string" description:"钱包ID"`
|
||||
OrderNo string `orm:"order_no" json:"orderNo" description:"业务订单号"`
|
||||
TransactionNo string `orm:"transaction_no" json:"transactionNo" description:"钱包交易流水号"`
|
||||
Type walletConsts.WalletLogType `orm:"type" json:"type" description:"操作类型"`
|
||||
Amount int64 `orm:"amount" json:"amount" description:"金额(分)"`
|
||||
BalanceBefore int64 `orm:"balance_before" json:"balanceBefore" description:"操作前余额"`
|
||||
BalanceAfter int64 `orm:"balance_after" json:"balanceAfter" description:"操作后余额"`
|
||||
Currency string `orm:"currency" json:"currency" description:"货币类型"`
|
||||
Description string `orm:"description" json:"description" description:"描述"`
|
||||
ExtraData map[string]interface{} `orm:"extra_data" json:"extraData" description:"额外数据(JSONB)"`
|
||||
}
|
||||
33
model/entity/wallet/wallet_log_col.go
Normal file
33
model/entity/wallet/wallet_log_col.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package entity
|
||||
|
||||
import "gitea.com/red-future/common/beans"
|
||||
|
||||
type walletLogCol struct {
|
||||
beans.SQLBaseCol
|
||||
UserID string
|
||||
WalletID string
|
||||
OrderNo string
|
||||
TransactionNo string
|
||||
Type string
|
||||
Amount string
|
||||
BalanceBefore string
|
||||
BalanceAfter string
|
||||
Currency string
|
||||
Description string
|
||||
ExtraData string
|
||||
}
|
||||
|
||||
var WalletLogCol = walletLogCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
UserID: "user_id",
|
||||
WalletID: "wallet_id",
|
||||
OrderNo: "order_no",
|
||||
TransactionNo: "transaction_no",
|
||||
Type: "type",
|
||||
Amount: "amount",
|
||||
BalanceBefore: "balance_before",
|
||||
BalanceAfter: "balance_after",
|
||||
Currency: "currency",
|
||||
Description: "description",
|
||||
ExtraData: "extra_data",
|
||||
}
|
||||
Reference in New Issue
Block a user