From cc89d144cec3a5b0dec7afdadbaab32bb3bf4dcd Mon Sep 17 00:00:00 2001 From: iamhujiebin <458249864@qq.com> Date: Mon, 28 Aug 2023 02:09:52 +0800 Subject: [PATCH] Update room.go --- domain/model/group_m/room.go | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/domain/model/group_m/room.go b/domain/model/group_m/room.go index cc6fbfd..195e5b1 100644 --- a/domain/model/group_m/room.go +++ b/domain/model/group_m/room.go @@ -46,6 +46,7 @@ func analysisMemberStr(memberStr string) (string, uint64) { } func RoomLivingExpire(model *domain.Model, groupUid string, userId uint64) { + return // todo model.Log.Infof("room RoomLivingExpire userId:%v, groupUid:%v", userId, groupUid) // key := redis_key.GetPrefixGroupRoomLiving() @@ -67,17 +68,18 @@ func RoomLivingIn(model *domain.Model, groupUid string, userId uint64, externalI if !robot { RoomLivingLeave(model, userId, externalId, "") } - // - key := redis_key.GetPrefixGroupRoomLiving() - i, err := redisCli.GetRedis().ZAdd(context.Background(), key, &redis2.Z{ - Score: float64(time.Now().Unix()), - Member: getMemberStr(groupUid, userId), - }).Result() - if err != nil { - model.Log.Errorf("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v, err:%v", key, groupUid, userId, err) - } else { - model.Log.Infof("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v result:%v", key, groupUid, userId, i) - } + // todo + var err error + //key := redis_key.GetPrefixGroupRoomLiving() + //i, err := redisCli.GetRedis().ZAdd(context.Background(), key, &redis2.Z{ + // Score: float64(time.Now().Unix()), + // Member: getMemberStr(groupUid, userId), + //}).Result() + //if err != nil { + // model.Log.Errorf("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v, err:%v", key, groupUid, userId, err) + //} else { + // model.Log.Infof("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v result:%v", key, groupUid, userId, i) + //} go func(myContext *mycontext.MyContext, groupId string) { model := domain.CreateModelContext(myContext) // 野协程给新的model.Db @@ -268,6 +270,7 @@ func RoomLivingLeaveByMgr(model *domain.Model, userId uint64, externalId string, //获取在房间的用户(其中成员的位置按分数值递增(从大到小)来排序) func RoomLivingExistsUserId(groupUid string) ([]uint64, error) { + return nil, nil // todo key := redis_key.GetPrefixGroupRoomLiving() //if err := redisCli.ClearExpired(key, expireMinute); err != nil { var model = domain.CreateModelNil() @@ -292,6 +295,7 @@ func RoomLivingExistsUserId(groupUid string) ([]uint64, error) { //获取在房间的用户 返回值:map,key:userId, value:groupUuid func RoomLivingUserIdFilter(userIds []mysql.ID) (map[mysql.ID]string, error) { + return make(map[mysql.ID]string), nil // todo userIdSet := map[mysql.ID]struct{}{} for i, _ := range userIds { userIdSet[userIds[i]] = struct{}{} @@ -322,6 +326,7 @@ func RoomLivingUserIdFilter(userIds []mysql.ID) (map[mysql.ID]string, error) { //获取有人的房间, 返回值:Map[groupUid]Set func RoomLivingExistsGroup(model *domain.Model) (map[string]map[uint64]struct{}, error) { + return map[string]map[uint64]struct{}{}, nil // todo key := redis_key.GetPrefixGroupRoomLiving() //if err := redisCli.ClearExpired(key, expireMinute); err != nil { if err := model.Redis.ZRemRangeByScore(model, key, "0", strconv.FormatInt(time.Now().Unix()-expireMinute, 10)).Err(); err != nil { -- 2.22.0