|
@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.entity.*;
|
|
|
import cn.com.ctop.common.module.enums.MaterialSupplierEnum;
|
|
|
import cn.com.ctop.common.module.service.*;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
+import cn.com.ctop.common.module.utils.CloudVideoProcessUtil;
|
|
|
import cn.com.ctop.common.module.utils.JsonUtil;
|
|
|
import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
|
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouCleanMaterialReport;
|
|
@@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
@@ -196,6 +198,7 @@ public class MaterialInfoController {
|
|
|
result.setResult(pageList);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private ISysRoleService roleService;
|
|
|
|
|
@@ -470,6 +473,28 @@ public class MaterialInfoController {
|
|
|
url = KuaishouInterfaceConstant.HTTPS_PREFIX + url;
|
|
|
}
|
|
|
materialInfo.setUrl(url);
|
|
|
+ MaterialCutFrame cutFrame = materialCutFrameService.getCutFrameByCode(materialInfo.getCode());
|
|
|
+ if (Check.isNull(cutFrame)) {
|
|
|
+ String videoUrl = URLDecoder.decode(url).replace("https://media-1301855440.cos.ap-chongqing.myqcloud.com/", "");
|
|
|
+ String loadImage = "cutFrame/" + materialInfo.getCode() + "/zero.jpg";
|
|
|
+ String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
|
|
|
+ materialInfo.setCoverUrl(coverUrl);
|
|
|
+ Thread thread = new Thread() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ log.info("开始抽帧,code:{}", materialInfo.getCode());
|
|
|
+ materialCutFrameService.getTencentCutFrame(videoUrl, materialInfo.getCode(), coverUrl);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ thread.start();
|
|
|
+ } else {
|
|
|
+ materialInfo.setCoverUrl(cutFrame.getUrl());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 修改素材库 相关联code
|
|
@@ -649,7 +674,7 @@ public class MaterialInfoController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * adlab 新加查询素材库接口
|
|
|
+ * adlab 新加查询素材库接口
|
|
|
*/
|
|
|
@PostMapping(value = "/listByAccountIds")
|
|
|
public Result<IPage<MaterialInfo>> listByAccountIds(@RequestBody JSONObject requestBody) {
|
|
@@ -657,13 +682,13 @@ public class MaterialInfoController {
|
|
|
Result<IPage<MaterialInfo>> result = new Result<>();
|
|
|
QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
|
|
|
if (!Check.isNull(requestBody.getString("userId"))) {
|
|
|
- queryWrapper.eq("user_id",requestBody.getString("userId"));
|
|
|
+ queryWrapper.eq("user_id", requestBody.getString("userId"));
|
|
|
List<Long> projects = memberService.getProjectByAccountIds(requestBody.getJSONArray("accountIds"));
|
|
|
if (!Check.isNull(projects)) {
|
|
|
queryWrapper.in("project_id", projects);
|
|
|
}
|
|
|
}
|
|
|
- queryWrapper.orderByDesc(true,"create_time");
|
|
|
+ queryWrapper.orderByDesc(true, "create_time");
|
|
|
Page<MaterialInfo> page = new Page<>(requestBody.getInteger("pageNo"), requestBody.getInteger("pageSize"));
|
|
|
IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
|
|
|
result.setSuccess(true);
|