by Robin at 20240428

This commit is contained in:
Leufolium 2024-04-28 21:51:16 +08:00
parent 217a53d6b2
commit 58a238e9c9
1 changed files with 6 additions and 5 deletions

View File

@ -61,6 +61,7 @@ func Run(batchId string) (successNum int, failNum int, err error) {
ConnectTimeout: tea.Int(30000), ConnectTimeout: tea.Int(30000),
} }
results := make([]*imageaudit.ScanImageResponseBodyDataResults, 0)
for _, req := range reqs { for _, req := range reqs {
var _result *imageaudit.ScanImageResponse var _result *imageaudit.ScanImageResponse
_result, err = defaultImageAuditClient.ScanImageAdvance(req, runtime) _result, err = defaultImageAuditClient.ScanImageAdvance(req, runtime)
@ -72,12 +73,13 @@ func Run(batchId string) (successNum int, failNum int, err error) {
failNum = len(imageaudittasks) failNum = len(imageaudittasks)
return return
} }
results = append(results, _result.Body.Data.Results...)
logger.Info("Receive the response from ScanImageAdvance: %v", _result.String()) logger.Info("Receive the response from ScanImageAdvance: %v", _result.String())
// 4.处理应答
err = handleScanImageResponse(ctrlBlock, _result)
} }
// 4.处理应答
err = handleScanImageResponseBodyDataResults(ctrlBlock, results)
successNum = len(imageaudittasks) successNum = len(imageaudittasks)
return return
} }
@ -126,8 +128,7 @@ func createScanImageAdvanceRequest(ctrlBlock *ImageAuditTaskBatchControlBlock) (
return return
} }
func handleScanImageResponse(ctrlBlock *ImageAuditTaskBatchControlBlock, resp *imageaudit.ScanImageResponse) (err error) { func handleScanImageResponseBodyDataResults(ctrlBlock *ImageAuditTaskBatchControlBlock, results []*imageaudit.ScanImageResponseBodyDataResults) (err error) {
results := resp.Body.Data.Results
taskCtrlBlocks := ctrlBlock.TaskCtrlBlocks taskCtrlBlocks := ctrlBlock.TaskCtrlBlocks
img2taskIndexMap := ctrlBlock.Img2taskIndexMap img2taskIndexMap := ctrlBlock.Img2taskIndexMap
actionMap := ctrlBlock.ActionMap actionMap := ctrlBlock.ActionMap