diff --git a/modules/friend/api_addblack.go b/modules/friend/api_addblack.go index 326c9b948..7d8b3a4d3 100644 --- a/modules/friend/api_addblack.go +++ b/modules/friend/api_addblack.go @@ -78,7 +78,7 @@ func (this *ApiComp) Addblack(session comm.IUserSession, chk map[string]interfac self.BlackIds = append(self.BlackIds, req.FriendId) //更新黑名单 - err := this.module.model_friend.Change(self.UserId, map[string]interface{}{ + err := this.module.model_friend.Change(self.UId, map[string]interface{}{ "blackIds": self.BlackIds, }) if err != nil { diff --git a/modules/friend/api_agree.go b/modules/friend/api_agree.go index 1b812dc1d..ea0f92335 100644 --- a/modules/friend/api_agree.go +++ b/modules/friend/api_agree.go @@ -82,7 +82,7 @@ func (this *ApiComp) Agree(session comm.IUserSession, chk map[string]interface{} } target.FriendIds = append(target.FriendIds, self.UId) } - err = this.module.model_friend.Change(target.UserId, map[string]interface{}{ + err = this.module.model_friend.Change(target.UId, map[string]interface{}{ "friendIds": target.FriendIds, }) if err != nil { @@ -95,7 +95,7 @@ func (this *ApiComp) Agree(session comm.IUserSession, chk map[string]interface{} } //更新 - err := this.module.model_friend.Change(self.UserId, map[string]interface{}{ + err := this.module.model_friend.Change(self.UId, map[string]interface{}{ "applyIds": self.ApplyIds, "friendIds": self.FriendIds, }) diff --git a/modules/friend/api_applylist.go b/modules/friend/api_applylist.go index 215b261c1..a470345ee 100644 --- a/modules/friend/api_applylist.go +++ b/modules/friend/api_applylist.go @@ -7,7 +7,7 @@ import ( func (this *ApiComp) ApplyList_Check(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) - self := &pb.DB_FriendData{UserId: session.GetUserId()} + self := &pb.DB_FriendData{UId: session.GetUserId()} err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} diff --git a/modules/friend/api_blacklist.go b/modules/friend/api_blacklist.go index 24a560f50..61047e218 100644 --- a/modules/friend/api_blacklist.go +++ b/modules/friend/api_blacklist.go @@ -7,7 +7,7 @@ import ( func (this *ApiComp) Blacklist_Check(session comm.IUserSession, req *pb.Friend_BlackList_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) - self := &pb.DB_FriendData{UserId: session.GetUserId()} + self := &pb.DB_FriendData{UId: session.GetUserId()} err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} diff --git a/modules/friend/api_delblack.go b/modules/friend/api_delblack.go index 4e341ce17..91adb395d 100644 --- a/modules/friend/api_delblack.go +++ b/modules/friend/api_delblack.go @@ -8,7 +8,7 @@ import ( func (this *ApiComp) Delblack_Check(session comm.IUserSession, req *pb.Friend_DelBlack_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) - self := &pb.DB_FriendData{UserId: session.GetUserId()} + self := &pb.DB_FriendData{UId: session.GetUserId()} err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} @@ -43,7 +43,7 @@ func (this *ApiComp) Delblack(session comm.IUserSession, chk map[string]interfac //从黑名单列表中删除目标 self.BlackIds = utils.DeleteString(self.BlackIds, req.FriendId) //更新黑名单 - err := this.module.model_friend.Change(self.UserId, map[string]interface{}{ + err := this.module.model_friend.Change(self.UId, map[string]interface{}{ "blackIds": self.BlackIds, }) if err != nil { diff --git a/modules/friend/api_list.go b/modules/friend/api_list.go index 639c3f36e..0ad9499a3 100644 --- a/modules/friend/api_list.go +++ b/modules/friend/api_list.go @@ -7,7 +7,7 @@ import ( func (this *ApiComp) List_Check(session comm.IUserSession, req *pb.Friend_List_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) - self := &pb.DB_FriendData{UserId: session.GetUserId()} + self := &pb.DB_FriendData{UId: session.GetUserId()} err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} diff --git a/modules/friend/api_refuse.go b/modules/friend/api_refuse.go index 03b0eec12..56ee1c593 100644 --- a/modules/friend/api_refuse.go +++ b/modules/friend/api_refuse.go @@ -66,7 +66,7 @@ func (this *ApiComp) Refuse(session comm.IUserSession, chk map[string]interface{ } //更新 if optNum > 0 { - err := this.module.model_friend.Change(self.UserId, map[string]interface{}{ + err := this.module.model_friend.Change(self.UId, map[string]interface{}{ "applyIds": self.ApplyIds, }) if err != nil { diff --git a/modules/pack/pack_test.go b/modules/pack/pack_test.go index 95a38164e..39b09a2b0 100644 --- a/modules/pack/pack_test.go +++ b/modules/pack/pack_test.go @@ -156,10 +156,3 @@ func Pack_UpdateGridToUserPack(uId string, grids ...*pb.DB_UserItemData) (err er module.model_pack_comp.DB.InsertMany(DB_PackTable, data) return } - -func TestGetHM(t *testing.T) { - d := make(map[string]interface{}) - d["amount"] = 10 - d["itemid"] = 1004 - module.cache_comp.SetHM("pack:0_62a9afd994fe03b7aaee6773", d) -} diff --git a/modules/user/api_login.go b/modules/user/api_login.go index 70f754cc3..b3fe4f54f 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -69,8 +69,8 @@ func (this *Api_Comp) Login(session comm.IUserSession, result map[string]interfa user.Createip = session.GetIP() //缓存user session - err = this.module.modelSession.Change(user.Uid, map[string]interface{}{ - "uId": user.Uid, + err = this.module.modelSession.Change(user.UId, map[string]interface{}{ + "uid": user.UId, "sessionId": session.GetSessionId(), "gatewayServiceId": session.GetGatewayServiceId(), }, @@ -82,7 +82,7 @@ func (this *Api_Comp) Login(session comm.IUserSession, result map[string]interfa } //缓存user - err = this.module.modelUser.Add(user.Uid, user, cache.WithDisabledMgoLog()) + err = this.module.modelUser.Add(user.UId, user, cache.WithDisabledMgoLog()) if err != nil { code = pb.ErrorCode_DBError return