-
Notifications
You must be signed in to change notification settings - Fork 34
/
chain_height.go
39 lines (34 loc) · 1.47 KB
/
chain_height.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package models
import (
"github.com/machinefi/w3bstream/pkg/depends/base/types"
"github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes"
"github.com/machinefi/w3bstream/pkg/enums"
)
// ChainHeight database model chainheight
// @def primary ID
// @def unique_index UI_chain_height_id ChainHeightID
// @def unique_index UI_chain_height_uniq ProjectName EventType ChainID ChainName Height Uniq
//
//go:generate toolkit gen model ChainHeight --database MonitorDB
type ChainHeight struct {
datatypes.PrimaryID
RelChainHeight
ChainHeightData
datatypes.OperationTimes
}
type RelChainHeight struct {
ChainHeightID types.SFID `db:"f_chain_height_id" json:"chainHeightID"`
}
type ChainHeightData struct {
ProjectName string `db:"f_project_name" json:"projectName"`
Finished datatypes.Bool `db:"f_finished,default='2'" json:"-"`
Uniq types.SFID `db:"f_uniq,default='0'" json:"-"`
ChainHeightInfo
}
type ChainHeightInfo struct {
EventType string `db:"f_event_type" json:"eventType,omitempty,default='MONITOR_DEFAULT'"`
ChainID uint64 `db:"f_chain_id,default='0'" json:"chainID,omitempty"`
ChainName enums.ChainName `db:"f_chain_name,default=''" json:"chainName,omitempty"`
Height uint64 `db:"f_height" json:"height"`
Paused datatypes.Bool `db:"f_paused,default='2'" json:"paused,omitempty,default='false'"`
}