models

package
v0.0.0-...-db648dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChainAccountHandler = &ChainAccount{}
View Source
var ContractAccountHandler = &ContractAccount{}
View Source
var LabelHandler = &Label{}

Functions

func GetDB

func GetDB(ctx context.Context) *gorm.DB

func MigrateDb

func MigrateDb(db *gorm.DB) error

func NewMysqlClient

func NewMysqlClient()

Types

type Chain

type Chain struct {
	Name string `gorm:"type:text;description:Name; comment:链名称"   json:"name"`
	*gorm.Model
}

type ChainAccount

type ChainAccount struct {
	Id          int64           `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	ChainName   string          `` /* 194-byte string literal not displayed */
	AccountAddr string          `` /* 198-byte string literal not displayed */
	Holder      string          `` /* 135-byte string literal not displayed */
	Amount      decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(40,20)  NOT NULL;default:0.00000000000000000000 ;comment:持仓数量;"`
	TokenNum    decimal.Decimal `` /* 130-byte string literal not displayed */
	TokenUsd    decimal.Decimal `` /* 132-byte string literal not displayed */
	NftNum      decimal.Decimal `json:"nft_num" gorm:"column:nft_num;type:decimal(40,20)  NOT NULL;default:0.00000000000000000000 ;comment:nft种类;"`
	NftUsd      decimal.Decimal `json:"nft_usd" gorm:"column:nft_usd;type:decimal(40,20)  NOT NULL;default:0.00000000000000000000 ;comment:nft总价值(usd);"`
	CreatedAt   time.Time       `json:"created_at" gorm:"column:created_at;NOT NULL;default:CURRENT_TIMESTAMP;type:TIMESTAMP;index"`
	UpdatedAt   time.Time       `json:"updated_at" gorm:"column:updated_at;NOT NULL;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;type:TIMESTAMP"`
	DeletedAt   *time.Time      `json:"deleted_at" gorm:"column:deleted_at;type:DATETIME"`
}

func (*ChainAccount) BulkInsert

func (t *ChainAccount) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*ChainAccount) BulkSave

func (t *ChainAccount) BulkSave(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*ChainAccount) Delete

func (t *ChainAccount) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error

func (*ChainAccount) GetCount

func (t *ChainAccount) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)

func (*ChainAccount) GetList

func (*ChainAccount) GetList(ctx context.Context, where string, args ...interface{}) ([]*ChainAccount, error)

func (*ChainAccount) GetListOrderLimit

func (t *ChainAccount) GetListOrderLimit(ctx context.Context, order string, limit int, where string, args ...interface{}) ([]*ChainAccount, error)

func (*ChainAccount) GetListPage

func (t *ChainAccount) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*ChainAccount, error)

func (*ChainAccount) GetListWithLimit

func (t *ChainAccount) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*ChainAccount, error)

func (*ChainAccount) GetOne

func (t *ChainAccount) GetOne(ctx context.Context, where string, args ...interface{}) (*ChainAccount, error)

func (*ChainAccount) GetSumDecimal

func (t *ChainAccount) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)

func (*ChainAccount) GetSumFloat64

func (t *ChainAccount) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)

func (*ChainAccount) GetSumInt64

func (t *ChainAccount) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)

func (*ChainAccount) Insert

func (t *ChainAccount) Insert(db *gorm.DB, ctx context.Context, data *ChainAccount) error

func (*ChainAccount) TableName

func (t *ChainAccount) TableName() string

func (*ChainAccount) Updates

func (t *ChainAccount) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, args ...interface{}) (int64, error)

type ContractAccount

