Commit fd78c9bd authored by chenweijian's avatar chenweijian

错误提示

parent abb0ff1c
...@@ -108,6 +108,8 @@ const ( ...@@ -108,6 +108,8 @@ const (
MSG_ID_NEED_JOIN_FAMILY MsgIdType = 168 // 请加入代理的家族后进行购买 MSG_ID_NEED_JOIN_FAMILY MsgIdType = 168 // 请加入代理的家族后进行购买
MSG_ID_SET_FAMILY_NAMEPL MsgIdType = 169 // 等级不够不能修改家族铭牌 MSG_ID_SET_FAMILY_NAMEPL MsgIdType = 169 // 等级不够不能修改家族铭牌
MSG_ID_CHARGE_NO_AREA MsgIdType = 181 // 充值(代理转账,用户给代理充值),失败,不是本区域用户 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_FAILED AddGroupResultType = 0
ADD_GROUP_DONE AddGroupResultType = 1 ADD_GROUP_DONE AddGroupResultType = 1
......
...@@ -14,7 +14,9 @@ import ( ...@@ -14,7 +14,9 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"hilo-group/_const/enum/group_e" "hilo-group/_const/enum/group_e"
"hilo-group/_const/redis_key" "hilo-group/_const/redis_key"
"hilo-group/common"
"hilo-group/domain/model/noble_m" "hilo-group/domain/model/noble_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m" "hilo-group/domain/model/user_m"
"hilo-group/myerr" "hilo-group/myerr"
"hilo-group/myerr/bizerr" "hilo-group/myerr/bizerr"
...@@ -562,7 +564,7 @@ func (micUser *MicUser) SpeechOpen(userId uint64, externalId string) error { ...@@ -562,7 +564,7 @@ func (micUser *MicUser) SpeechOpen(userId uint64, externalId string) error {
//禁麦, 管理人 同 自己能禁麦(特别注意:产品说,无论是否式管理人开启禁麦,自己同管理人都能关闭禁麦) //禁麦, 管理人 同 自己能禁麦(特别注意:产品说,无论是否式管理人开启禁麦,自己同管理人都能关闭禁麦)
//规则:1:自己禁麦 2:管理人禁麦 //规则:1:自己禁麦 2:管理人禁麦
func (micUser *MicUser) SpeechClose(userId uint64, externalId string) error { func (micUser *MicUser) SpeechClose(userId uint64, externalId, lang string) error {
if micUser == nil { if micUser == nil {
return bizerr.GroupMicNoUser return bizerr.GroupMicNoUser
} else { } else {
...@@ -588,7 +590,8 @@ func (micUser *MicUser) SpeechClose(userId uint64, externalId string) error { ...@@ -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 { if flag, err := noble_m.CheckNobleLevel(micUser.model.Db, micUser.UserId, 5); err != nil {
return err return err
} else if flag { } 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 micUser.Forbid = true
} }
......
...@@ -214,13 +214,13 @@ func (s *GroupMicService) GroupMicSpeechOpen(userId uint64, externalId string, g ...@@ -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) model := domain.CreateModelContext(s.svc.MyContext)
micUser, err := group_m.GetMicUser(model, groupUuid, i) micUser, err := group_m.GetMicUser(model, groupUuid, i)
if err != nil { if err != nil {
return err return err
} }
return micUser.SpeechClose(userId, externalId) return micUser.SpeechClose(userId, externalId, lang)
} }
//麦上的人群发消息 //麦上的人群发消息
......
...@@ -18,12 +18,14 @@ import ( ...@@ -18,12 +18,14 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
"hilo-group/_const/enum/group_e" "hilo-group/_const/enum/group_e"
"hilo-group/_const/redis_key" "hilo-group/_const/redis_key"
"hilo-group/common"
"hilo-group/cv/property_cv" "hilo-group/cv/property_cv"
"hilo-group/domain/cache/group_c" "hilo-group/domain/cache/group_c"
"hilo-group/domain/cache/tim_c" "hilo-group/domain/cache/tim_c"
"hilo-group/domain/event/group_ev" "hilo-group/domain/event/group_ev"
"hilo-group/domain/model/group_m" "hilo-group/domain/model/group_m"
"hilo-group/domain/model/noble_m" "hilo-group/domain/model/noble_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m" "hilo-group/domain/model/user_m"
"hilo-group/domain/service/signal_s" "hilo-group/domain/service/signal_s"
"hilo-group/myerr" "hilo-group/myerr"
...@@ -386,7 +388,7 @@ func (s *GroupService) GroupLeave(userId uint64, externalId string, groupId stri ...@@ -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 { return s.svc.Transactional(func() error {
model := domain.CreateModel(s.svc.CtxAndDb) model := domain.CreateModel(s.svc.CtxAndDb)
//木有model层给我,直接server怼了 //木有model层给我,直接server怼了
...@@ -410,7 +412,8 @@ func (s *GroupService) GroupKick(groupUuid string, userId uint64, userExternalId ...@@ -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 { if flag, err := noble_m.CheckNobleLevel(model.Db, beKickUserId, 5); err != nil {
return err return err
} else if flag { } 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分钟 //踢人10分钟
......
...@@ -100,8 +100,10 @@ var ( ...@@ -100,8 +100,10 @@ var (
TaskHasAward = myerr.NewBusinessCode(19001, "task has award", myerr.BusinessData{}) TaskHasAward = myerr.NewBusinessCode(19001, "task has award", myerr.BusinessData{})
//贵族 //贵族
NobleNoMicSpeechCloseLevel5 = myerr.NewBusinessCode(21001, "Can't mute the King", myerr.BusinessData{}) //无法禁言贵族5 NobleNoMicSpeechCloseLevel5 = myerr.NewBusinessCode(21001, "Can't mute the King", myerr.BusinessData{}) //无法禁言贵族5
NobleNoKickLevel5 = myerr.NewBusinessCode(21002, "Can't kick 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{}) OfficialStaffLimit = myerr.NewBusinessCode(22001, "Operation failed", myerr.BusinessData{})
......
...@@ -832,13 +832,18 @@ func GroupMicSpeechClose(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -832,13 +832,18 @@ func GroupMicSpeechClose(c *gin.Context) (*mycontext.MyContext, error) {
return myContext, err return myContext, err
} }
_, lang, err := req.GetUserIdLang(c, myContext)
if err != nil {
return myContext, err
}
model := domain.CreateModelContext(myContext) model := domain.CreateModelContext(myContext)
groupUuid, err = group_m.ToImGroupId(model, groupUuid) groupUuid, err = group_m.ToImGroupId(model, groupUuid)
if err != nil { if err != nil {
return myContext, err 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 return myContext, err
} }
resp.ResponseOk(c, nil) resp.ResponseOk(c, nil)
......
...@@ -1959,7 +1959,7 @@ func GroupKick(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1959,7 +1959,7 @@ func GroupKick(c *gin.Context) (*mycontext.MyContext, error) {
} }
//beKickUserId, err := toUserId(beKickExternalId) //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 return myContext, err
} }
resp.ResponseOk(c, nil) resp.ResponseOk(c, nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment