|
@@ -5,7 +5,6 @@ import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.KuaiShouVideoLastTime;
|
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IKuaiShouVideoLastTimeService;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouVideoGetService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
|
|
@@ -94,8 +93,6 @@ public class KuaiShouMaterialControer {
|
|
|
throw new Exception("未获取账号授权信息");
|
|
|
}
|
|
|
String appVersion = requestJson.getString("appVersion");
|
|
|
- // String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
|
|
|
- // iKuaishouInterfaceService.getVideoList(token, nowDate, nowDate);
|
|
|
KuaiShouVideoLastTime videoLastTime = lastTimeService.getById(accountId);
|
|
|
Date startTime;
|
|
|
Date endDate = new Date();
|
|
@@ -147,7 +144,6 @@ public class KuaiShouMaterialControer {
|
|
|
*/
|
|
|
@PostMapping(value = "/getHistoryVideoList")
|
|
|
public JSONObject getHistoryVideoList(@RequestBody JSONObject requestJson) {
|
|
|
- // log.info("获取历史素材入参:{}", requestJson);
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
try {
|
|
|
if (Check.isNull(requestJson)) {
|
|
@@ -186,20 +182,7 @@ public class KuaiShouMaterialControer {
|
|
|
}
|
|
|
List<JSONObject> materialList = relateCreativesService.getVideoListByMap(requestMap);
|
|
|
if (!Check.isNull(materialList)) {
|
|
|
- for (int i = 0; i < materialList.size(); i++) {
|
|
|
- JSONObject materialJson = materialList.get(i);
|
|
|
- KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
|
|
|
- if (!Check.isNull(videoGet)) {
|
|
|
- String signature = videoGet.getSignature();
|
|
|
- materialJson.put("signature", signature);
|
|
|
- materialJson.put("video_url", videoGet.getUrl());
|
|
|
- materialJson.put("material_type", videoGet.getMaterialType());
|
|
|
- materialJson.put("channel_type", videoGet.getChannelType());
|
|
|
- materialJson.put("photo_name", videoGet.getPhotoName());
|
|
|
- List<String> imageList = lastTimeService.getImageListByMd5(signature);
|
|
|
- materialJson.put("imageList", imageList);
|
|
|
- }
|
|
|
- }
|
|
|
+ materialList = videoGetService.getVideoInfoAndImageList(materialList);
|
|
|
returnJson.put("code", 0);
|
|
|
returnJson.put("message", "SUCCESS");
|
|
|
returnJson.put("data", materialList);
|
|
@@ -224,7 +207,7 @@ public class KuaiShouMaterialControer {
|
|
|
*/
|
|
|
@PostMapping(value = "/getHistoryTopVideoList")
|
|
|
public JSONObject getHistoryTopVideoList(@RequestBody JSONObject requestJson) {
|
|
|
- // log.info("获取历史Top素材入参:{}", requestJson);
|
|
|
+ // log.info("获取历史Top素材入参:{}", requestJson);
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
try {
|
|
|
if (Check.isNull(requestJson)) {
|
|
@@ -257,19 +240,7 @@ public class KuaiShouMaterialControer {
|
|
|
}
|
|
|
List<JSONObject> materialList = relateCreativesService.getHistoryTopVideoList(requestMap);
|
|
|
if (!Check.isNull(materialList)) {
|
|
|
- for (int i = 0; i < materialList.size(); i++) {
|
|
|
- JSONObject materialJson = materialList.get(i);
|
|
|
- KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
|
|
|
- if (!Check.isNull(videoGet)) {
|
|
|
- String signature = videoGet.getSignature();
|
|
|
- materialJson.put("video_url", videoGet.getUrl());
|
|
|
- materialJson.put("material_type", videoGet.getMaterialType());
|
|
|
- materialJson.put("channel_type", videoGet.getChannelType());
|
|
|
- materialJson.put("photo_name", videoGet.getPhotoName());
|
|
|
- List<String> imageList = lastTimeService.getImageListByMd5(signature);
|
|
|
- materialJson.put("imageList", imageList);
|
|
|
- }
|
|
|
- }
|
|
|
+ materialList = videoGetService.getVideoInfoAndImageList(materialList);
|
|
|
returnJson.put("code", 0);
|
|
|
returnJson.put("message", "SUCCESS");
|
|
|
returnJson.put("data", materialList);
|
|
@@ -294,7 +265,7 @@ public class KuaiShouMaterialControer {
|
|
|
*/
|
|
|
@PostMapping(value = "/getCreateZeroVideoList")
|
|
|
public JSONObject getHistoryCreateVideoList(@RequestBody JSONObject requestJson) {
|
|
|
- // log.info("获取关联创意数为0素材入参:{}", requestJson);
|
|
|
+ // log.info("获取关联创意数为0素材入参:{}", requestJson);
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
try {
|
|
|
if (Check.isNull(requestJson)) {
|
|
@@ -328,20 +299,7 @@ public class KuaiShouMaterialControer {
|
|
|
}
|
|
|
List<JSONObject> materialList = relateCreativesService.getVideoZeroListByMap(requestMap);
|
|
|
if (!Check.isNull(materialList)) {
|
|
|
- for (int i = 0; i < materialList.size(); i++) {
|
|
|
- JSONObject materialJson = materialList.get(i);
|
|
|
- KuaiShouVideoGet videoGet = videoGetService.getVideoByPhotoId(materialJson.getLong("photo_id"));
|
|
|
- if (!Check.isNull(videoGet)) {
|
|
|
- String signature = videoGet.getSignature();
|
|
|
- materialJson.put("signature", signature);
|
|
|
- materialJson.put("video_url", videoGet.getUrl());
|
|
|
- materialJson.put("channel_type", videoGet.getChannelType());
|
|
|
- materialJson.put("material_type", videoGet.getMaterialType());
|
|
|
- materialJson.put("photo_name", videoGet.getPhotoName());
|
|
|
- List<String> imageList = lastTimeService.getImageListByMd5(signature);
|
|
|
- materialJson.put("imageList", imageList);
|
|
|
- }
|
|
|
- }
|
|
|
+ materialList = videoGetService.getVideoInfoAndImageList(materialList);
|
|
|
returnJson.put("code", 0);
|
|
|
returnJson.put("message", "SUCCESS");
|
|
|
returnJson.put("data", materialList);
|