github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/models/account.go (about) 1 package models 2 3 import ( 4 "github.com/machinefi/w3bstream/pkg/depends/base/types" 5 "github.com/machinefi/w3bstream/pkg/depends/kit/sqlx/datatypes" 6 "github.com/machinefi/w3bstream/pkg/enums" 7 ) 8 9 // Account w3bstream account 10 // @def primary ID 11 // @def unique_index UI_account_id AccountID 12 // 13 //go:generate toolkit gen model Account --database DB 14 type Account struct { 15 datatypes.PrimaryID 16 RelAccount 17 AccountInfo 18 datatypes.OperationTimesWithDeleted 19 } 20 21 type RelAccount struct { 22 // @rel Account.AccountID 23 AccountID types.SFID `db:"f_account_id" json:"accountID"` // AccountID account id 24 } 25 26 type AccountInfo struct { 27 Role enums.AccountRole `db:"f_role,default=2" json:"role"` 28 State enums.AccountState `db:"f_state,default='1'" json:"state"` 29 Avatar string `db:"f_avatar,default=''" json:"avatar,omitempty"` 30 Meta Meta `db:"f_meta,default='{}'" json:"meta,omitempty"` 31 OperatorPrivateKey string `db:"f_prvkey,default=''" json:"-"` // Deprecated: pls use pkg/modules/operator 32 }