Compare commits
3 Commits
69e775559a
...
2e0dea7883
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e0dea7883 | |||
| 324830cc6b | |||
| 436641a181 |
@ -7,7 +7,6 @@ import (
|
|||||||
"fonchain-fiee/api/accountFiee"
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/api/files"
|
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/cache"
|
"fonchain-fiee/pkg/cache"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
@ -41,16 +40,8 @@ func UpdateVideoScript(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
if err = SecurityText(req.Title); err != nil {
|
||||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
service.Error(ctx, errors.New("标题未通过黄反"))
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, errors.New("内容安全检测服务异常,请稍后再试"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if secResp.SecurityStatus == "high" {
|
|
||||||
service.Error(ctx, errors.New("内容鉴定未通过"))
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
newCtx := NewCtxWithUserInfo(ctx)
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
|
|||||||
@ -64,14 +64,11 @@ func UpdateWorkImageCore(ctx *gin.Context, req *cast.UpdateWorkImageReq) (*cast.
|
|||||||
cache.RedisClient.Del(lockKey)
|
cache.RedisClient.Del(lockKey)
|
||||||
}()
|
}()
|
||||||
fmt.Println(ok)
|
fmt.Println(ok)
|
||||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
if err = SecurityText(req.Title); err != nil {
|
||||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
return nil, errors.New("标题未通过黄反")
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("内容安全检测服务异常,请稍后再试")
|
|
||||||
}
|
}
|
||||||
if secResp.SecurityStatus == "high" {
|
if err = SecurityText(req.Content); err != nil {
|
||||||
return nil, errors.New(fmt.Sprintf("敏感词:%s", secResp.ProblemText))
|
return nil, errors.New("内容未通过黄反")
|
||||||
}
|
}
|
||||||
// 图片鉴定
|
// 图片鉴定
|
||||||
/*for _, v := range req.Images {
|
/*for _, v := range req.Images {
|
||||||
@ -301,14 +298,11 @@ func UpdateWorkVideoCore(ctx *gin.Context, req *cast.UpdateWorkVideoReq) (*cast.
|
|||||||
defer func() {
|
defer func() {
|
||||||
cache.RedisClient.Del(lockKey)
|
cache.RedisClient.Del(lockKey)
|
||||||
}()
|
}()
|
||||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
if err = SecurityText(req.Title); err != nil {
|
||||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
return nil, errors.New("标题未通过黄反")
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("内容安全检测服务异常,请稍后再试")
|
|
||||||
}
|
}
|
||||||
if secResp.SecurityStatus == "high" {
|
if err = SecurityText(req.Content); err != nil {
|
||||||
return nil, errors.New(fmt.Sprintf("敏感词:%s", secResp.ProblemText))
|
return nil, errors.New("内容未通过黄反")
|
||||||
}
|
}
|
||||||
/* ok, err = check.SecurityText(req.Title)
|
/* ok, err = check.SecurityText(req.Title)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -2214,3 +2208,19 @@ func UpdateWorkScript(ctx *gin.Context) {
|
|||||||
service.Success(ctx, nil)
|
service.Success(ctx, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SecurityText(keywords string) error {
|
||||||
|
if keywords == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
||||||
|
Text: keywords,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return errors.New("内容安全检测服务异常,请稍后再试")
|
||||||
|
}
|
||||||
|
if secResp.SecurityStatus == "high" {
|
||||||
|
return errors.New(secResp.ProblemText)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user