From f82464eeb08c2107589bb5a75cbc052867ed73dd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 27 Apr 2024 11:12:57 +0800 Subject: [PATCH] 1 --- server/adminserver/mt/MailDb.go | 22 ++++++++++ server/adminserver/mt/export.go | 6 +++ server/adminserver/mtb/mtb.auto_gen.go | 59 ++++++++++++++++++++++++++ server/adminserver/proto/mt.proto | 9 ++++ 4 files changed, 96 insertions(+) create mode 100644 server/adminserver/mt/MailDb.go diff --git a/server/adminserver/mt/MailDb.go b/server/adminserver/mt/MailDb.go new file mode 100644 index 00000000..16e57809 --- /dev/null +++ b/server/adminserver/mt/MailDb.go @@ -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() { +} diff --git a/server/adminserver/mt/export.go b/server/adminserver/mt/export.go index 1f014eb2..80676ac1 100644 --- a/server/adminserver/mt/export.go +++ b/server/adminserver/mt/export.go @@ -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 = "" diff --git a/server/adminserver/mtb/mtb.auto_gen.go b/server/adminserver/mtb/mtb.auto_gen.go index 947a1eb4..1c01a315 100644 --- a/server/adminserver/mtb/mtb.auto_gen.go +++ b/server/adminserver/mtb/mtb.auto_gen.go @@ -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) } diff --git a/server/adminserver/proto/mt.proto b/server/adminserver/proto/mt.proto index d82ee13a..0497adb6 100644 --- a/server/adminserver/proto/mt.proto +++ b/server/adminserver/proto/mt.proto @@ -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;