上传工会创建时铭感词校验
This commit is contained in:
parent
cf6f80a7d1
commit
2043d4f468
@ -2,6 +2,7 @@ package sociaty
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/pb"
|
||||
@ -11,6 +12,7 @@ import (
|
||||
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/sys/wordfilter"
|
||||
)
|
||||
|
||||
// 公会创建
|
||||
@ -35,6 +37,27 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
|
||||
return
|
||||
}
|
||||
|
||||
//铭感词校验 工会名称
|
||||
if iscompliance, inscriptionwords := wordfilter.Validate(req.Name); !iscompliance {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_SociatyNameInscriptionWords,
|
||||
Title: pb.ErrorCode_SociatyNameInscriptionWords.ToString(),
|
||||
Message: fmt.Sprintf("工会名称包含铭感词:%s", inscriptionwords),
|
||||
}
|
||||
return
|
||||
}
|
||||
//铭感词校验 工会公告
|
||||
if len(req.Notice) > 0 {
|
||||
if iscompliance, inscriptionwords := wordfilter.Validate(req.Notice); !iscompliance {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_SociatyNameInscriptionWords,
|
||||
Title: pb.ErrorCode_SociatyNameInscriptionWords.ToString(),
|
||||
Message: fmt.Sprintf("工会名称包含铭感词:%s", inscriptionwords),
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
uid := session.GetUserId()
|
||||
user := this.module.ModuleUser.GetUser(uid)
|
||||
if user == nil {
|
||||
|
1618
pb/errorcode.pb.go
1618
pb/errorcode.pb.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user