|
@@ -30,6 +30,8 @@ import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
/**
|
|
|
* 头条智能投放账户配置信息表
|
|
@@ -316,6 +318,8 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
+
|
|
|
@GetMapping("autoCreateCreative")
|
|
|
public Map<String, Object> autoCreateCreative(Integer hour) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
@@ -324,9 +328,9 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_PARAM_ERROR);
|
|
|
return result;
|
|
|
}
|
|
|
- strategys.forEach(strategy -> {
|
|
|
+ strategys.forEach(strategy -> executorService.submit(()->{
|
|
|
aiBytedanceAdvertiserStrategyService.customCreativeSupplement(strategy, hour,strategy.getAdOpenUrl());
|
|
|
- });
|
|
|
+ }));
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|