同步dev
This commit is contained in:
parent
f0df016e8b
commit
14710e9893
@ -78,7 +78,7 @@ func (this *ApiComp) Addblack(session comm.IUserSession, chk map[string]interfac
|
|||||||
self.BlackIds = append(self.BlackIds, req.FriendId)
|
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,
|
"blackIds": self.BlackIds,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -82,7 +82,7 @@ func (this *ApiComp) Agree(session comm.IUserSession, chk map[string]interface{}
|
|||||||
}
|
}
|
||||||
target.FriendIds = append(target.FriendIds, self.UId)
|
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,
|
"friendIds": target.FriendIds,
|
||||||
})
|
})
|
||||||
if err != nil {
|
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,
|
"applyIds": self.ApplyIds,
|
||||||
"friendIds": self.FriendIds,
|
"friendIds": self.FriendIds,
|
||||||
})
|
})
|
||||||
|
@ -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) {
|
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{})
|
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)
|
err := this.module.model_friend.Get(session.GetUserId(), self)
|
||||||
if self == nil || err != nil {
|
if self == nil || err != nil {
|
||||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||||
|
@ -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) {
|
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{})
|
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)
|
err := this.module.model_friend.Get(session.GetUserId(), self)
|
||||||
if self == nil || err != nil {
|
if self == nil || err != nil {
|
||||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||||
|
@ -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) {
|
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{})
|
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)
|
err := this.module.model_friend.Get(session.GetUserId(), self)
|
||||||
if self == nil || err != nil {
|
if self == nil || err != nil {
|
||||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
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)
|
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,
|
"blackIds": self.BlackIds,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -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) {
|
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{})
|
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)
|
err := this.module.model_friend.Get(session.GetUserId(), self)
|
||||||
if self == nil || err != nil {
|
if self == nil || err != nil {
|
||||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||||
|
@ -66,7 +66,7 @@ func (this *ApiComp) Refuse(session comm.IUserSession, chk map[string]interface{
|
|||||||
}
|
}
|
||||||
//更新
|
//更新
|
||||||
if optNum > 0 {
|
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,
|
"applyIds": self.ApplyIds,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -156,10 +156,3 @@ func Pack_UpdateGridToUserPack(uId string, grids ...*pb.DB_UserItemData) (err er
|
|||||||
module.model_pack_comp.DB.InsertMany(DB_PackTable, data)
|
module.model_pack_comp.DB.InsertMany(DB_PackTable, data)
|
||||||
return
|
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)
|
|
||||||
}
|
|
||||||
|
@ -69,8 +69,8 @@ func (this *Api_Comp) Login(session comm.IUserSession, result map[string]interfa
|
|||||||
user.Createip = session.GetIP()
|
user.Createip = session.GetIP()
|
||||||
|
|
||||||
//缓存user session
|
//缓存user session
|
||||||
err = this.module.modelSession.Change(user.Uid, map[string]interface{}{
|
err = this.module.modelSession.Change(user.UId, map[string]interface{}{
|
||||||
"uId": user.Uid,
|
"uid": user.UId,
|
||||||
"sessionId": session.GetSessionId(),
|
"sessionId": session.GetSessionId(),
|
||||||
"gatewayServiceId": session.GetGatewayServiceId(),
|
"gatewayServiceId": session.GetGatewayServiceId(),
|
||||||
},
|
},
|
||||||
@ -82,7 +82,7 @@ func (this *Api_Comp) Login(session comm.IUserSession, result map[string]interfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
//缓存user
|
//缓存user
|
||||||
err = this.module.modelUser.Add(user.Uid, user, cache.WithDisabledMgoLog())
|
err = this.module.modelUser.Add(user.UId, user, cache.WithDisabledMgoLog())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user