2026-07-27 00:18:42 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import "git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
|
|
|
|
|
|
// WalletLedger 对应 wallet_ledger,保存不可变资金流水。
|
|
|
|
|
|
type WalletLedger struct {
|
2026-07-27 12:02:08 +08:00
|
|
|
|
Entity // 公共实体字段
|
|
|
|
|
|
WalletID uint64 `gorm:"column:wallet_id;not null;index" json:"wallet_id"` // wallet_id 业务字段
|
|
|
|
|
|
Amount int64 `gorm:"column:amount;not null" json:"amount"` // amount 业务字段
|
|
|
|
|
|
Direction string `gorm:"column:direction;type:varchar(16);not null" json:"direction"` // direction 业务字段
|
|
|
|
|
|
BalanceAfter int64 `gorm:"column:balance_after;not null" json:"balance_after"` // balance_after 业务字段
|
|
|
|
|
|
ReferenceIdentity string `gorm:"column:reference_identity;type:varchar(36);not null;default:'';index" json:"reference_identity"` // reference_identity 业务字段
|
2026-07-27 00:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() { database.AppendMigrate(&WalletLedger{}) }
|
|
|
|
|
|
func (table *WalletLedger) TableName() string { return "wallet_ledger" }
|