补充公会 公告修改 铭感词过滤
This commit is contained in:
parent
22969820e1
commit
6db6b455a6
@ -1,9 +1,11 @@
|
||||
package sociaty
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/wordfilter"
|
||||
)
|
||||
|
||||
// 公会设置
|
||||
@ -30,6 +32,19 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
|
||||
}
|
||||
|
||||
uid := session.GetUserId()
|
||||
|
||||
//铭感词校验 工会公告
|
||||
if len(req.Notice) > 0 {
|
||||
if iscompliance, inscriptionwords := wordfilter.Validate(req.Notice); !iscompliance {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_SociatyNoticeInscriptionWords,
|
||||
Title: pb.ErrorCode_SociatyNoticeInscriptionWords.ToString(),
|
||||
Message: fmt.Sprintf("工会公告包含铭感词:%s", inscriptionwords),
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
sociaty := this.module.modelSociaty.getUserSociaty(uid)
|
||||
if sociaty == nil {
|
||||
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
|
||||
|
Loading…
Reference in New Issue
Block a user