Bläddra i källkod

自定义创意上限、素材关联上限,删除对应组

yumeng 4 år sedan
förälder
incheckning
ac4ccf1e47

+ 7 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -1197,6 +1197,13 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         Map<String, Object> creativeCreateResult = kuaishouInterfaceService.creativeCreate(token.getAccessToken(), token.getAccountId(), creativeParams, 1);
         Integer creativeCode = (Integer) creativeCreateResult.get("code");
         String creativeMessage = (String) creativeCreateResult.get("message");
+        // 创建失败删除对应组
+        if (creativeCode == 400001 && "/rest/openapi/v2/creative/create调用已超日限,次日可恢复调用".equals(creativeMessage)) {
+            updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+        } else if (creativeCode == 401000 && creativeMessage.contains("超过可关联的有效创意的上限")) {
+            updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+        }
+
         AiKuaishouCreativeLevelOperationRecord record = new AiKuaishouCreativeLevelOperationRecord();
         BeanUtils.copyProperties(strategy, record);
         record.setCreativeName(creativeName);