feat(fight): 添加战斗日志记录功能 - 在战斗循环中添加错误时的战斗日志记录 - 新增RecordFight方法用于记录战斗相关信息 - 排除特定用户ID(10001)的日志记录 - 添加炫彩精灵相关里程碑枚举注释 ```
This commit is contained in:
@@ -109,6 +109,25 @@ func (s *BaseSysLogService) Record(ctx g.Ctx) {
|
||||
"params": baseSysLog.Params,
|
||||
})
|
||||
}
|
||||
func (s *BaseSysLogService) RecordFight(userid uint32, desc string) {
|
||||
|
||||
baseSysLog := model.NewBaseSysLog()
|
||||
baseSysLog.UserID = uint(userid)
|
||||
baseSysLog.Action = "fight"
|
||||
|
||||
baseSysLog.Params = desc
|
||||
m := cool.DBM(s.Model)
|
||||
if baseSysLog.UserID == 10001 {
|
||||
return
|
||||
}
|
||||
m.Insert(g.Map{
|
||||
"userId": baseSysLog.UserID,
|
||||
"action": baseSysLog.Action,
|
||||
"ip": baseSysLog.IP,
|
||||
//"ipAddr": baseSysLog.IPAddr,
|
||||
"params": baseSysLog.Params,
|
||||
})
|
||||
}
|
||||
|
||||
// Clear 清除日志
|
||||
func (s *BaseSysLogService) Clear(isAll bool) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user