This commit is contained in:
aozhiwei 2024-04-27 11:12:57 +08:00
parent 7bdf7235fe
commit f82464eeb0
4 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package mt
import (
"f5"
"mtb"
)
type MailDb struct {
mtb.MailDb
}
type MailDbTable struct {
f5.IdMetaTable[MailDb]
selfConf *MailDb
}
func (this *MailDb) Init1() {
}
func (this *MailDbTable) GetConf() {
}

View File

@ -9,6 +9,7 @@ type table struct {
GameDb *GameDbTable
FriendDb *FriendDbTable
AccountDb *AccountDbTable
MailDb *MailDbTable
Config *ConfigTable
}
@ -33,6 +34,11 @@ var Table = f5.New(func(this *table) {
this.PrimKey = ""
})
this.MailDb = f5.New(func(this *MailDbTable) {
this.FileName = "../config/maildb.mysql.json"
this.PrimKey = ""
})
this.Config = f5.New(func(this *ConfigTable) {
this.FileName = "../config/config.json"
this.PrimKey = ""

View File

@ -57,6 +57,17 @@ type AccountDb struct {
_flags2_ uint64
}
type MailDb struct {
host string
port int32
user string
passwd string
database string
_flags1_ uint64
_flags2_ uint64
}
type Config struct {
gameapi_url string
@ -248,6 +259,46 @@ func (this *AccountDb) HasDatabase() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *MailDb) GetHost() string {
return this.host
}
func (this *MailDb) HasHost() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0
}
func (this *MailDb) GetPort() int32 {
return this.port
}
func (this *MailDb) HasPort() bool {
return (this._flags1_ & (uint64(1) << 2)) > 0
}
func (this *MailDb) GetUser() string {
return this.user
}
func (this *MailDb) HasUser() bool {
return (this._flags1_ & (uint64(1) << 3)) > 0
}
func (this *MailDb) GetPasswd() string {
return this.passwd
}
func (this *MailDb) HasPasswd() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0
}
func (this *MailDb) GetDatabase() string {
return this.database
}
func (this *MailDb) HasDatabase() bool {
return (this._flags1_ & (uint64(1) << 5)) > 0
}
func (this *Config) GetGameapiUrl() string {
return this.gameapi_url
}
@ -295,6 +346,14 @@ func (this *AccountDb) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.database, "database", &this._flags1_, 5, kv)
}
func (this *MailDb) 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)
}

View File

@ -45,6 +45,15 @@ message AccountDb
optional string database = 5;
}
message MailDb
{
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;