1
This commit is contained in:
parent
75192f5993
commit
2da787403d
@ -3,5 +3,7 @@
|
||||
"port": 3306,
|
||||
"user": "root",
|
||||
"passwd": "keji178",
|
||||
"database": "accountdb1"
|
||||
"database": "accountdb1",
|
||||
"max_open_conns": 1,
|
||||
"max_idle_conns": 1
|
||||
}
|
||||
|
@ -3,5 +3,7 @@
|
||||
"port": 3306,
|
||||
"user": "root",
|
||||
"passwd": "keji178",
|
||||
"database": "admindb_dev"
|
||||
"database": "admindb_dev",
|
||||
"max_open_conns": 1,
|
||||
"max_idle_conns": 1
|
||||
}
|
||||
|
@ -3,5 +3,7 @@
|
||||
"port": 3306,
|
||||
"user": "root",
|
||||
"passwd": "keji178",
|
||||
"database": "frienddb_dev_1"
|
||||
"database": "frienddb_dev_1",
|
||||
"max_open_conns": 1,
|
||||
"max_idle_conns": 1
|
||||
}
|
||||
|
@ -3,5 +3,7 @@
|
||||
"port": 3306,
|
||||
"user": "root",
|
||||
"passwd": "keji178",
|
||||
"database": "gamedb2006_dev_1"
|
||||
"database": "gamedb2006_dev_1",
|
||||
"max_open_conns": 1,
|
||||
"max_idle_conns": 1
|
||||
}
|
||||
|
@ -3,5 +3,7 @@
|
||||
"port": 3306,
|
||||
"user": "root",
|
||||
"passwd": "keji178",
|
||||
"database": "maildb_dev_1"
|
||||
"database": "maildb_dev_1",
|
||||
"max_open_conns": 1,
|
||||
"max_idle_conns": 1
|
||||
}
|
||||
|
@ -60,7 +60,9 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.GameDb.GetById(0).GetUser(),
|
||||
mt.Table.GameDb.GetById(0).GetPasswd(),
|
||||
mt.Table.GameDb.GetById(0).GetDatabase(),
|
||||
1)
|
||||
1,
|
||||
mt.Table.GameDb.GetById(0).GetMaxOpenConns(),
|
||||
mt.Table.GameDb.GetById(0).GetMaxIdleConns())
|
||||
f5.GetJsStyleDb().RegisterDataSource(
|
||||
constant.FRIEND_DB,
|
||||
mt.Table.FriendDb.GetById(0).GetHost(),
|
||||
@ -68,7 +70,9 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.FriendDb.GetById(0).GetUser(),
|
||||
mt.Table.FriendDb.GetById(0).GetPasswd(),
|
||||
mt.Table.FriendDb.GetById(0).GetDatabase(),
|
||||
1)
|
||||
1,
|
||||
mt.Table.FriendDb.GetById(0).GetMaxOpenConns(),
|
||||
mt.Table.FriendDb.GetById(0).GetMaxIdleConns(),)
|
||||
f5.GetApp().RegisterOrmDb(
|
||||
constant.ADMIN_DB,
|
||||
mt.Table.AdminDb.GetById(0).GetHost(),
|
||||
@ -101,7 +105,8 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.MailDb.GetById(0).GetPasswd(),
|
||||
mt.Table.MailDb.GetById(0).GetDatabase(),
|
||||
1,
|
||||
)
|
||||
mt.Table.MailDb.GetById(0).GetMaxOpenConns(),
|
||||
mt.Table.MailDb.GetById(0).GetMaxIdleConns())
|
||||
f5.GetGoStyleDb().RegisterDataSource(
|
||||
constant.GAME_DB,
|
||||
mt.Table.GameDb.GetById(0).GetHost(),
|
||||
@ -110,7 +115,8 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.GameDb.GetById(0).GetPasswd(),
|
||||
mt.Table.GameDb.GetById(0).GetDatabase(),
|
||||
1,
|
||||
)
|
||||
mt.Table.GameDb.GetById(0).GetMaxOpenConns(),
|
||||
mt.Table.GameDb.GetById(0).GetMaxIdleConns())
|
||||
}
|
||||
|
||||
func (this *app) AddSession(accountId string) string {
|
||||
|
@ -19,6 +19,8 @@ type GameDb struct {
|
||||
user string
|
||||
passwd string
|
||||
database string
|
||||
max_open_conns int32
|
||||
max_idle_conns int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
@ -30,6 +32,8 @@ type FriendDb struct {
|
||||
user string
|
||||
passwd string
|
||||
database string
|
||||
max_open_conns int32
|
||||
max_idle_conns int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
@ -41,6 +45,8 @@ type AdminDb struct {
|
||||
user string
|
||||
passwd string
|
||||
database string
|
||||
max_open_conns int32
|
||||
max_idle_conns int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
@ -52,6 +58,8 @@ type AccountDb struct {
|
||||
user string
|
||||
passwd string
|
||||
database string
|
||||
max_open_conns int32
|
||||
max_idle_conns int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
@ -63,6 +71,8 @@ type MailDb struct {
|
||||
user string
|
||||
passwd string
|
||||
database string
|
||||
max_open_conns int32
|
||||
max_idle_conns int32
|
||||
|
||||
_flags1_ uint64
|
||||
_flags2_ uint64
|
||||
@ -139,6 +149,22 @@ func (this *GameDb) HasDatabase() bool {
|
||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||
}
|
||||
|
||||
func (this *GameDb) GetMaxOpenConns() int32 {
|
||||
return this.max_open_conns
|
||||
}
|
||||
|
||||
func (this *GameDb) HasMaxOpenConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||
}
|
||||
|
||||
func (this *GameDb) GetMaxIdleConns() int32 {
|
||||
return this.max_idle_conns
|
||||
}
|
||||
|
||||
func (this *GameDb) HasMaxIdleConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||
}
|
||||
|
||||
func (this *FriendDb) GetHost() string {
|
||||
return this.host
|
||||
}
|
||||
@ -179,6 +205,22 @@ func (this *FriendDb) HasDatabase() bool {
|
||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||
}
|
||||
|
||||
func (this *FriendDb) GetMaxOpenConns() int32 {
|
||||
return this.max_open_conns
|
||||
}
|
||||
|
||||
func (this *FriendDb) HasMaxOpenConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||
}
|
||||
|
||||
func (this *FriendDb) GetMaxIdleConns() int32 {
|
||||
return this.max_idle_conns
|
||||
}
|
||||
|
||||
func (this *FriendDb) HasMaxIdleConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||
}
|
||||
|
||||
func (this *AdminDb) GetHost() string {
|
||||
return this.host
|
||||
}
|
||||
@ -219,6 +261,22 @@ func (this *AdminDb) HasDatabase() bool {
|
||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||
}
|
||||
|
||||
func (this *AdminDb) GetMaxOpenConns() int32 {
|
||||
return this.max_open_conns
|
||||
}
|
||||
|
||||
func (this *AdminDb) HasMaxOpenConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||
}
|
||||
|
||||
func (this *AdminDb) GetMaxIdleConns() int32 {
|
||||
return this.max_idle_conns
|
||||
}
|
||||
|
||||
func (this *AdminDb) HasMaxIdleConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||
}
|
||||
|
||||
func (this *AccountDb) GetHost() string {
|
||||
return this.host
|
||||
}
|
||||
@ -259,6 +317,22 @@ func (this *AccountDb) HasDatabase() bool {
|
||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||
}
|
||||
|
||||
func (this *AccountDb) GetMaxOpenConns() int32 {
|
||||
return this.max_open_conns
|
||||
}
|
||||
|
||||
func (this *AccountDb) HasMaxOpenConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||
}
|
||||
|
||||
func (this *AccountDb) GetMaxIdleConns() int32 {
|
||||
return this.max_idle_conns
|
||||
}
|
||||
|
||||
func (this *AccountDb) HasMaxIdleConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||
}
|
||||
|
||||
func (this *MailDb) GetHost() string {
|
||||
return this.host
|
||||
}
|
||||
@ -299,6 +373,22 @@ func (this *MailDb) HasDatabase() bool {
|
||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||
}
|
||||
|
||||
func (this *MailDb) GetMaxOpenConns() int32 {
|
||||
return this.max_open_conns
|
||||
}
|
||||
|
||||
func (this *MailDb) HasMaxOpenConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||
}
|
||||
|
||||
func (this *MailDb) GetMaxIdleConns() int32 {
|
||||
return this.max_idle_conns
|
||||
}
|
||||
|
||||
func (this *MailDb) HasMaxIdleConns() bool {
|
||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||
}
|
||||
|
||||
func (this *Config) GetGameapiUrl() string {
|
||||
return this.gameapi_url
|
||||
}
|
||||
@ -320,6 +410,8 @@ func (this *GameDb) LoadFromKv(kv map[string]interface{}) {
|
||||
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)
|
||||
f5.ReadMetaTableField(&this.max_open_conns, "max_open_conns", &this._flags1_, 6, kv)
|
||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||
}
|
||||
|
||||
func (this *FriendDb) LoadFromKv(kv map[string]interface{}) {
|
||||
@ -328,6 +420,8 @@ func (this *FriendDb) LoadFromKv(kv map[string]interface{}) {
|
||||
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)
|
||||
f5.ReadMetaTableField(&this.max_open_conns, "max_open_conns", &this._flags1_, 6, kv)
|
||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||
}
|
||||
|
||||
func (this *AdminDb) LoadFromKv(kv map[string]interface{}) {
|
||||
@ -336,6 +430,8 @@ func (this *AdminDb) LoadFromKv(kv map[string]interface{}) {
|
||||
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)
|
||||
f5.ReadMetaTableField(&this.max_open_conns, "max_open_conns", &this._flags1_, 6, kv)
|
||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||
}
|
||||
|
||||
func (this *AccountDb) LoadFromKv(kv map[string]interface{}) {
|
||||
@ -344,6 +440,8 @@ func (this *AccountDb) LoadFromKv(kv map[string]interface{}) {
|
||||
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)
|
||||
f5.ReadMetaTableField(&this.max_open_conns, "max_open_conns", &this._flags1_, 6, kv)
|
||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||
}
|
||||
|
||||
func (this *MailDb) LoadFromKv(kv map[string]interface{}) {
|
||||
@ -352,6 +450,8 @@ func (this *MailDb) LoadFromKv(kv map[string]interface{}) {
|
||||
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)
|
||||
f5.ReadMetaTableField(&this.max_open_conns, "max_open_conns", &this._flags1_, 6, kv)
|
||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||
}
|
||||
|
||||
func (this *Config) LoadFromKv(kv map[string]interface{}) {
|
||||
|
@ -16,6 +16,8 @@ message GameDb
|
||||
optional string user = 3;
|
||||
optional string passwd = 4;
|
||||
optional string database = 5;
|
||||
optional int32 max_open_conns = 6;
|
||||
optional int32 max_idle_conns = 7;
|
||||
}
|
||||
|
||||
message FriendDb
|
||||
@ -25,6 +27,8 @@ message FriendDb
|
||||
optional string user = 3;
|
||||
optional string passwd = 4;
|
||||
optional string database = 5;
|
||||
optional int32 max_open_conns = 6;
|
||||
optional int32 max_idle_conns = 7;
|
||||
}
|
||||
|
||||
message AdminDb
|
||||
@ -34,6 +38,8 @@ message AdminDb
|
||||
optional string user = 3;
|
||||
optional string passwd = 4;
|
||||
optional string database = 5;
|
||||
optional int32 max_open_conns = 6;
|
||||
optional int32 max_idle_conns = 7;
|
||||
}
|
||||
|
||||
message AccountDb
|
||||
@ -43,6 +49,8 @@ message AccountDb
|
||||
optional string user = 3;
|
||||
optional string passwd = 4;
|
||||
optional string database = 5;
|
||||
optional int32 max_open_conns = 6;
|
||||
optional int32 max_idle_conns = 7;
|
||||
}
|
||||
|
||||
message MailDb
|
||||
@ -52,6 +60,8 @@ message MailDb
|
||||
optional string user = 3;
|
||||
optional string passwd = 4;
|
||||
optional string database = 5;
|
||||
optional int32 max_open_conns = 6;
|
||||
optional int32 max_idle_conns = 7;
|
||||
}
|
||||
|
||||
message Config
|
||||
|
@ -48,7 +48,7 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.MailDb.GetById(0).GetUser(),
|
||||
mt.Table.MailDb.GetById(0).GetPasswd(),
|
||||
mt.Table.MailDb.GetById(0).GetDatabase(),
|
||||
30)
|
||||
1)
|
||||
|
||||
f5.GetGoStyleDb().RegisterDataSource(
|
||||
constant.GAME_DB,
|
||||
@ -57,7 +57,7 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.GameDb.GetById(0).GetUser(),
|
||||
mt.Table.GameDb.GetById(0).GetPasswd(),
|
||||
mt.Table.GameDb.GetById(0).GetDatabase(),
|
||||
30)
|
||||
1)
|
||||
|
||||
f5.GetGoStyleDb().RegisterDataSource(
|
||||
constant.BCNFT_DB,
|
||||
@ -66,7 +66,7 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.BcNftDb.GetById(0).GetUser(),
|
||||
mt.Table.BcNftDb.GetById(0).GetPasswd(),
|
||||
mt.Table.BcNftDb.GetById(0).GetDatabase(),
|
||||
30)
|
||||
1)
|
||||
|
||||
f5.GetGoStyleDb().RegisterDataSource(
|
||||
constant.BCEVENT_DB,
|
||||
@ -75,7 +75,7 @@ func (this *app) registerDataSources() {
|
||||
mt.Table.BcEventDb.GetById(0).GetUser(),
|
||||
mt.Table.BcEventDb.GetById(0).GetPasswd(),
|
||||
mt.Table.BcEventDb.GetById(0).GetDatabase(),
|
||||
30)
|
||||
1)
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user