Documentation ¶
Index ¶
- Variables
- func GetDB(ctx context.Context) *gorm.DB
- func MigrateDb(db *gorm.DB) error
- func NewMysqlClient()
- type Chain
- type ChainAccount
- func (t *ChainAccount) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *ChainAccount) BulkSave(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *ChainAccount) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error
- func (t *ChainAccount) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)
- func (*ChainAccount) GetList(ctx context.Context, where string, args ...interface{}) ([]*ChainAccount, error)
- func (t *ChainAccount) GetListOrderLimit(ctx context.Context, order string, limit int, where string, ...) ([]*ChainAccount, error)
- func (t *ChainAccount) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*ChainAccount, error)
- func (t *ChainAccount) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*ChainAccount, error)
- func (t *ChainAccount) GetOne(ctx context.Context, where string, args ...interface{}) (*ChainAccount, error)
- func (t *ChainAccount) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)
- func (t *ChainAccount) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)
- func (t *ChainAccount) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (t *ChainAccount) Insert(db *gorm.DB, ctx context.Context, data *ChainAccount) error
- func (t *ChainAccount) TableName() string
- func (t *ChainAccount) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, ...) (int64, error)
- type ContractAccount
- func (t *ContractAccount) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *ContractAccount) BulkSave(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *ContractAccount) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error
- func (t *ContractAccount) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)
- func (*ContractAccount) GetList(ctx context.Context, where string, args ...interface{}) ([]*ContractAccount, error)
- func (t *ContractAccount) GetListOrderLimit(ctx context.Context, order string, limit int, where string, ...) ([]*ContractAccount, error)
- func (t *ContractAccount) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*ContractAccount, error)
- func (t *ContractAccount) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*ContractAccount, error)
- func (t *ContractAccount) GetOne(ctx context.Context, where string, args ...interface{}) (*ContractAccount, error)
- func (t *ContractAccount) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)
- func (t *ContractAccount) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)
- func (t *ContractAccount) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (t *ContractAccount) Insert(db *gorm.DB, ctx context.Context, data *ContractAccount) error
- func (t *ContractAccount) TableName() string
- func (t *ContractAccount) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, ...) (int64, error)
- type Label
- func (t *Label) BulkInsert(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *Label) BulkSave(db *gorm.DB, ctx context.Context, fields []string, ...) error
- func (t *Label) Delete(db *gorm.DB, ctx context.Context, where string, args ...interface{}) error
- func (t *Label) GetCount(ctx context.Context, where string, args ...interface{}) (int64, error)
- func (*Label) GetList(ctx context.Context, where string, args ...interface{}) ([]*Label, error)
- func (t *Label) GetListOrderLimit(ctx context.Context, order string, limit int, where string, ...) ([]*Label, error)
- func (t *Label) GetListPage(ctx context.Context, pageNum, limit int, where string, args ...interface{}) ([]*Label, error)
- func (t *Label) GetListWithLimit(ctx context.Context, limit int, where string, args ...interface{}) ([]*Label, error)
- func (t *Label) GetOne(ctx context.Context, where string, args ...interface{}) (*Label, error)
- func (t *Label) GetSumDecimal(ctx context.Context, sql string, args ...interface{}) (decimal.Decimal, error)
- func (t *Label) GetSumFloat64(ctx context.Context, sql string, args ...interface{}) (float64, error)
- func (t *Label) GetSumInt64(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (t *Label) Insert(db *gorm.DB, ctx context.Context, data *Label) error
- func (t *Label) TableName() string
- func (t *Label) Updates(db *gorm.DB, ctx context.Context, data map[string]interface{}, where string, ...) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ChainAccountHandler = &ChainAccount{}
View Source
var ContractAccountHandler = &ContractAccount{}
View Source
var LabelHandler = &Label{}
Functions ¶
func NewMysqlClient ¶
func NewMysqlClient()
Types ¶
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 (*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 (*ChainAccount) GetSumFloat64 ¶
func (*ChainAccount) GetSumInt64 ¶
func (*ChainAccount) Insert ¶
func (t *ChainAccount) Insert(db *gorm.DB, ctx context.Context, data *ChainAccount) error
func (*ChainAccount) TableName ¶
func (t *ChainAccount) TableName() string
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 (*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 (*ContractAccount) GetSumFloat64 ¶
func (*ContractAccount) GetSumInt64 ¶
func (*ContractAccount) Insert ¶
func (t *ContractAccount) Insert(db *gorm.DB, ctx context.Context, data *ContractAccount) error
func (*ContractAccount) TableName ¶
func (t *ContractAccount) TableName() string
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 (*Label) GetListOrderLimit ¶
func (*Label) GetListPage ¶
func (*Label) GetListWithLimit ¶
func (*Label) GetSumDecimal ¶
func (*Label) GetSumFloat64 ¶
func (*Label) GetSumInt64 ¶
Click to show internal directories.
Click to hide internal directories.