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
fd78c9bd
Commit
fd78c9bd
authored
Apr 27, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误提示
parent
abb0ff1c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
10 deletions
+25
-10
constDef.go
common/constDef.go
+2
-0
mic.go
domain/model/group_m/mic.go
+5
-2
group_mic.go
domain/service/group_mic_s/group_mic.go
+2
-2
group_op.go
domain/service/group_s/group_op.go
+5
-2
bizCode.go
myerr/bizerr/bizCode.go
+4
-2
group_mic.go
route/group_r/group_mic.go
+6
-1
group_op.go
route/group_r/group_op.go
+1
-1
No files found.
common/constDef.go
View file @
fd78c9bd
...
...
@@ -108,6 +108,8 @@ const (
MSG_ID_NEED_JOIN_FAMILY
MsgIdType
=
168
// 请加入代理的家族后进行购买
MSG_ID_SET_FAMILY_NAMEPL
MsgIdType
=
169
// 等级不够不能修改家族铭牌
MSG_ID_CHARGE_NO_AREA
MsgIdType
=
181
// 充值(代理转账,用户给代理充值),失败,不是本区域用户
MSG_ID_BAN_MIC_NOBLE_5
MsgIdType
=
188
//无法禁言VIP5和vip6
MSG_ID_KICK_NOBLE_5
MsgIdType
=
189
//无法踢出VIP5和vip6
ADD_GROUP_FAILED
AddGroupResultType
=
0
ADD_GROUP_DONE
AddGroupResultType
=
1
...
...
domain/model/group_m/mic.go
View file @
fd78c9bd
...
...
@@ -14,7 +14,9 @@ import (
"gorm.io/gorm"
"hilo-group/_const/enum/group_e"
"hilo-group/_const/redis_key"
"hilo-group/common"
"hilo-group/domain/model/noble_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m"
"hilo-group/myerr"
"hilo-group/myerr/bizerr"
...
...
@@ -562,7 +564,7 @@ func (micUser *MicUser) SpeechOpen(userId uint64, externalId string) error {
//禁麦, 管理人 同 自己能禁麦(特别注意:产品说,无论是否式管理人开启禁麦,自己同管理人都能关闭禁麦)
//规则:1:自己禁麦 2:管理人禁麦
func
(
micUser
*
MicUser
)
SpeechClose
(
userId
uint64
,
externalId
string
)
error
{
func
(
micUser
*
MicUser
)
SpeechClose
(
userId
uint64
,
externalId
,
lang
string
)
error
{
if
micUser
==
nil
{
return
bizerr
.
GroupMicNoUser
}
else
{
...
...
@@ -588,7 +590,8 @@ func (micUser *MicUser) SpeechClose(userId uint64, externalId string) error {
if
flag
,
err
:=
noble_m
.
CheckNobleLevel
(
micUser
.
model
.
Db
,
micUser
.
UserId
,
5
);
err
!=
nil
{
return
err
}
else
if
flag
{
return
bizerr
.
NobleNoMicSpeechCloseLevel5
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
micUser
.
model
.
Db
,
common
.
MSG_ID_BAN_MIC_NOBLE_5
,
lang
,
bizerr
.
NobleNoMicSpeechCloseOverLevel5
))
//return bizerr.NobleNoMicSpeechCloseLevel5
}
micUser
.
Forbid
=
true
}
...
...
domain/service/group_mic_s/group_mic.go
View file @
fd78c9bd
...
...
@@ -214,13 +214,13 @@ func (s *GroupMicService) GroupMicSpeechOpen(userId uint64, externalId string, g
}
//关闭麦
func
(
s
*
GroupMicService
)
GroupMicSpeechClose
(
userId
uint64
,
externalId
string
,
groupUuid
string
,
i
int
)
error
{
func
(
s
*
GroupMicService
)
GroupMicSpeechClose
(
userId
uint64
,
externalId
string
,
groupUuid
,
lang
string
,
i
int
)
error
{
model
:=
domain
.
CreateModelContext
(
s
.
svc
.
MyContext
)
micUser
,
err
:=
group_m
.
GetMicUser
(
model
,
groupUuid
,
i
)
if
err
!=
nil
{
return
err
}
return
micUser
.
SpeechClose
(
userId
,
externalId
)
return
micUser
.
SpeechClose
(
userId
,
externalId
,
lang
)
}
//麦上的人群发消息
...
...
domain/service/group_s/group_op.go
View file @
fd78c9bd
...
...
@@ -18,12 +18,14 @@ import (
"gorm.io/gorm"
"hilo-group/_const/enum/group_e"
"hilo-group/_const/redis_key"
"hilo-group/common"
"hilo-group/cv/property_cv"
"hilo-group/domain/cache/group_c"
"hilo-group/domain/cache/tim_c"
"hilo-group/domain/event/group_ev"
"hilo-group/domain/model/group_m"
"hilo-group/domain/model/noble_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m"
"hilo-group/domain/service/signal_s"
"hilo-group/myerr"
...
...
@@ -386,7 +388,7 @@ func (s *GroupService) GroupLeave(userId uint64, externalId string, groupId stri
}
//踢人
func
(
s
*
GroupService
)
GroupKick
(
groupUuid
string
,
userId
uint64
,
userExternalId
string
,
userNick
string
,
avatar
string
,
beKickUserId
uint64
,
beKickExternalId
string
,
beKickUserNick
string
,
beKickUserAvatar
string
)
error
{
func
(
s
*
GroupService
)
GroupKick
(
groupUuid
string
,
userId
uint64
,
userExternalId
string
,
userNick
string
,
avatar
string
,
beKickUserId
uint64
,
beKickExternalId
string
,
beKickUserNick
string
,
beKickUserAvatar
,
lang
string
)
error
{
return
s
.
svc
.
Transactional
(
func
()
error
{
model
:=
domain
.
CreateModel
(
s
.
svc
.
CtxAndDb
)
//木有model层给我,直接server怼了
...
...
@@ -410,7 +412,8 @@ func (s *GroupService) GroupKick(groupUuid string, userId uint64, userExternalId
if
flag
,
err
:=
noble_m
.
CheckNobleLevel
(
model
.
Db
,
beKickUserId
,
5
);
err
!=
nil
{
return
err
}
else
if
flag
{
return
bizerr
.
NobleNoKickLevel5
return
myerr
.
WrapErr
(
res_m
.
GetErrByLanguage
(
model
.
Db
,
common
.
MSG_ID_KICK_NOBLE_5
,
lang
,
bizerr
.
NobleNoKickOverLevel5
))
//return bizerr.NobleNoKickLevel5
}
}
//踢人10分钟
...
...
myerr/bizerr/bizCode.go
View file @
fd78c9bd
...
...
@@ -102,6 +102,8 @@ var (
//贵族
NobleNoMicSpeechCloseLevel5
=
myerr
.
NewBusinessCode
(
21001
,
"Can't mute the King"
,
myerr
.
BusinessData
{})
//无法禁言贵族5
NobleNoKickLevel5
=
myerr
.
NewBusinessCode
(
21002
,
"Can't kick the King"
,
myerr
.
BusinessData
{})
//无法禁言贵族5
NobleNoMicSpeechCloseOverLevel5
=
myerr
.
NewBusinessCode
(
21003
,
"Unable to mute VIP5 and VIP6"
,
myerr
.
BusinessData
{})
//无法禁言贵族5、6
NobleNoKickOverLevel5
=
myerr
.
NewBusinessCode
(
21004
,
"Unable to kick out VIP5 and VIP6"
,
myerr
.
BusinessData
{})
//无法踢出贵族5、6
// 超级管理人
OfficialStaffLimit
=
myerr
.
NewBusinessCode
(
22001
,
"Operation failed"
,
myerr
.
BusinessData
{})
...
...
route/group_r/group_mic.go
View file @
fd78c9bd
...
...
@@ -832,13 +832,18 @@ func GroupMicSpeechClose(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
err
}
_
,
lang
,
err
:=
req
.
GetUserIdLang
(
c
,
myContext
)
if
err
!=
nil
{
return
myContext
,
err
}
model
:=
domain
.
CreateModelContext
(
myContext
)
groupUuid
,
err
=
group_m
.
ToImGroupId
(
model
,
groupUuid
)
if
err
!=
nil
{
return
myContext
,
err
}
if
err
:=
group_mic_s
.
NewGroupPowerService
(
myContext
)
.
GroupMicSpeechClose
(
userId
,
externalId
,
groupUuid
,
i
);
err
!=
nil
{
if
err
:=
group_mic_s
.
NewGroupPowerService
(
myContext
)
.
GroupMicSpeechClose
(
userId
,
externalId
,
groupUuid
,
lang
,
i
);
err
!=
nil
{
return
myContext
,
err
}
resp
.
ResponseOk
(
c
,
nil
)
...
...
route/group_r/group_op.go
View file @
fd78c9bd
...
...
@@ -1959,7 +1959,7 @@ func GroupKick(c *gin.Context) (*mycontext.MyContext, error) {
}
//beKickUserId, err := toUserId(beKickExternalId)
if
err
:=
group_s
.
NewGroupService
(
myContext
)
.
GroupKick
(
groupId
,
userId
,
externalId
,
nick
,
avatar
,
beKickUser
.
ID
,
beKickUser
.
ExternalId
,
beKickUser
.
Nick
,
beKickUser
.
Avatar
);
err
!=
nil
{
if
err
:=
group_s
.
NewGroupService
(
myContext
)
.
GroupKick
(
groupId
,
userId
,
externalId
,
nick
,
avatar
,
beKickUser
.
ID
,
beKickUser
.
ExternalId
,
beKickUser
.
Nick
,
beKickUser
.
Avatar
,
lang
);
err
!=
nil
{
return
myContext
,
err
}
resp
.
ResponseOk
(
c
,
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