1
This commit is contained in:
parent
7bdf7235fe
commit
f82464eeb0
22
server/adminserver/mt/MailDb.go
Normal file
22
server/adminserver/mt/MailDb.go
Normal 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() {
|
||||||
|
}
|
@ -9,6 +9,7 @@ type table struct {
|
|||||||
GameDb *GameDbTable
|
GameDb *GameDbTable
|
||||||
FriendDb *FriendDbTable
|
FriendDb *FriendDbTable
|
||||||
AccountDb *AccountDbTable
|
AccountDb *AccountDbTable
|
||||||
|
MailDb *MailDbTable
|
||||||
Config *ConfigTable
|
Config *ConfigTable
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,6 +34,11 @@ var Table = f5.New(func(this *table) {
|
|||||||
this.PrimKey = ""
|
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.Config = f5.New(func(this *ConfigTable) {
|
||||||
this.FileName = "../config/config.json"
|
this.FileName = "../config/config.json"
|
||||||
this.PrimKey = ""
|
this.PrimKey = ""
|
||||||
|
@ -57,6 +57,17 @@ type AccountDb struct {
|
|||||||
_flags2_ uint64
|
_flags2_ uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MailDb struct {
|
||||||
|
host string
|
||||||
|
port int32
|
||||||
|
user string
|
||||||
|
passwd string
|
||||||
|
database string
|
||||||
|
|
||||||
|
_flags1_ uint64
|
||||||
|
_flags2_ uint64
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
gameapi_url string
|
gameapi_url string
|
||||||
|
|
||||||
@ -248,6 +259,46 @@ func (this *AccountDb) HasDatabase() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
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 {
|
func (this *Config) GetGameapiUrl() string {
|
||||||
return this.gameapi_url
|
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)
|
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{}) {
|
func (this *Config) LoadFromKv(kv map[string]interface{}) {
|
||||||
f5.ReadMetaTableField(&this.gameapi_url, "gameapi_url", &this._flags1_, 1, kv)
|
f5.ReadMetaTableField(&this.gameapi_url, "gameapi_url", &this._flags1_, 1, kv)
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,15 @@ message AccountDb
|
|||||||
optional string database = 5;
|
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
|
message Config
|
||||||
{
|
{
|
||||||
optional string gameapi_url = 1;
|
optional string gameapi_url = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user