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
e8b2157d
Commit
e8b2157d
authored
Aug 28, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Update room.go"
This reverts commit
cc89d144
.
parent
155ad046
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
room.go
domain/model/group_m/room.go
+11
-16
No files found.
domain/model/group_m/room.go
View file @
e8b2157d
...
@@ -46,7 +46,6 @@ func analysisMemberStr(memberStr string) (string, uint64) {
...
@@ -46,7 +46,6 @@ func analysisMemberStr(memberStr string) (string, uint64) {
}
}
func
RoomLivingExpire
(
model
*
domain
.
Model
,
groupUid
string
,
userId
uint64
)
{
func
RoomLivingExpire
(
model
*
domain
.
Model
,
groupUid
string
,
userId
uint64
)
{
return
// todo
model
.
Log
.
Infof
(
"room RoomLivingExpire userId:%v, groupUid:%v"
,
userId
,
groupUid
)
model
.
Log
.
Infof
(
"room RoomLivingExpire userId:%v, groupUid:%v"
,
userId
,
groupUid
)
//
//
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
...
@@ -68,18 +67,17 @@ func RoomLivingIn(model *domain.Model, groupUid string, userId uint64, externalI
...
@@ -68,18 +67,17 @@ func RoomLivingIn(model *domain.Model, groupUid string, userId uint64, externalI
if
!
robot
{
if
!
robot
{
RoomLivingLeave
(
model
,
userId
,
externalId
,
""
)
RoomLivingLeave
(
model
,
userId
,
externalId
,
""
)
}
}
// todo
//
var
err
error
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
//key := redis_key.GetPrefixGroupRoomLiving()
i
,
err
:=
redisCli
.
GetRedis
()
.
ZAdd
(
context
.
Background
(),
key
,
&
redis2
.
Z
{
//i, err := redisCli.GetRedis().ZAdd(context.Background(), key, &redis2.Z{
Score
:
float64
(
time
.
Now
()
.
Unix
()),
// Score: float64(time.Now().Unix()),
Member
:
getMemberStr
(
groupUid
,
userId
),
// Member: getMemberStr(groupUid, userId),
})
.
Result
()
//}).Result()
if
err
!=
nil
{
//if err != nil {
model
.
Log
.
Errorf
(
"UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v, err:%v"
,
key
,
groupUid
,
userId
,
err
)
// model.Log.Errorf("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v, err:%v", key, groupUid, userId, err)
}
else
{
//} else {
model
.
Log
.
Infof
(
"UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v result:%v"
,
key
,
groupUid
,
userId
,
i
)
// model.Log.Infof("UpdateRoomLiving ZAdd key:%v, groupUid:%v, userId:%v result:%v", key, groupUid, userId, i)
}
//}
go
func
(
myContext
*
mycontext
.
MyContext
,
groupId
string
)
{
go
func
(
myContext
*
mycontext
.
MyContext
,
groupId
string
)
{
model
:=
domain
.
CreateModelContext
(
myContext
)
// 野协程给新的model.Db
model
:=
domain
.
CreateModelContext
(
myContext
)
// 野协程给新的model.Db
...
@@ -270,7 +268,6 @@ func RoomLivingLeaveByMgr(model *domain.Model, userId uint64, externalId string,
...
@@ -270,7 +268,6 @@ func RoomLivingLeaveByMgr(model *domain.Model, userId uint64, externalId string,
//获取在房间的用户(其中成员的位置按分数值递增(从大到小)来排序)
//获取在房间的用户(其中成员的位置按分数值递增(从大到小)来排序)
func
RoomLivingExistsUserId
(
groupUid
string
)
([]
uint64
,
error
)
{
func
RoomLivingExistsUserId
(
groupUid
string
)
([]
uint64
,
error
)
{
return
nil
,
nil
// todo
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
//if err := redisCli.ClearExpired(key, expireMinute); err != nil {
//if err := redisCli.ClearExpired(key, expireMinute); err != nil {
var
model
=
domain
.
CreateModelNil
()
var
model
=
domain
.
CreateModelNil
()
...
@@ -295,7 +292,6 @@ func RoomLivingExistsUserId(groupUid string) ([]uint64, error) {
...
@@ -295,7 +292,6 @@ func RoomLivingExistsUserId(groupUid string) ([]uint64, error) {
//获取在房间的用户 返回值:map,key:userId, value:groupUuid
//获取在房间的用户 返回值:map,key:userId, value:groupUuid
func
RoomLivingUserIdFilter
(
userIds
[]
mysql
.
ID
)
(
map
[
mysql
.
ID
]
string
,
error
)
{
func
RoomLivingUserIdFilter
(
userIds
[]
mysql
.
ID
)
(
map
[
mysql
.
ID
]
string
,
error
)
{
return
make
(
map
[
mysql
.
ID
]
string
),
nil
// todo
userIdSet
:=
map
[
mysql
.
ID
]
struct
{}{}
userIdSet
:=
map
[
mysql
.
ID
]
struct
{}{}
for
i
,
_
:=
range
userIds
{
for
i
,
_
:=
range
userIds
{
userIdSet
[
userIds
[
i
]]
=
struct
{}{}
userIdSet
[
userIds
[
i
]]
=
struct
{}{}
...
@@ -326,7 +322,6 @@ func RoomLivingUserIdFilter(userIds []mysql.ID) (map[mysql.ID]string, error) {
...
@@ -326,7 +322,6 @@ func RoomLivingUserIdFilter(userIds []mysql.ID) (map[mysql.ID]string, error) {
//获取有人的房间, 返回值:Map[groupUid]Set<UserId>
//获取有人的房间, 返回值:Map[groupUid]Set<UserId>
func
RoomLivingExistsGroup
(
model
*
domain
.
Model
)
(
map
[
string
]
map
[
uint64
]
struct
{},
error
)
{
func
RoomLivingExistsGroup
(
model
*
domain
.
Model
)
(
map
[
string
]
map
[
uint64
]
struct
{},
error
)
{
return
map
[
string
]
map
[
uint64
]
struct
{}{},
nil
// todo
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
key
:=
redis_key
.
GetPrefixGroupRoomLiving
()
//if err := redisCli.ClearExpired(key, expireMinute); err != nil {
//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
{
if
err
:=
model
.
Redis
.
ZRemRangeByScore
(
model
,
key
,
"0"
,
strconv
.
FormatInt
(
time
.
Now
()
.
Unix
()
-
expireMinute
,
10
))
.
Err
();
err
!=
nil
{
...
...
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