magic_asset.go 1.2 KB

123456789101112131415161718192021222324252627
  1. package app
  2. // 引入关联包
  3. import (
  4. "github.com/shopspring/decimal"
  5. )
  6. type MagicAsset 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. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;comment:用户ID;index;unique:idx_address_coin;NOT NULL"`
  11. Uid string `json:"uid" gorm:"column:uid;type:varchar(64);comment:交易所ID:;index"`
  12. Symbol string `json:"symbol" gorm:"column:symbol;type:varchar(20);comment:币种名;index;unique:idx_address_coin"`
  13. Balance decimal.Decimal `json:"balance" gorm:"column:balance;type:decimal(25,8);comment:净资产"`
  14. Frozen decimal.Decimal `json:"frozen" gorm:"column:frozen;type:decimal(25,8);comment:冻结资产"`
  15. TotalAmount decimal.Decimal `json:"totalAmount" gorm:"column:total_amount;type:decimal(25,8);comment:总资产"`
  16. Version int64 `json:"version" gorm:"column:version;type:bigint;comment:事务版本"`
  17. }
  18. func (*MagicAsset) TableName() string {
  19. return "magic_asset"
  20. }
  21. func NewMagicAsset() *MagicAsset {
  22. return &MagicAsset{}
  23. }