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