Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
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
chenweijian
hilo-user
Commits
fa6cfda8
Commit
fa6cfda8
authored
Sep 03, 2023
by
JiebinHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group_room_living
parent
484f4349
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
room.go
domain/model/group_m/room.go
+2
-4
No files found.
domain/model/group_m/room.go
View file @
fa6cfda8
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/redisCli"
"hilo-user/_const/redis_key/group_k"
"hilo-user/_const/redis_key/group_k"
"hilo-user/myerr"
"hilo-user/myerr"
"strconv"
"strconv"
...
@@ -26,7 +25,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
...
@@ -26,7 +25,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
return
nil
,
myerr
.
WrapErr
(
err
)
return
nil
,
myerr
.
WrapErr
(
err
)
}
}
groupUserIdstrs
,
err
:=
redisCli
.
GetRedis
()
.
ZRange
(
model
,
key
,
0
,
-
1
)
.
Result
()
groupUserIdstrs
,
err
:=
model
.
RedisCluster
.
ZRange
(
model
,
key
,
0
,
-
1
)
.
Result
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
myerr
.
WrapErr
(
err
)
return
nil
,
myerr
.
WrapErr
(
err
)
}
}
...
@@ -34,7 +33,6 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
...
@@ -34,7 +33,6 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
resultUserSet
:=
map
[
mysql
.
ID
]
string
{}
resultUserSet
:=
map
[
mysql
.
ID
]
string
{}
for
i
,
_
:=
range
groupUserIdstrs
{
for
i
,
_
:=
range
groupUserIdstrs
{
tempGroupUid
,
userId
:=
analysisMemberStr
(
groupUserIdstrs
[
i
])
tempGroupUid
,
userId
:=
analysisMemberStr
(
groupUserIdstrs
[
i
])
mylogrus
.
MyLog
.
Debugf
(
"RoomLivingUserIdFilter, analysisMemberStr %s, %d"
,
tempGroupUid
,
userId
)
if
_
,
flag
:=
userIdSet
[
userId
];
flag
{
if
_
,
flag
:=
userIdSet
[
userId
];
flag
{
resultUserSet
[
userId
]
=
tempGroupUid
resultUserSet
[
userId
]
=
tempGroupUid
...
@@ -44,7 +42,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
...
@@ -44,7 +42,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
}
}
func
ClearExpired
(
model
*
domain
.
Model
,
key
string
,
expireSec
int64
)
error
{
func
ClearExpired
(
model
*
domain
.
Model
,
key
string
,
expireSec
int64
)
error
{
return
model
.
Redis
.
ZRemRangeByScore
(
model
,
key
,
return
model
.
Redis
Cluster
.
ZRemRangeByScore
(
model
,
key
,
"0"
,
strconv
.
FormatInt
(
time
.
Now
()
.
Unix
()
-
expireSec
,
10
))
.
Err
()
"0"
,
strconv
.
FormatInt
(
time
.
Now
()
.
Unix
()
-
expireSec
,
10
))
.
Err
()
}
}
...
...
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