db.go 819 Bytes
Newer Older
贾浩@五瓣科技's avatar
贾浩@五瓣科技 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package dbmodel

import (
	"time"

	"github.com/shopspring/decimal"
	"gorm.io/gorm"
)

type Record struct {
	ID            uint            `gorm:"primaryKey"`
	TxHash        string          `gorm:"type:varchar(255);uniqueIndex;not null;comment:交易hash"`
	Address       string          `gorm:"type:varchar(255);not null;comment:用户地址"`
	ClaimedAmount decimal.Decimal `gorm:"type:decimal(65,0);not null;comment:领取数量"`
	TotalAmount   decimal.Decimal `gorm:"type:decimal(65,0);not null;comment:总奖励数量"`
	Timestamp     int64           `gorm:"not null;comment:领取区块时间"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
}

type Height struct {
	Key      string `gorm:"primaryKey"`
	IntValue int    `gorm:"type:int;not null"` // 配置value
}