From a71728dc146b24d6ebcf798078a9d001cb457ed2 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 1 Jan 2024 19:24:32 +0800 Subject: [PATCH] by Robin at 20240101 --- library/contentaudit/imageaudit/imageaudit.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/contentaudit/imageaudit/imageaudit.go b/library/contentaudit/imageaudit/imageaudit.go index f6f1076d..e6a0ef20 100644 --- a/library/contentaudit/imageaudit/imageaudit.go +++ b/library/contentaudit/imageaudit/imageaudit.go @@ -45,7 +45,7 @@ func executeImageAuditTasks(tasks []*ImageAuditTaskControlBlock, batchId string) _result, err := defaultImageAuditClient.ScanImageAdvance(req, runtime) //_result, err := defaultImageAuditClient.ScanImageWithOptions(req, runtime) if err != nil { - logger.Error("ScanImageAdvance fail : %v", err) + logger.Error("ScanImageAdvance fail, requestId : %v, err : %v", _result.Body.RequestId, err) handleBatchError(tasks, batchId, err) return } @@ -87,6 +87,7 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId // 2.打包图像url及图像审核id,转成ScanImageAdvanceRequest reqTasks := make([]*imageaudit.ScanImageAdvanceRequestTask, 0) + reqs := make([]*imageaudit.ScanImageRequestTask, 0) for _, task := range tasks { if util.DerefInt64(task.ImageAuditTask.IsFragmented) == 1 { imageauditIds := util.DerefStringSlice(task.ImageAuditTask.ImageAuditFragmentIds) @@ -101,6 +102,10 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId DataId: goproto.String(imageauditIds[i]), ImageURLObject: file.Body, }) + reqs = append(reqs, &imageaudit.ScanImageRequestTask{ + DataId: goproto.String(imageauditIds[i]), + ImageURL: goproto.String(task.Images[i].Images[0].Urls[0]), + }) } } else { var file *http.Response @@ -113,6 +118,10 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId DataId: task.ImageAuditTask.ImageAuditId, ImageURLObject: file.Body, }) + reqs = append(reqs, &imageaudit.ScanImageRequestTask{ + DataId: task.ImageAuditTask.ImageAuditId, + ImageURL: goproto.String(task.Images[0].Images[0].Urls[0]), + }) } } @@ -121,7 +130,7 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId Scene: scenes, Task: reqTasks, } - logger.Info("本次打包:%v", reqTasks) + logger.Info("本次打包:%v", reqs) return }