This commit is contained in:
aozhiwei 2024-06-20 16:05:03 +08:00
parent 53c2e78aa4
commit ea6f71ba8e
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package mt
import (
"f5"
"mtb"
)
type Web3SignCluster struct {
mtb.Web3SignCluster
}
type Web3SignClusterTable struct {
f5.IdMetaTable[Web3SignCluster]
}
func (this *Web3SignCluster) Init1() {
}

View File

@ -12,6 +12,7 @@ type table struct {
Config *ConfigTable Config *ConfigTable
Item *ItemTable Item *ItemTable
Contract *ContractTable Contract *ContractTable
Web3SignCluster *Web3SignClusterTable
} }
var Table = f5.New(func(this *table) { var Table = f5.New(func(this *table) {
@ -50,4 +51,9 @@ var Table = f5.New(func(this *table) {
this.PrimKey = "name" this.PrimKey = "name"
}) })
this.Web3SignCluster = f5.New(func(this *Web3SignClusterTable) {
this.FileName = "../config/web3sign.cluster.json"
this.PrimKey = ""
})
}) })

View File

@ -69,6 +69,13 @@ type Contract struct {
_flags2_ uint64 _flags2_ uint64
} }
type Web3SignCluster struct {
url string
_flags1_ uint64
_flags2_ uint64
}
func (this *MarketServerCluster) GetInstanceId() int32 { func (this *MarketServerCluster) GetInstanceId() int32 {
return this.instance_id return this.instance_id
} }
@ -253,6 +260,14 @@ func (this *Contract) HasAddress() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0 return (this._flags1_ & (uint64(1) << 4)) > 0
} }
func (this *Web3SignCluster) GetUrl() string {
return this.url
}
func (this *Web3SignCluster) HasUrl() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *MarketServerCluster) LoadFromKv(kv map[string]interface{}) { func (this *MarketServerCluster) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.instance_id, "instance_id", &this._flags1_, 1, kv) f5.ReadMetaTableField(&this.instance_id, "instance_id", &this._flags1_, 1, kv)
@ -297,3 +312,7 @@ func (this *Contract) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 1, kv) f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.address, "address", &this._flags1_, 4, kv) f5.ReadMetaTableField(&this.address, "address", &this._flags1_, 4, kv)
} }
func (this *Web3SignCluster) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.url, "url", &this._flags1_, 1, kv)
}