From d481605f59a38674e9446d25143e68f997c9942a Mon Sep 17 00:00:00 2001 From: hujiebin Date: Fri, 1 Sep 2023 18:09:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=8D=E5=86=8D=20=E5=86=99enter=5Froom?= =?UTF-8?q?=E8=BF=99=E4=B8=AAkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _const/redis_key/redisPrefix.go | 2 ++ domain/cache/room_c/userRoomVisit.go | 3 --- route/group_r/group_op.go | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/_const/redis_key/redisPrefix.go b/_const/redis_key/redisPrefix.go index d0f8b1c..8734c3a 100644 --- a/_const/redis_key/redisPrefix.go +++ b/_const/redis_key/redisPrefix.go @@ -766,6 +766,8 @@ func GetPrefixGroupInUserDuration(groupUuid string) string { return strings.Replace(groupInUserDuration, "{groupUuid}", groupUuid, -1) } +// Deprecated: 用户进房时间 +// 可用 uer:u:${user_id}代替 func GetUserEnterRoomKey(userId uint64) string { return strings.Replace(userEnterRoom, "{userId}", strconv.FormatUint(userId, 10), -1) } diff --git a/domain/cache/room_c/userRoomVisit.go b/domain/cache/room_c/userRoomVisit.go index f257d46..b2bf2cf 100644 --- a/domain/cache/room_c/userRoomVisit.go +++ b/domain/cache/room_c/userRoomVisit.go @@ -6,7 +6,6 @@ import ( "git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/resource/config" "git.hilo.cn/hilo-common/resource/redisCli" - "github.com/bluele/gcache" redis2 "github.com/go-redis/redis/v8" "github.com/spf13/cast" "hilo-group/_const/redis_key" @@ -78,8 +77,6 @@ func GetUserRoomVisit(userId uint64) (map[string]int64, error) { return result, nil } -var roomVisitCntCache = gcache.New(50000).LRU().Build() - // 批量获取房间访问人数 // 带上lru func MGetRoomVisitCount(groupIds []string) (map[string]string, error) { diff --git a/route/group_r/group_op.go b/route/group_r/group_op.go index c5ef5f0..bd846b8 100644 --- a/route/group_r/group_op.go +++ b/route/group_r/group_op.go @@ -1871,9 +1871,9 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { myContext.Log.Infof("GroupIn, ProcessRoomVisit err: %s", err.Error()) } // 更新用户进入房间缓存记录 - if err = room_c.ProcessUserRoomVisit(userId, groupId); err != nil { - myContext.Log.Infof("GroupIn, ProcessUserRoomVisit err: %s", err.Error()) - } + //if err = room_c.ProcessUserRoomVisit(userId, groupId); err != nil { + // myContext.Log.Infof("GroupIn, ProcessUserRoomVisit err: %s", err.Error()) + //} resp.ResponseOk(c, group_cv.GroupChannelId{ ChannelId: channelId, Token: token, -- 2.22.0