Forráskód Böngészése

删除账户素材---2

zhaoxian 1 éve
szülő
commit
cd879b8be9

+ 17 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/DelKuaiShouVideoGetController.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.controller;
 
+import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.batch.service.IDelKuaiShouVideoGetService;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
@@ -25,6 +26,10 @@ public class DelKuaiShouVideoGetController {
     public Result<Object> insertAutoVideo(Long accountId) {
         Result<Object> result = new Result<>();
         try {
+            if (Check.isNull(accountId)) {
+                result.error500("添加账户");
+                return result;
+            }
             kuaiShouVideoGetService.insertDelVideoList(accountId);
             result.success("操作成功!");
         } catch (Exception e) {
@@ -38,6 +43,10 @@ public class DelKuaiShouVideoGetController {
     public Result<Object> getCreateInfo(Long accountId, String photoName) {
         Result<Object> result = new Result<>();
         try {
+            if (Check.isNull(accountId) || Check.isNull(photoName)) {
+                result.error500("添加账户和素材名");
+                return result;
+            }
             kuaiShouVideoGetService.getCreateInfo(accountId, photoName);
             result.success("操作成功!");
         } catch (Exception e) {
@@ -52,6 +61,10 @@ public class DelKuaiShouVideoGetController {
     public Result<Object> changeCreativesPutStatus(Long accountId) {
         Result<Object> result = new Result<>();
         try {
+            if (Check.isNull(accountId)) {
+                result.error500("添加账户");
+                return result;
+            }
             kuaiShouVideoGetService.changeCreativesPutStatus(accountId);
             result.success("操作成功!");
         } catch (Exception e) {
@@ -65,6 +78,10 @@ public class DelKuaiShouVideoGetController {
     public Result<Object> deleteAccountVideos(Long accountId, String photoName) {
         Result<Object> result = new Result<>();
         try {
+            if (Check.isNull(accountId) || Check.isNull(photoName)) {
+                result.error500("添加账户和素材名");
+                return result;
+            }
             //1 获取账户下所有视频
             kuaiShouVideoGetService.insertDelVideoList(accountId);
             Thread.sleep(1000l);

+ 3 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/DelKuaiShouVideoGetServiceImpl.java

@@ -168,7 +168,8 @@ public class DelKuaiShouVideoGetServiceImpl extends ServiceImpl<DelKuaiShouVideo
         //创意
         if (!Check.isNull(allCreativeIds)) {
             //最多20个ID
-            List<List<Long>> splitVideos = Lists.newArrayList(Lists.partition(allCreativeIds, 20));
+//            List<List<Long>> splitVideos = Lists.newArrayList(Lists.partition(allCreativeIds, 20));
+            List<List<Long>> splitVideos =Lists.partition(allCreativeIds, 20);
             for (List<Long> creativeIds : splitVideos) {
                 deleteCreatives(token.getAccessToken(), accountId, creativeIds);
             }
@@ -178,7 +179,7 @@ public class DelKuaiShouVideoGetServiceImpl extends ServiceImpl<DelKuaiShouVideo
         if (!Check.isNull(allAdvancedCreativeIds)) {
             List<Long> allAdvancedCreativeIdsList = new ArrayList<>(allAdvancedCreativeIds);
             //最多10个id
-            List<List<Long>> splitVideos = Lists.newArrayList(Lists.partition(allAdvancedCreativeIdsList, 10));
+            List<List<Long>> splitVideos = Lists.partition(allAdvancedCreativeIdsList, 10);
             for (List<Long> unitIds : splitVideos) {
                 deleteUnitStatus(token.getAccessToken(), accountId, unitIds);
             }