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
540a8c2b
Commit
540a8c2b
authored
Apr 07, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trtc
parent
2b288475
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
groupInfo.go
domain/model/group_m/groupInfo.go
+9
-0
trtc.sql
mysql/trtc.sql
+9
-0
group_op.go
route/group_r/group_op.go
+1
-2
No files found.
domain/model/group_m/groupInfo.go
View file @
540a8c2b
...
@@ -566,3 +566,12 @@ func GetFamilyRooms(model *domain.Model, familyId uint64, pageSize, pageIndex in
...
@@ -566,3 +566,12 @@ func GetFamilyRooms(model *domain.Model, familyId uint64, pageSize, pageIndex in
return
res
,
nextIdx
,
hasNext
,
nil
return
res
,
nextIdx
,
hasNext
,
nil
}
}
func
IsUseTRTC
(
model
*
domain
.
Model
,
imGroupId
string
)
bool
{
var
count
int64
if
err
:=
model
.
DB
()
.
Table
(
"group_trtc"
)
.
Where
(
"im_group_id=?"
,
imGroupId
)
.
Count
(
&
count
)
.
Error
;
err
!=
nil
{
model
.
Log
.
Errorf
(
"IsUseTRTC err:%v, groupId:%s"
,
err
,
imGroupId
)
return
false
}
return
count
>
0
}
mysql/trtc.sql
0 → 100644
View file @
540a8c2b
-
CREATE
TABLE
`group_trtc`
(
`id`
bigint
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'id'
,
`im_group_id`
char
(
32
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`created_time`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`updated_time`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`im_group_id`
(
`im_group_id`
),
KEY
`created_time`
(
`created_time`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'使用trtc的群组'
;
\ No newline at end of file
route/group_r/group_op.go
View file @
540a8c2b
...
@@ -1752,8 +1752,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1752,8 +1752,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
model
.
Log
.
Infof
(
"GroupIn ip userId:%v,imGroupId:%v,ip:%v,imei:%v"
,
userId
,
groupId
,
ip
,
imei
)
model
.
Log
.
Infof
(
"GroupIn ip userId:%v,imGroupId:%v,ip:%v,imei:%v"
,
userId
,
groupId
,
ip
,
imei
)
provider
:=
group_e
.
GroupProvider_SW
provider
:=
group_e
.
GroupProvider_SW
roomImGroupIdMap
:=
map
[
string
]
bool
{
"@TGS#3TMXOFJHC"
:
true
,
"@TGS#3I57DMRIB"
:
true
}
if
group_m
.
IsUseTRTC
(
model
,
groupId
)
{
if
_
,
ok
:=
roomImGroupIdMap
[
gi
.
ImGroupId
];
ok
{
provider
=
group_e
.
GroupProvider_TRTC
provider
=
group_e
.
GroupProvider_TRTC
}
}
...
...
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