Merge branch 'fearture-newScript-daiyb' into dev
This commit is contained in:
commit
f903c56467
@ -7,6 +7,7 @@ import (
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/bundle"
|
||||
"fonchain-fiee/api/cast"
|
||||
"fonchain-fiee/api/files"
|
||||
"fonchain-fiee/cmd/config"
|
||||
"fonchain-fiee/pkg/cache"
|
||||
"fonchain-fiee/pkg/e"
|
||||
@ -40,6 +41,17 @@ func UpdateVideoScript(ctx *gin.Context) {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(ctx, errors.New("内容安全检测服务异常,请稍后再试"))
|
||||
return
|
||||
}
|
||||
if secResp.SecurityStatus != "none" {
|
||||
service.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
newCtx := NewCtxWithUserInfo(ctx)
|
||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||
|
||||
@ -64,6 +64,15 @@ func UpdateWorkImageCore(ctx *gin.Context, req *cast.UpdateWorkImageReq) (*cast.
|
||||
cache.RedisClient.Del(lockKey)
|
||||
}()
|
||||
fmt.Println(ok)
|
||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.New("内容安全检测服务异常,请稍后再试")
|
||||
}
|
||||
if secResp.SecurityStatus != "none" {
|
||||
return nil, errors.New(secResp.Describe)
|
||||
}
|
||||
// 图片鉴定
|
||||
/*for _, v := range req.Images {
|
||||
ok, err = check.SecurityFile(v)
|
||||
@ -278,7 +287,6 @@ func processContentAndAutoTags(ctx *gin.Context, content string) (string, error)
|
||||
func UpdateWorkVideoCore(ctx *gin.Context, req *cast.UpdateWorkVideoReq) (*cast.UpdateWorkVideoResp, error) {
|
||||
var infoResp *accountFiee.UserInfoResponse
|
||||
var err error
|
||||
var ok bool
|
||||
if req.CoverUrl != "" {
|
||||
if filepath.Ext(req.CoverUrl) != ".jpg" && filepath.Ext(req.CoverUrl) != ".jpeg" {
|
||||
return nil, errors.New("图片格式只支持jpg")
|
||||
@ -293,7 +301,15 @@ func UpdateWorkVideoCore(ctx *gin.Context, req *cast.UpdateWorkVideoReq) (*cast.
|
||||
defer func() {
|
||||
cache.RedisClient.Del(lockKey)
|
||||
}()
|
||||
fmt.Println(ok)
|
||||
secResp, err := service.FilesProvider.SecurityScanByText(context.Background(), &files.SecurityScanByTextReq{
|
||||
Text: fmt.Sprintf("%s--%s", req.Title, req.Content),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.New("内容安全检测服务异常,请稍后再试")
|
||||
}
|
||||
if secResp.SecurityStatus != "none" {
|
||||
return nil, errors.New(secResp.Describe)
|
||||
}
|
||||
/* ok, err = check.SecurityText(req.Title)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user