修改bug,移除部分调试日志
This commit is contained in:
parent
7cba557a68
commit
2ea165d1b9
@ -59,14 +59,13 @@ func (s *TableOp[T]) findByRedis(id uint) *T {
|
||||
if len(maps) == 0 {
|
||||
return nil
|
||||
}
|
||||
var result resultT[T]
|
||||
us, err := serialization.MapToStruct[T](maps)
|
||||
if err != nil {
|
||||
log.ErrorF("serialization map to struct err: %v", err)
|
||||
return nil
|
||||
}
|
||||
log.DebugF("findByRedis redis-key:%v result:%v", s.redisKey(id), us)
|
||||
return &result.ret
|
||||
//log.DebugF("findByRedis redis-key:%v result:%v", s.redisKey(id), us)
|
||||
return us
|
||||
}
|
||||
|
||||
func (s *TableOp[T]) writeRedis(id uint, t *T) {
|
||||
|
@ -42,7 +42,7 @@ func (s *UserAccountOp) GetUserAccount(username string) (*user.UserAccount, pb.E
|
||||
us := &user.UserAccount{}
|
||||
err = s.db.Where("username = ?", username).First(us).Error
|
||||
if err != nil {
|
||||
log.ErrorF("find user:%v err:%v", username, err)
|
||||
log.DebugF("find user:%v err:%v", username, err)
|
||||
return nil, pb.ErrCode_SystemErr
|
||||
}
|
||||
// 从db中查到后写入redis,并建立索引
|
||||
|
@ -44,7 +44,7 @@ func operationDb[T any](iMsg *ipb.InternalMsg, operation func(table *T) (*T, pb.
|
||||
log.ErrorF("error marshalling user account %v", err)
|
||||
return
|
||||
}
|
||||
log.DebugF("iMsg.Msg:%v", string(iMsg.Msg))
|
||||
//log.DebugF("iMsg.Msg:%v", string(iMsg.Msg))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ func (s *LoginService) checkLoginOrRegister(req *pb.C2SUserLogin) (us *user.User
|
||||
return nil, pb.ErrCode_SystemErr, node
|
||||
}
|
||||
_ = json.Unmarshal(rspMsg.Msg, us)
|
||||
log.DebugF("收到rcp:%v返回数据:%v", rpcName.GetUserAccount, string(rspMsg.Msg))
|
||||
//log.DebugF("收到rpc:%v返回数据:%v", rpcName.GetUserAccount, string(rspMsg.Msg))
|
||||
if us.ID == 0 {
|
||||
// 没有帐号,创建帐号
|
||||
us = &user.UserAccount{
|
||||
@ -58,6 +58,7 @@ func (s *LoginService) checkLoginOrRegister(req *pb.C2SUserLogin) (us *user.User
|
||||
LastLoginIP: req.Ip,
|
||||
LastLoginTime: time.Now(),
|
||||
RegisterIP: req.Ip,
|
||||
RegisterTime: time.Now(),
|
||||
}
|
||||
rpcMsg = ipb.MakeRpcMsg[user.UserAccount](rpcName.CreateUserAccount, 0, us)
|
||||
rspMsg, err = s.Call(service.RpcTopicEx(node.Name), timeout, rpcMsg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user