| 12345678910111213141516171819202122232425262728293031323334353637 |
- package entity
- import (
- "github.com/shopspring/decimal"
- )
- // Bill 资产流水
- type AssetBill struct {
- MysqlBaseModel
- AssetId int64 `json:"assetId" gorm:"comment:资产表ID"`
- UserId int64 `json:"userId" gorm:"index;index:idx_business_create_hour;index:idx_user_business_created;comment:用户ID;NOT NULL"`
- Uid string `json:"uid" gorm:"index;index:idx_uid_business_number;comment:用户UID;NOT NULL"`
- Symbol string `json:"symbol" gorm:"comment:币种名;type:VARCHAR(20)"`
- BusinessNumber int `json:"businessNumber" gorm:"index:idx_user_business_created;index:idx_uid_business_number;type:INT(10);comment:业务场景;NOT NULL"`
- BusinessName string `json:"businessName" gorm:"index:idx_business_create_hour;type:VARCHAR(50);comment:业务场名称"`
- BeforeAmount decimal.Decimal `json:"beforeAmount" gorm:"type:decimal(25,8); comment:交易前可用余额;NOT NULL"`
- Balance decimal.Decimal `json:"balance" gorm:"type:decimal(25,8); default:0;comment:净资产;"`
- Frozen decimal.Decimal `json:"frozen" gorm:"type:decimal(25,8);default:0;comment:冻结资产"`
- Amount decimal.Decimal `json:"amount" gorm:"type:decimal(25,8);comment:发生可用金额;NOT NULL"`
- AfterAmount decimal.Decimal `json:"afterAmount" gorm:"type:decimal(25,8);comment:交易后可用余额;NOT NULL"`
- ContextName string `json:"contextName" gorm:"type:VARCHAR(128);comment:上下文名"`
- ContextValue string `json:"contextValue" gorm:"type:VARCHAR(128);comment:上下文值"`
- Describe string `json:"describe" gorm:"type:text;comment:流水备注信息"`
- }
- func (*AssetBill) TableName() string {
- return ModelPrefix + "asset_bill"
- }
- func (*AssetBill) Comment() string {
- return "用户资产变化流水"
- }
- func NewAssetBill() *AssetBill {
- return &AssetBill{}
- }
|