39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package entity
|
|
|
|
import (
|
|
walletConsts "shop-user-trade/consts/wallet"
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
type accountCol struct {
|
|
beans.SQLBaseCol
|
|
UserID string
|
|
UserName string
|
|
Balance string
|
|
Currency string
|
|
Status string
|
|
}
|
|
|
|
var AccountCol = accountCol{
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
UserID: "user_id",
|
|
UserName: "user_name",
|
|
Balance: "balance",
|
|
Currency: "currency",
|
|
Status: "status",
|
|
}
|
|
|
|
// Account 钱包实体
|
|
// 单余额模型:balance 可用余额(元),可为负(欠费,靠充值归正)。
|
|
// status 为整钱包状态(1启用/0禁用/-1冻结,风控用)。
|
|
type Account struct {
|
|
beans.SQLBaseDO `orm:",inherit"`
|
|
|
|
UserID int64 `orm:"user_id" json:"userId,string" description:"用户ID"`
|
|
UserName string `orm:"user_name" json:"userName" description:"用户名"`
|
|
Balance float64 `orm:"balance" json:"balance" description:"可用余额(元,保留2位小数),可为负=欠费"`
|
|
Currency string `orm:"currency" json:"currency" description:"货币类型:CNY-人民币"`
|
|
Status walletConsts.WalletStatus `orm:"status" json:"status" description:"状态:1启用/0禁用/-1冻结"`
|
|
}
|