From 58a238e9c94b1bc24038726b4dd2978450a94a96 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Sun, 28 Apr 2024 21:51:16 +0800 Subject: [PATCH] by Robin at 20240428 --- library/contentaudit/imageaudit/imageaudit.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/library/contentaudit/imageaudit/imageaudit.go b/library/contentaudit/imageaudit/imageaudit.go index 20a08668..1c9aaf7a 100644 --- a/library/contentaudit/imageaudit/imageaudit.go +++ b/library/contentaudit/imageaudit/imageaudit.go @@ -61,6 +61,7 @@ func Run(batchId string) (successNum int, failNum int, err error) { ConnectTimeout: tea.Int(30000), } + results := make([]*imageaudit.ScanImageResponseBodyDataResults, 0) for _, req := range reqs { var _result *imageaudit.ScanImageResponse _result, err = defaultImageAuditClient.ScanImageAdvance(req, runtime) @@ -72,12 +73,13 @@ func Run(batchId string) (successNum int, failNum int, err error) { failNum = len(imageaudittasks) return } + results = append(results, _result.Body.Data.Results...) logger.Info("Receive the response from ScanImageAdvance: %v", _result.String()) - - // 4.处理应答 - err = handleScanImageResponse(ctrlBlock, _result) } + // 4.处理应答 + err = handleScanImageResponseBodyDataResults(ctrlBlock, results) + successNum = len(imageaudittasks) return } @@ -126,8 +128,7 @@ func createScanImageAdvanceRequest(ctrlBlock *ImageAuditTaskBatchControlBlock) ( return } -func handleScanImageResponse(ctrlBlock *ImageAuditTaskBatchControlBlock, resp *imageaudit.ScanImageResponse) (err error) { - results := resp.Body.Data.Results +func handleScanImageResponseBodyDataResults(ctrlBlock *ImageAuditTaskBatchControlBlock, results []*imageaudit.ScanImageResponseBodyDataResults) (err error) { taskCtrlBlocks := ctrlBlock.TaskCtrlBlocks img2taskIndexMap := ctrlBlock.Img2taskIndexMap actionMap := ctrlBlock.ActionMap