Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
d481605f
Commit
d481605f
authored
Sep 01, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:不再 写enter_room这个key
parent
9264dfbf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
redisPrefix.go
_const/redis_key/redisPrefix.go
+2
-0
userRoomVisit.go
domain/cache/room_c/userRoomVisit.go
+0
-3
group_op.go
route/group_r/group_op.go
+3
-3
No files found.
_const/redis_key/redisPrefix.go
View file @
d481605f
...
...
@@ -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
)
}
...
...
domain/cache/room_c/userRoomVisit.go
View file @
d481605f
...
...
@@ -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
)
{
...
...
route/group_r/group_op.go
View file @
d481605f
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment