github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/blockchain.go (about)

     1  package models
     2  
     3  import "github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes"
     4  
     5  // TODO will delete after caller migrate to http api
     6  
     7  // Blockchain database model blockchain
     8  // @def primary                   ID
     9  // @def unique_index UI_chain_id ChainID
    10  //
    11  //go:generate toolkit gen model Blockchain --database MonitorDB
    12  type Blockchain struct {
    13  	datatypes.PrimaryID
    14  	RelBlockchain
    15  	BlockchainInfo
    16  	datatypes.OperationTimes
    17  }
    18  
    19  type RelBlockchain struct {
    20  	ChainID uint64 `db:"f_chain_id"             json:"chainID"`
    21  }
    22  
    23  type BlockchainInfo struct {
    24  	Address string `db:"f_chain_address"         json:"chainAddress"`
    25  }