同步dev

This commit is contained in:
liwei1dao 2022-06-21 13:55:52 +08:00
parent f0df016e8b
commit 14710e9893
9 changed files with 12 additions and 19 deletions

View File

@ -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 {

View File

@ -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,
})

View File

@ -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}

View File

@ -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}

View File

@ -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 {

View File

@ -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}

View File

@ -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 {

View File

@ -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)
}

View File

@ -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