优化错误日志
This commit is contained in:
parent
1016daf1be
commit
77258d5004
@ -36,7 +36,7 @@ func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (code
|
||||
if err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
"friendIds": selfFriendIds,
|
||||
}); err != nil {
|
||||
log.Errorf("Del friend err:%v", err)
|
||||
this.moduleFriend.Error("删除好友", log.Fields{"uid": uid, "params": req, "err": err.Error()})
|
||||
code = pb.ErrorCode_FriendApplyError
|
||||
return
|
||||
}
|
||||
|
@ -2,20 +2,22 @@ package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//删除黑名单
|
||||
func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.FriendDelBlackReq) (code pb.ErrorCode) {
|
||||
if req.FriendId == "" {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
this.moduleFriend.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//删除黑名单
|
||||
func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackReq) (code pb.ErrorCode, data proto.Message) {
|
||||
if code = this.DelblackCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
@ -23,22 +25,8 @@ func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackR
|
||||
var (
|
||||
err error
|
||||
self *pb.DBFriend
|
||||
Resp *pb.FriendDelBlackResp
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
Resp = &pb.FriendDelBlackResp{
|
||||
FriendId: req.FriendId,
|
||||
UserId: session.GetUserId(),
|
||||
}
|
||||
}
|
||||
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeDelBlack, Resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
uid := session.GetUserId()
|
||||
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
||||
if self == nil {
|
||||
code = pb.ErrorCode_FriendSelfNoData
|
||||
@ -48,13 +36,22 @@ func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackR
|
||||
//从黑名单列表中删除目标
|
||||
self.BlackIds = utils.DeleteString(self.BlackIds, req.FriendId)
|
||||
//更新黑名单
|
||||
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
if err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
"blackIds": self.BlackIds,
|
||||
})
|
||||
if err != nil {
|
||||
}); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.moduleFriend.Error("删除黑名单", log.Fields{"uid": uid, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
resp := &pb.FriendDelBlackResp{
|
||||
FriendId: req.FriendId,
|
||||
UserId: session.GetUserId(),
|
||||
}
|
||||
|
||||
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeDelBlack, resp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -8,13 +8,15 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 领取奖励
|
||||
func (this *apiComp) GetrewardCheck(session comm.IUserSession, req *pb.FriendGetrewardReq) (code pb.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewardReq) (code pb.ErrorCode, data proto.Message) {
|
||||
uid := session.GetUserId()
|
||||
//获取玩家自己好友数据
|
||||
self := this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
||||
self := this.moduleFriend.modelFriend.GetFriend(uid)
|
||||
if self == nil {
|
||||
code = pb.ErrorCode_FriendSelfNoData
|
||||
return
|
||||
@ -30,12 +32,15 @@ func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewar
|
||||
"received": received,
|
||||
}
|
||||
if err := this.moduleFriend.modelFriend.Change(self.Uid, update); err != nil {
|
||||
log.Errorf("Assisthero err:%v", err)
|
||||
code = pb.ErrorCode_FriendApplyError
|
||||
this.moduleFriend.Error("领奖", log.Fields{"uid": uid, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
code = this.moduleFriend.DispenseRes(session, this.moduleFriend.globalConf.FriendPeize, true)
|
||||
if code = this.moduleFriend.DispenseRes(session, this.moduleFriend.globalConf.FriendPeize, true); code != pb.ErrorCode_Success {
|
||||
this.moduleFriend.Error("好友领奖励", log.Fields{"uid": uid, "reward": this.moduleFriend.globalConf.FriendPeize, "code": code})
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.FriendGetrewardResp{Received: int32(received)}
|
||||
|
||||
|
@ -8,29 +8,18 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//好友列表
|
||||
|
||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.FriendListReq) (code pb.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
//好友列表
|
||||
func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
self *pb.DBFriend
|
||||
Resp *pb.FriendListResp
|
||||
list []*pb.FriendBase
|
||||
)
|
||||
|
||||
defer func() {
|
||||
Resp = &pb.FriendListResp{
|
||||
List: list,
|
||||
}
|
||||
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeList, Resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
||||
if self == nil {
|
||||
code = pb.ErrorCode_FriendSelfNoData
|
||||
@ -68,5 +57,13 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (cod
|
||||
list = append(list, base)
|
||||
}
|
||||
|
||||
resp := &pb.FriendListResp{
|
||||
List: list,
|
||||
}
|
||||
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeList, resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 好友推荐
|
||||
|
||||
func (this *apiComp) RandlistCheck(session comm.IUserSession, req *pb.FriendRandlistReq) (code pb.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
@ -2,15 +2,18 @@ package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 好友审核-拒绝
|
||||
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.FriendRefuseReq) (code pb.ErrorCode) {
|
||||
if len(req.FriendIds) == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
this.moduleFriend.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
}
|
||||
|
||||
return
|
||||
@ -21,26 +24,15 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq)
|
||||
if code = this.RefuseCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
uid := session.GetUserId()
|
||||
//将申请人从申请列表中删除
|
||||
var (
|
||||
self *pb.DBFriend
|
||||
Resp *pb.FriendRefuseResp
|
||||
optNum int32
|
||||
)
|
||||
defer func() {
|
||||
Resp = &pb.FriendRefuseResp{
|
||||
Num: optNum,
|
||||
}
|
||||
|
||||
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeRefuse, Resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
//获取玩家自己好友数据
|
||||
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
||||
self = this.moduleFriend.modelFriend.GetFriend(uid)
|
||||
if self == nil {
|
||||
code = pb.ErrorCode_FriendSelfNoData
|
||||
return
|
||||
@ -56,19 +48,29 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq)
|
||||
|
||||
//将申请人从申请列表中删除
|
||||
for _, userId := range refuseIds {
|
||||
self.ApplyIds = utils.DeleteString(self.ApplyIds, userId)
|
||||
self.ApplyIds = utils.Deletex(self.ApplyIds, userId)
|
||||
optNum++
|
||||
}
|
||||
//更新
|
||||
if optNum > 0 {
|
||||
err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
if err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
|
||||
"applyIds": self.ApplyIds,
|
||||
})
|
||||
if err != nil {
|
||||
}); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.moduleFriend.Error("好友审批拒绝", log.Fields{"uid": uid, "params": req, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
resp := &pb.FriendRefuseResp{
|
||||
Num: optNum,
|
||||
}
|
||||
|
||||
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeRefuse, resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -2,31 +2,34 @@ package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//搜索
|
||||
func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.FriendSearchReq) (code pb.ErrorCode) {
|
||||
if req.NickName == "" {
|
||||
code = pb.ErrorCode_FriendSearchNameEmpty
|
||||
this.moduleFriend.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//搜索
|
||||
func (this *apiComp) Search(session comm.IUserSession, req *pb.FriendSearchReq) (code pb.ErrorCode, data proto.Message) {
|
||||
if code = this.SearchCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
uid := session.GetUserId()
|
||||
resp := &pb.FriendSearchResp{}
|
||||
|
||||
users, err := this.moduleFriend.ModuleUser.SearchRmoteUser(req.NickName)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.moduleFriend.Errorf("搜索玩家 err:%v", err)
|
||||
this.moduleFriend.Error("搜索玩家", log.Fields{"uid": uid, "params": req.NickName, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
@ -12,6 +13,7 @@ import (
|
||||
func (this *apiComp) ZanCheck(session comm.IUserSession, req *pb.FriendZanReq) (code pb.ErrorCode) {
|
||||
if len(req.FriendIds) == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
this.moduleFriend.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -27,6 +29,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
|
||||
selfId string
|
||||
)
|
||||
|
||||
uid := session.GetUserId()
|
||||
selfId = session.GetUserId()
|
||||
|
||||
// 不能给自己点赞
|
||||
@ -49,7 +52,6 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
|
||||
}
|
||||
|
||||
if _, ok := utils.Find(target.ZanIds, selfId); !ok {
|
||||
|
||||
pointTotal += 1
|
||||
target.ZanIds = append(target.ZanIds, selfId)
|
||||
//设置被点赞玩家
|
||||
@ -57,6 +59,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
|
||||
"zanIds": target.ZanIds,
|
||||
}); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.moduleFriend.Error("点赞", log.Fields{"uid": uid, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import (
|
||||
|
||||
// 点赞列表
|
||||
func (this *apiComp) ZanlistCheck(session comm.IUserSession, req *pb.FriendZanlistReq) (code pb.ErrorCode) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
@ -13,6 +14,7 @@ import (
|
||||
func (this *apiComp) ZanreceiveCheck(session comm.IUserSession, req *pb.FriendZanreceiveReq) (code pb.ErrorCode) {
|
||||
if len(req.FriendIds) == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
this.moduleFriend.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ func (this *ModelFriend) Init(service core.IService, module core.IModule, comp c
|
||||
return
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
func (this *ModelFriend) Frined_FindCond(nickName string) *pb.DBUser {
|
||||
var user *pb.DBUser
|
||||
err := this.DB.FindOne(comm.TableUser, bson.M{
|
||||
"name": nickName,
|
||||
}).Decode(&user)
|
||||
if err != nil {
|
||||
log.Errorf("findCond err:%v", err)
|
||||
return nil
|
||||
}
|
||||
return user
|
||||
@ -45,7 +45,7 @@ func (this *ModelFriend) GetFriend(uid string) *pb.DBFriend {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
log.Errorf("GetFriend err:%v", err)
|
||||
log.Error("未获得好友数据", log.Fields{"uid": uid})
|
||||
}
|
||||
return friend
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func (this *Friend) ResetFriend(uid string) {
|
||||
"received": 0, //奖励状态重置
|
||||
}
|
||||
if err := this.modelFriend.Change(uid, zanUpdate); err != nil {
|
||||
log.Error("resetZanFriend err", log.Fields{"err": err})
|
||||
log.Error("重置玩家点赞数据", log.Fields{"uid": uid, "err": err})
|
||||
}
|
||||
|
||||
// 重置今日友情点
|
||||
@ -80,7 +80,7 @@ func (this *Friend) ResetFriend(uid string) {
|
||||
"friendPointOD": 0,
|
||||
}
|
||||
if err := this.ModuleUser.ChangeUserExpand(uid, update); err != nil {
|
||||
log.Error("resetFriend err", log.Fields{"err": err})
|
||||
log.Error("重置今日友情点", log.Fields{"uid": uid, "err": err})
|
||||
}
|
||||
|
||||
}
|
||||
@ -110,6 +110,7 @@ func (this *Friend) RpcUseAssisHero(ctx context.Context, req *pb.RPCGeneralReqA2
|
||||
}
|
||||
|
||||
// 使用好友助战英雄
|
||||
// friendId 好友Id
|
||||
func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
|
||||
//指定好友
|
||||
friend := this.modelFriend.GetFriend(friendId)
|
||||
@ -125,7 +126,7 @@ func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
|
||||
for _, r := range friend.Record {
|
||||
if r.AssistHeroId == friend.AssistHeroId {
|
||||
if utils.IsToday(r.AssistTime) {
|
||||
log.Warnf("今日已助战 uid:%v friendId:%v heroId:%v", uid, friendId, r.AssistHeroId)
|
||||
log.Warn("今日已助战", log.Fields{"uid": uid, "friendId": friend, "assistHeroId": r.AssistHeroId})
|
||||
return nil, errors.New("今日已助战")
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import (
|
||||
|
||||
4、修改玩家经验值:bingo:attr,exp,1000(1000代表新增的经验值 //
|
||||
|
||||
5、跳过随机任务 bingo:rtask,1,1001
|
||||
5、跳过随机任务 bingo:worldtask,1,1001
|
||||
6、bingo:Iamyoudad
|
||||
7、bingo:vip,yueka_1,1 // 月卡类型
|
||||
*/
|
||||
|
@ -2,6 +2,7 @@ package task
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -22,18 +23,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
if code = this.ReceiveCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
resp := &pb.TaskReceiveResp{}
|
||||
defer func() {
|
||||
err := session.SendMsg(string(this.moduleTask.GetType()), TaskSubTypeReceive, resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
uid := session.GetUserId()
|
||||
// 获取待领取的任务
|
||||
userTask := this.moduleTask.modelTask.getUserTask(session.GetUserId(), req.Id)
|
||||
userTask := this.moduleTask.modelTask.getUserTask(uid, req.Id)
|
||||
|
||||
if userTask == nil {
|
||||
code = pb.ErrorCode_TaskNotFound
|
||||
@ -88,6 +80,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
|
||||
//奖励
|
||||
if code = this.moduleTask.DispenseRes(session, conf.Reword, true); code != pb.ErrorCode_Success {
|
||||
this.moduleTask.Error("发送奖励", log.Fields{"uid": uid, "reward": conf.Reword, "code": code})
|
||||
return
|
||||
}
|
||||
|
||||
@ -100,7 +93,15 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
return
|
||||
}
|
||||
|
||||
resp.TaskId = userTask.TaskId
|
||||
resp := &pb.TaskReceiveResp{
|
||||
TaskId: userTask.TaskId,
|
||||
}
|
||||
|
||||
err := session.SendMsg(string(this.moduleTask.GetType()), TaskSubTypeReceive, resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
|
||||
// 监听玩家经验
|
||||
this.moduleTask.ModuleUser.EventUserChanged(session)
|
||||
|
@ -2,6 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"strings"
|
||||
@ -13,6 +14,7 @@ func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.UserCreateRe
|
||||
name := strings.TrimSpace(req.NickName)
|
||||
if name == "" || len(name) > 30 {
|
||||
code = pb.ErrorCode_UserNickNameEmpty
|
||||
this.module.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
|
||||
}
|
||||
|
||||
return
|
||||
@ -24,6 +26,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
|
||||
return
|
||||
}
|
||||
|
||||
uid := session.GetUserId()
|
||||
//获取用户
|
||||
self := this.module.modelUser.GetUser(session.GetUserId())
|
||||
if self == nil {
|
||||
@ -57,9 +60,9 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
|
||||
update["avatar"] = globalConf.GirlHeadPortrait
|
||||
}
|
||||
|
||||
if err := this.module.modelUser.Change(session.GetUserId(), update); err != nil {
|
||||
if err := this.module.modelUser.Change(uid, update); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.module.Errorf("创角失败 uid:%v name:%v err:%v", session.GetUserId(), req.NickName, err)
|
||||
this.module.Error("创角", log.Fields{"uid": uid, "params": update, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
@ -69,7 +72,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
|
||||
}
|
||||
if err := this.module.modelExpand.ChangeUserExpand(session.GetUserId(), initUpdate); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
this.module.Errorf("更新修改名称次数失败 uid:%v err:%v", session.GetUserId(), err)
|
||||
this.module.Error("创建初始修改名称次数", log.Fields{"uid": uid, "param": initUpdate, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
var (
|
||||
|
@ -2,6 +2,7 @@ package user
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -16,9 +17,10 @@ func (this *apiComp) GetTujian(session comm.IUserSession, req *pb.UserGetTujianR
|
||||
return
|
||||
}
|
||||
|
||||
uid := session.GetUserId()
|
||||
rsp := &pb.UserGetTujianResp{}
|
||||
if result, err := this.module.modelExpand.GetUserExpand(session.GetUserId()); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
if result, err := this.module.modelExpand.GetUserExpand(uid); err != nil {
|
||||
this.module.Error("玩家扩展数据", log.Fields{"uid": uid, "err": err.Error()})
|
||||
return
|
||||
} else {
|
||||
for k := range result.Tujian {
|
||||
|
@ -21,6 +21,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.UserInfoReq) (code
|
||||
ue, err := this.module.GetUserExpand(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.UserInfoResp{
|
||||
|
@ -47,7 +47,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
||||
user, err = this.module.modelUser.FindByAccount(req.Sid, req.Account)
|
||||
if err != nil {
|
||||
if err != mongo.ErrNoDocuments {
|
||||
log.Errorf("User_FindByAccount err %v", err)
|
||||
log.Error("User_FindByAccount", log.Fields{"sid": req.Sid, "account": req.Account, "err": err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user