This commit is contained in:
aozhiwei 2024-06-14 14:07:42 +08:00
parent b8c34ab756
commit dc16a1fa1a
5 changed files with 182 additions and 11 deletions

View File

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

View File

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

View File

@ -7,6 +7,8 @@ import (
type table struct {
MarketServerCluster *MarketServerClusterTable
NftDb *NftDbTable
NftEventDb *NftEventDbTable
GameDb *GameDbTable
Config *ConfigTable
Item *ItemTable
Contract *ContractTable
@ -23,6 +25,16 @@ var Table = f5.New(func(this *table) {
this.PrimKey = ""
})
this.NftEventDb = f5.New(func(this *NftEventDbTable) {
this.FileName = "../config/bceventdb.mysql.json"
this.PrimKey = ""
})
this.GameDb = f5.New(func(this *GameDbTable) {
this.FileName = "../config/gamedb.mysql.json"
this.PrimKey = ""
})
this.Config = f5.New(func(this *ConfigTable) {
this.FileName = "../config/config.json"
this.PrimKey = ""

View File

@ -24,6 +24,28 @@ type NftDb struct {
_flags2_ uint64
}
type NftEventDb struct {
host string
port int32
user string
passwd string
database string
_flags1_ uint64
_flags2_ uint64
}
type GameDb struct {
host string
port int32
user string
passwd string
database string
_flags1_ uint64
_flags2_ uint64
}
type Config struct {
gameapi_url string
@ -41,7 +63,6 @@ type Item struct {
type Contract struct {
name string
json string
address string
_flags1_ uint64
@ -112,6 +133,86 @@ func (this *NftDb) HasDatabase() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *NftEventDb) GetHost() string {
return this.host
}
func (this *NftEventDb) HasHost() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *NftEventDb) GetPort() int32 {
return this.port
}
func (this *NftEventDb) HasPort() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *NftEventDb) GetUser() string {
return this.user
}
func (this *NftEventDb) HasUser() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *NftEventDb) GetPasswd() string {
return this.passwd
}
func (this *NftEventDb) HasPasswd() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0
}
func (this *NftEventDb) GetDatabase() string {
return this.database
}
func (this *NftEventDb) HasDatabase() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *GameDb) GetHost() string {
return this.host
}
func (this *GameDb) HasHost() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *GameDb) GetPort() int32 {
return this.port
}
func (this *GameDb) HasPort() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *GameDb) GetUser() string {
return this.user
}
func (this *GameDb) HasUser() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *GameDb) GetPasswd() string {
return this.passwd
}
func (this *GameDb) HasPasswd() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0
}
func (this *GameDb) GetDatabase() string {
return this.database
}
func (this *GameDb) HasDatabase() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *Config) GetGameapiUrl() string {
return this.gameapi_url
}
@ -144,14 +245,6 @@ func (this *Contract) HasName() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *Contract) GetJson() string {
return this.json
}
func (this *Contract) HasJson() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *Contract) GetAddress() string {
return this.address
}
@ -175,6 +268,22 @@ func (this *NftDb) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv)
}
func (this *NftEventDb) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.host, "host", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.port, "port", &this._flags1_, 2, kv)
f5.ReadMetaTableField(&this.user, "user", &this._flags1_, 3, kv)
f5.ReadMetaTableField(&this.passwd, "passwd", &this._flags1_, 4, kv)
f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv)
}
func (this *GameDb) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.host, "host", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.port, "port", &this._flags1_, 2, kv)
f5.ReadMetaTableField(&this.user, "user", &this._flags1_, 3, kv)
f5.ReadMetaTableField(&this.passwd, "passwd", &this._flags1_, 4, kv)
f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv)
}
func (this *Config) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.gameapi_url, "gameapi_url", &this._flags1_, 1, kv)
}
@ -186,6 +295,5 @@ func (this *Item) LoadFromKv(kv map[string]interface{}) {
func (this *Contract) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.name, "name", &this._flags1_, 1, kv)
f5.ReadMetaTableField(&this.json, "json", &this._flags1_, 3, kv)
f5.ReadMetaTableField(&this.address, "address", &this._flags1_, 4, kv)
}

View File

@ -18,6 +18,24 @@ message NftDb
optional string database = 5;
}
message NftEventDb
{
optional string host = 1;
optional int32 port = 2;
optional string user = 3;
optional string passwd = 4;
optional string database = 5;
}
message GameDb
{
optional string host = 1;
optional int32 port = 2;
optional string user = 3;
optional string passwd = 4;
optional string database = 5;
}
message Config
{
optional string gameapi_url = 1;
@ -32,6 +50,5 @@ message Item
message Contract
{
optional string name = 1;
optional string json = 3;
optional string address = 4;
}