117 lines
2.6 KiB
Go
117 lines
2.6 KiB
Go
package dblog
|
|
|
|
import (
|
|
"q5"
|
|
"f5"
|
|
"main/constant"
|
|
)
|
|
|
|
type dbLogMgr struct {
|
|
|
|
}
|
|
|
|
const (
|
|
LOG_TYPE_FRIEND_ADD = "friend.add"
|
|
LOG_TYPE_FRIEND_DEL = "friend.del"
|
|
|
|
LOG_TYPE_GUILD_CLEAR_EMPTY_START = "guild.clear_empty.start"
|
|
LOG_TYPE_GUILD_CLEAR_EMPTY_END = "guild.clear_empty.end"
|
|
|
|
LOG_TYPE_GUILD_CREATE_CONSUME_BEGIN = "guild.create_consume.begin"
|
|
LOG_TYPE_GUILD_CREATE_CONSUME_END = "guild.create_consume.end"
|
|
|
|
LOG_TYPE_GUILD_ACC = "guild.create_consume.end"
|
|
)
|
|
|
|
func (this* dbLogMgr) Init() {
|
|
|
|
}
|
|
|
|
func (this* dbLogMgr) UnInit() {
|
|
|
|
}
|
|
|
|
func (this *dbLogMgr) addLog(fields [][]string) {
|
|
nowTime := f5.GetApp().GetNowSeconds()
|
|
q5.AppendSlice(&fields, []string{"createtime", q5.ToString(nowTime)})
|
|
q5.AppendSlice(&fields, []string{"modifytime", q5.ToString(nowTime)})
|
|
f5.GetJsStyleDb().Insert(
|
|
constant.FRIEND_DB,
|
|
"t_log",
|
|
fields,
|
|
func (error, int64, int64) {
|
|
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) FriendAdd(senderId string, targetId string) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_FRIEND_ADD},
|
|
{"param1", senderId},
|
|
{"param2", targetId},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) FriendDel(senderId string, targetId string) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_FRIEND_DEL},
|
|
{"param1", senderId},
|
|
{"param2", targetId},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildClearEmptyStart(guildId string, guildName string) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_GUILD_CLEAR_EMPTY_START},
|
|
{"param1", guildId},
|
|
{"param2", guildName},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildClearEmptyEnd(guildId string, guildName string) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_GUILD_CLEAR_EMPTY_END},
|
|
{"param1", guildId},
|
|
{"param2", guildName},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildCreateConsumeBegin(accountId string, guildId string, guildName string) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_GUILD_CREATE_CONSUME_BEGIN},
|
|
{"param1", accountId},
|
|
{"param2", guildId},
|
|
{"param3", guildName},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildCreateConsumeEnd(accountId string, guildId string, guildName string, errCode int32) {
|
|
this.addLog([][]string{
|
|
{"log_type", LOG_TYPE_GUILD_CREATE_CONSUME_END},
|
|
{"param1", accountId},
|
|
{"param2", guildId},
|
|
{"param3", guildName},
|
|
{"paramr", q5.ToString(errCode)},
|
|
})
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildAccpetApply(guildId string, accountId string, targetId string) {
|
|
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildLeave(guildId string, memberId string) {
|
|
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildKickout(guildId string, ownerId string, memberId string) {
|
|
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildSetJob(string, string, int32) {
|
|
|
|
}
|
|
|
|
func (this *dbLogMgr) GuildDisband(string, string, int32) {
|
|
|
|
}
|