magic_asset_bill.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. package app
  2. // 引入关联包
  3. import (
  4. "github.com/shopspring/decimal"
  5. )
  6. type MagicAssetBill struct {
  7. Id int64 `json:"id" gorm:"column:id;type:bigint;comment:id;primarykey;NOT NULL"`
  8. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;comment:创建时间"`
  9. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;comment:更新时间"`
  10. AssetId int64 `json:"assetId" gorm:"column:asset_id;type:bigint;comment:资产表ID"`
  11. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;comment:用户ID;index;NOT NULL"`
  12. Uid string `json:"uid" gorm:"column:uid;type:varchar(64);comment:用户UID;index;NOT NULL"`
  13. Symbol string `json:"symbol" gorm:"column:symbol;type:varchar(20);comment:币种名"`
  14. BusinessNumber int `json:"businessNumber" gorm:"column:business_number;type:int;comment:业务场景;index;NOT NULL"`
  15. BusinessName string `json:"businessName" gorm:"column:business_name;type:varchar(50);comment:业务场名称;index"`
  16. BeforeAmount decimal.Decimal `json:"beforeAmount" gorm:"column:before_amount;type:decimal(25,8);comment:交易前可用余额;NOT NULL"`
  17. Balance decimal.Decimal `json:"balance" gorm:"column:balance;type:decimal(25,8);comment:净资产"`
  18. Frozen decimal.Decimal `json:"frozen" gorm:"column:frozen;type:decimal(25,8);comment:冻结资产"`
  19. Amount decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(25,8);comment:发生可用金额;NOT NULL"`
  20. AfterAmount decimal.Decimal `json:"afterAmount" gorm:"column:after_amount;type:decimal(25,8);comment:交易后可用余额;NOT NULL"`
  21. ContextName string `json:"contextName" gorm:"column:context_name;type:varchar(128);comment:上下文名"`
  22. ContextValue string `json:"contextValue" gorm:"column:context_value;type:varchar(128);comment:上下文值"`
  23. Describe string `json:"describe" gorm:"column:describe;type:text;comment:流水备注信息"`
  24. }
  25. func (*MagicAssetBill) TableName() string {
  26. return "magic_asset_bill"
  27. }
  28. func NewMagicAssetBill() *MagicAssetBill {
  29. return &MagicAssetBill{}
  30. }