1
This commit is contained in:
parent
a050a01519
commit
4ab0643ecd
@ -9,6 +9,7 @@ const (
|
|||||||
BCEVENT_DB = "bceventdb"
|
BCEVENT_DB = "bceventdb"
|
||||||
GAME_DB = "gamedb"
|
GAME_DB = "gamedb"
|
||||||
MAIL_DB = "maildb"
|
MAIL_DB = "maildb"
|
||||||
|
LOG_DB = "logdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
14
server/light_backtask/mt/LogDb.go
Normal file
14
server/light_backtask/mt/LogDb.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package mt
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"main/mtb"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LogDb struct {
|
||||||
|
mtb.LogDb
|
||||||
|
}
|
||||||
|
|
||||||
|
type LogDbTable struct {
|
||||||
|
f5.IdMetaTable[LogDb]
|
||||||
|
}
|
@ -10,6 +10,7 @@ type table struct {
|
|||||||
MailDb *MailDbTable
|
MailDb *MailDbTable
|
||||||
BcEventDb *BcEventDbTable
|
BcEventDb *BcEventDbTable
|
||||||
BcNftDb *BcNftDbTable
|
BcNftDb *BcNftDbTable
|
||||||
|
LogDb *LogDbTable
|
||||||
Config *ConfigTable
|
Config *ConfigTable
|
||||||
Item *ItemTable
|
Item *ItemTable
|
||||||
Language *LanguageTable
|
Language *LanguageTable
|
||||||
@ -46,6 +47,11 @@ var Table = f5.New(func(this *table) {
|
|||||||
this.PrimKey = ""
|
this.PrimKey = ""
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.LogDb = f5.New(func(this *LogDbTable) {
|
||||||
|
this.FileName = "../config/logdb.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 = ""
|
||||||
|
@ -65,6 +65,19 @@ type BcEventDb struct {
|
|||||||
_flags2_ uint64
|
_flags2_ uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LogDb struct {
|
||||||
|
host string
|
||||||
|
port int32
|
||||||
|
user string
|
||||||
|
passwd string
|
||||||
|
database string
|
||||||
|
max_open_conns int32
|
||||||
|
max_idle_conns int32
|
||||||
|
|
||||||
|
_flags1_ uint64
|
||||||
|
_flags2_ uint64
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
gameapi_url string
|
gameapi_url string
|
||||||
net_id int32
|
net_id int32
|
||||||
@ -372,6 +385,62 @@ func (this *BcEventDb) HasMaxIdleConns() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 7)) > 0
|
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetHost() string {
|
||||||
|
return this.host
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasHost() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 1)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetPort() int32 {
|
||||||
|
return this.port
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasPort() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 2)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetUser() string {
|
||||||
|
return this.user
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasUser() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 3)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetPasswd() string {
|
||||||
|
return this.passwd
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasPasswd() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 4)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetDatabase() string {
|
||||||
|
return this.database
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasDatabase() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetMaxOpenConns() int32 {
|
||||||
|
return this.max_open_conns
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasMaxOpenConns() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 6)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) GetMaxIdleConns() int32 {
|
||||||
|
return this.max_idle_conns
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) HasMaxIdleConns() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 7)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Config) GetGameapiUrl() string {
|
func (this *Config) GetGameapiUrl() string {
|
||||||
return this.gameapi_url
|
return this.gameapi_url
|
||||||
}
|
}
|
||||||
@ -603,6 +672,16 @@ func (this *BcEventDb) LoadFromKv(kv map[string]interface{}) {
|
|||||||
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
f5.ReadMetaTableField(&this.max_idle_conns, "max_idle_conns", &this._flags1_, 7, kv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *LogDb) 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)
|
||||||
|
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{}) {
|
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)
|
||||||
f5.ReadMetaTableField(&this.net_id, "net_id", &this._flags1_, 2, kv)
|
f5.ReadMetaTableField(&this.net_id, "net_id", &this._flags1_, 2, kv)
|
||||||
|
@ -53,6 +53,17 @@ message BcEventDb
|
|||||||
optional int32 max_idle_conns = 7;
|
optional int32 max_idle_conns = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message LogDb
|
||||||
|
{
|
||||||
|
optional string host = 1;
|
||||||
|
optional int32 port = 2;
|
||||||
|
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
|
message Config
|
||||||
{
|
{
|
||||||
optional string gameapi_url = 1;
|
optional string gameapi_url = 1;
|
||||||
|
@ -111,7 +111,7 @@ func AddGameLog(accountId string, logType string, subType string,
|
|||||||
param1 string, param2 string, param3 string, param4 string) {
|
param1 string, param2 string, param3 string, param4 string) {
|
||||||
nowTime := f5.GetApp().GetRealSeconds()
|
nowTime := f5.GetApp().GetRealSeconds()
|
||||||
f5.GetGoStyleDb().Insert(
|
f5.GetGoStyleDb().Insert(
|
||||||
constant.GAME_DB,
|
constant.LOG_DB,
|
||||||
"t_game_log",
|
"t_game_log",
|
||||||
[][]string {
|
[][]string {
|
||||||
{"account_id", accountId},
|
{"account_id", accountId},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user