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
2fa88c49
Commit
2fa88c49
authored
Apr 28, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:回流量到声网
parent
4c74e62a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
groupInfo.go
domain/model/group_m/groupInfo.go
+8
-0
group_op.go
route/group_r/group_op.go
+11
-5
No files found.
domain/model/group_m/groupInfo.go
View file @
2fa88c49
...
...
@@ -599,3 +599,11 @@ func DeleteTRTC(model *domain.Model, imGroupId string) error {
}
return
nil
}
func
CountTRTC
(
model
*
domain
.
Model
)
int64
{
var
total
int64
if
err
:=
model
.
DB
()
.
Model
(
GroupTrtc
{})
.
Count
(
&
total
)
.
Error
;
err
!=
nil
{
model
.
Log
.
Errorf
(
"CountTRTC fail:%v"
,
err
)
}
return
total
}
route/group_r/group_op.go
View file @
2fa88c49
...
...
@@ -1761,11 +1761,17 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
provider
:=
group_e
.
GroupProvider_SW
if
group_m
.
IsUseTRTC
(
model
,
groupId
)
{
roomUser
,
err
:=
group_m
.
GetRoomOnlineUser
(
myContext
,
groupId
)
if
err
==
nil
&&
roomUser
.
Total
==
0
{
_
=
group_m
.
DeleteTRTC
(
model
,
groupId
)
}
else
{
provider
=
group_e
.
GroupProvider_TRTC
provider
=
group_e
.
GroupProvider_TRTC
total
:=
int64
(
2000
)
if
!
config
.
AppIsRelease
()
{
total
=
0
}
if
group_m
.
CountTRTC
(
model
)
>
total
{
roomUser
,
err
:=
group_m
.
GetRoomOnlineUser
(
myContext
,
groupId
)
if
err
==
nil
&&
roomUser
.
Total
==
0
{
_
=
group_m
.
DeleteTRTC
(
model
,
groupId
)
provider
=
group_e
.
GroupProvider_SW
}
}
}
else
{
//dayMaxCovertNum := int64(20)
...
...
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