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
55f05c88
Commit
55f05c88
authored
Mar 29, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trtc
parent
fa66af14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
+23
-3
enum.go
_const/enum/group_e/enum.go
+8
-0
group.go
cv/group_cv/group.go
+1
-0
group_op.go
domain/service/group_s/group_op.go
+7
-2
group_op.go
route/group_r/group_op.go
+7
-1
No files found.
_const/enum/group_e/enum.go
View file @
55f05c88
...
...
@@ -156,3 +156,11 @@ var GROUP_NOBLE4_JOIN_LIMIT uint = 1000
var
GROUP_ROLE_PERSONAL_VIEW_LIMIT
=
5
var
GROUP_MANAGER_LIMIT
uint
=
30
var
GROUP_ADMIN_LIMIT
uint
=
50
type
GroupProvider
=
uint8
const
(
// 群组声音供应商
GroupProvider_SW
GroupProvider
=
1
// 声网
GroupProvider_TRTC
GroupProvider
=
2
// 腾讯trtc
)
cv/group_cv/group.go
View file @
55f05c88
...
...
@@ -221,6 +221,7 @@ type GroupChannelId struct {
Token
string
`json:"token"`
AgoraId
uint32
`json:"agoraId"`
MicNumType
uint8
`json:"micNumType"`
Provider
uint8
`json:"provider"`
// 供应商 1.声网 2.腾讯trtc
}
//国籍视图
...
...
domain/service/group_s/group_op.go
View file @
55f05c88
...
...
@@ -11,6 +11,7 @@ import (
"git.hilo.cn/hilo-common/rpc"
"git.hilo.cn/hilo-common/sdk/agora"
"git.hilo.cn/hilo-common/sdk/tencentyun"
"git.hilo.cn/hilo-common/sdk/trtc"
"git.hilo.cn/hilo-common/utils"
"gorm.io/gorm"
"hilo-group/_const/enum/group_e"
...
...
@@ -115,7 +116,7 @@ func (s *GroupService) LeaveGroupMember(model *domain.Model, groupId string, use
}
//进入房间, 返回channelId, err
func
(
s
*
GroupService
)
GroupIn
(
userId
uint64
,
externalId
string
,
groupUuid
string
,
password
,
imei
,
ip
string
)
(
string
,
string
,
error
)
{
func
(
s
*
GroupService
)
GroupIn
(
userId
uint64
,
externalId
string
,
groupUuid
string
,
password
,
imei
,
ip
string
,
provider
group_e
.
GroupProvider
)
(
string
,
string
,
error
)
{
var
channelId
string
var
token
string
err
:=
s
.
svc
.
Transactional
(
func
()
error
{
...
...
@@ -171,7 +172,11 @@ func (s *GroupService) GroupIn(userId uint64, externalId string, groupUuid strin
if
err
!=
nil
{
return
err
}
channelId
,
token
,
err
=
agora
.
CreateGroupAgora
(
groupInfo
.
ChannelId
,
uint32
(
userId
))
if
provider
==
group_e
.
GroupProvider_TRTC
{
token
=
trtc
.
CreateGroupTRTCUserSig
(
userId
)
}
else
{
channelId
,
token
,
err
=
agora
.
CreateGroupAgora
(
groupInfo
.
ChannelId
,
uint32
(
userId
))
}
if
err
!=
nil
{
return
err
}
else
{
...
...
route/group_r/group_op.go
View file @
55f05c88
...
...
@@ -1751,7 +1751,12 @@ 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
)
if
channelId
,
token
,
err
:=
group_s
.
NewGroupService
(
myContext
)
.
GroupIn
(
userId
,
externalId
,
groupId
,
password
,
imei
,
ip
);
err
!=
nil
{
provider
:=
group_e
.
GroupProvider_SW
if
gi
.
Code
==
"70740667"
{
provider
=
group_e
.
GroupProvider_TRTC
}
if
channelId
,
token
,
err
:=
group_s
.
NewGroupService
(
myContext
)
.
GroupIn
(
userId
,
externalId
,
groupId
,
password
,
imei
,
ip
,
provider
);
err
!=
nil
{
return
myContext
,
err
}
else
{
// 加入房间缓存
...
...
@@ -1767,6 +1772,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
Token
:
token
,
AgoraId
:
uint32
(
userId
),
MicNumType
:
gi
.
MicNumType
,
Provider
:
provider
,
})
// v2.26及以后,客户端自己加TIM群,不再由服务器代加
...
...
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