浏览代码

MaterIalInfo添加字段ids,字符串数组。
MateruakInfoController添加批量通过审核的接口

huangxuechao 4 年之前
父节点
当前提交
154e1533dc

+ 21 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.ctop.service.IProjectMemberService;
@@ -540,6 +541,26 @@ public class MaterialInfoController {
         return result;
 
     }
+
+    /**
+     * 头条素材信息编辑 -- 批量通过审核
+     * @param materialInfo
+     * @return
+     */
+    @PutMapping(value = "/bytedance/batchedit")
+    public Result<MaterialInfo> bytedanceBatchEdit(@RequestBody MaterialInfo materialInfo) {
+        Result<MaterialInfo> result = new Result<>();
+        String[] ids = materialInfo.getIds();
+        int successNum = 0;
+        for (String id : ids) {
+            materialInfo.setId(id);
+            Result<MaterialInfo> materialInfoResult = bytedanceEdit(materialInfo);
+            if(materialInfoResult.getCode().equals(CommonConstant.SC_OK_200)){ successNum++;}
+        }
+        return result.success("批量修改成功"+successNum+"个");
+
+    }
+
     /**
      * 通过id删除
      *

+ 4 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -38,6 +38,10 @@ public class MaterialInfo {
     @ApiModelProperty(value = "id")
     private String id;
     /**
+     * 存放id的数组
+     */
+    private String[] ids;
+    /**
      * code
      */
     @Excel(name = "code", width = 15)