type ContractAccount struct {
	Id           int64           `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	ChainName    string          `` /* 144-byte string literal not displayed */
	CoinName     string          `` /* 142-byte string literal not displayed */
	ContractAddr string          `` /* 203-byte string literal not displayed */
	AccountAddr  string          `` /* 201-byte string literal not displayed */
	Holder       string          `` /* 133-byte string literal not displayed */
	Amount       decimal.Decimal `` /* 127-byte string literal not displayed */
	Price        decimal.Decimal `json:"price" gorm:"column:price;type:decimal(40,20)  NOT NULL;default:0.00000000000000000000 ;comment:代币单价;"`
	UsdAmount    decimal.Decimal `` /* 140-byte string literal not displayed */
	CreatedAt    time.Time       `json:"created_at" gorm:"column:created_at;NOT NULL;default:CURRENT_TIMESTAMP;type:TIMESTAMP;index"`
	UpdatedAt    time.Time       `json:"updated_at" gorm:"column:updated_at;NOT NULL;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;type:TIMESTAMP"`
	DeletedAt    *time.Time      `json:"deleted_at" gorm:"column:deleted_at;type:DATETIME"`
}

func (*ContractAccount) BulkInsert

func (t *ContractAccount) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*ContractAccount) BulkSave

func (t *ContractAccount) BulkSave(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*ContractAccount) Delete

func (t *ContractAccount) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error

func (*ContractAccount) GetCount

func (t *ContractAccount) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)

func (*ContractAccount) GetList

func (*ContractAccount) GetList(ctx context.Context, where string, args ...interface{}) ([]*ContractAccount, error)

func (*ContractAccount) GetListOrderLimit

func (t *ContractAccount) GetListOrderLimit(ctx context.Context, order string, limit int, where string, args ...interface{}) ([]*ContractAccount, error)

func (*ContractAccount) GetListPage

func (t *ContractAccount) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*ContractAccount, error)

func (*ContractAccount) GetListWithLimit

func (t *ContractAccount) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*ContractAccount, error)

func (*ContractAccount) GetOne

func (t *ContractAccount) GetOne(ctx context.Context, where string, args ...interface{}) (*ContractAccount, error)

func (*ContractAccount) GetSumDecimal

func (t *ContractAccount) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)

func (*ContractAccount) GetSumFloat64

func (t *ContractAccount) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)

func (*ContractAccount) GetSumInt64

func (t *ContractAccount) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)

func (*ContractAccount) Insert

func (t *ContractAccount) Insert(db *gorm.DB, ctx context.Context, data *ContractAccount) error

func (*ContractAccount) TableName

func (t *ContractAccount) TableName() string

func (*ContractAccount) Updates

func (t *ContractAccount) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, args ...interface{}) (int64, error)

type Label

type Label struct {
	Id          int64      `json:"id" gorm:"primary_key;type:int AUTO_INCREMENT"`
	ChainName   string     `` /* 196-byte string literal not displayed */
	AccountAddr string     `` /* 200-byte string literal not displayed */
	Holder      string     `` /* 135-byte string literal not displayed */
	Tag         string     `` /* 126-byte string literal not displayed */
	AddrType    string     `` /* 159-byte string literal not displayed */
	Amount      string     `` /* 147-byte string literal not displayed */
	TxCount     string     `` /* 139-byte string literal not displayed */
	CreatedAt   time.Time  `json:"created_at" gorm:"column:created_at;NOT NULL;default:CURRENT_TIMESTAMP;type:TIMESTAMP;index"`
	UpdatedAt   time.Time  `json:"updated_at" gorm:"column:updated_at;NOT NULL;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;type:TIMESTAMP"`
	DeletedAt   *time.Time `json:"deleted_at" gorm:"column:deleted_at;type:DATETIME"`
}

func (*Label) BulkInsert

func (t *Label) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*Label) BulkSave

func (t *Label) BulkSave(db *gorm.DB, ctx context.Context, fields []string, params []map[string]interface{}) error

func (*Label) Delete

func (t *Label) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error

func (*Label) GetCount

func (t *Label) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)

func (*Label) GetList

func (*Label) GetList(ctx context.Context, where string, args ...interface{}) ([]*Label, error)

func (*Label) GetListOrderLimit

func (t *Label) GetListOrderLimit(ctx context.Context, order string, limit int, where string, args ...interface{}) ([]*Label, error)

func (*Label) GetListPage

func (t *Label) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*Label, error)

func (*Label) GetListWithLimit

func (t *Label) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*Label, error)

func (*Label) GetOne

func (t *Label) GetOne(ctx context.Context, where string, args ...interface{}) (*Label, error)

func (*Label) GetSumDecimal

func (t *Label) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)

func (*Label) GetSumFloat64

func (t *Label) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)

func (*Label) GetSumInt64

func (t *Label) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)

func (*Label) Insert

func (t *Label) Insert(db *gorm.DB, ctx context.Context, data *Label) error

func (*Label) TableName

func (t *Label) TableName() string

func (*Label) Updates

func (t *Label) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, args ...interface{}) (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL