|
@@ -1,5 +1,6 @@
|
|
|
package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum;
|
|
@@ -10,6 +11,8 @@ import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
|
|
|
import com.tzld.piaoquan.longarticle.model.vo.MatchMiniprogramStatusParam;
|
|
|
import com.tzld.piaoquan.longarticle.service.local.CardService;
|
|
|
import com.tzld.piaoquan.longarticle.service.remote.AigcService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
|
|
|
+import com.tzld.piaoquan.longarticle.service.remote.VideoService;
|
|
|
import com.tzld.piaoquan.longarticle.utils.ImageUrlValidator;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -31,11 +34,17 @@ public class CardServiceImpl implements CardService {
|
|
|
@ApolloJsonValue("${miniMap:{}}")
|
|
|
private JSONObject miniProgramMap;
|
|
|
|
|
|
+ @ApolloJsonValue("${coverTestAccount:[]}")
|
|
|
+ private JSONArray coverTestAccount;
|
|
|
+
|
|
|
@Autowired
|
|
|
AigcService aigcService;
|
|
|
|
|
|
@Autowired
|
|
|
- private NewVideoCoverMapper newVideoCoverMapper;
|
|
|
+ private VideoService videoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MatchService matchService;
|
|
|
|
|
|
private static final List<String> crawlerImgPathList = new ArrayList<String>() {{
|
|
|
add("20250208065525959973866");
|
|
@@ -50,7 +59,7 @@ public class CardServiceImpl implements CardService {
|
|
|
add("20250304073234245880032");
|
|
|
}};
|
|
|
|
|
|
- private static final List<String> useShareImgPathList = new ArrayList<String>(){{
|
|
|
+ private static final List<String> useShareImgPathList = new ArrayList<String>() {{
|
|
|
add("妙用俏生活");
|
|
|
add("票圈精彩");
|
|
|
}};
|
|
@@ -217,19 +226,16 @@ public class CardServiceImpl implements CardService {
|
|
|
for (int index = 0; index < videoDetails.size(); index++) {
|
|
|
VideoDetail videoDetail = videoDetails.get(index);
|
|
|
PublishMiniprogram card = generateSingleCard(index + 1, miniId, videoDetail, planAccount, publishContent);
|
|
|
-// //1号位置和2号位置视频 查询2号视频是否有新封面
|
|
|
-// if (index == 1 && Objects.equals(videoDetail.getCrawlerVideoId(), videoDetails.get(0).getCrawlerVideoId())) {
|
|
|
-// NewVideoCoverExample example = new NewVideoCoverExample();
|
|
|
-// example.createCriteria().andCrawlerVideoIdEqualTo(videoDetail.getCrawlerVideoId()).andGetCoverStatusEqualTo(2);
|
|
|
-// List<NewVideoCover> newVideoCovers = newVideoCoverMapper.selectByExample(example);
|
|
|
-// // 查询是否存在新封面
|
|
|
-// if (!CollectionUtils.isEmpty(newVideoCovers)) {
|
|
|
-// NewVideoCover newVideoCover = newVideoCovers.get(0);
|
|
|
-// String cover = " https://rescdn.yishihui.com/" + newVideoCover.getCoverOssPath();
|
|
|
-// card.setVideoCover(cover);
|
|
|
-// card.setNewVideoCoverId(newVideoCover.getId());
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (coverTestAccount.contains(planAccount.getGhId())) {
|
|
|
+ if (index == 0 || index == 1) {
|
|
|
+ String updateCover = videoService.getUpdateCover(publishContent.getSourceId(), index + 1, videoDetail.getVideoId());
|
|
|
+ if (StringUtils.isNotEmpty(updateCover)) {
|
|
|
+ card.setVideoCover(updateCover);
|
|
|
+ } else {
|
|
|
+ log.error("updateCover is null contentId={} videoId={} index={}", publishContent.getSourceId(), videoDetail.getVideoId(), index + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (card != null) {
|
|
|
String videoCover = card.getVideoCover();
|
|
|
String wxUrl = aigcService.pushCover(videoCover, card.getPublishContentId());
|
|
@@ -240,6 +246,7 @@ public class CardServiceImpl implements CardService {
|
|
|
statusParam.setStatus(MatchResultStatusEnum.FAIL.getStatusCode());
|
|
|
statusParam.setPublishContentId(card.getPublishContentId());
|
|
|
statusParam.setErrorMsg("封面不可用");
|
|
|
+ matchService.notHasMiniVideos(publishContent.getSourceId());
|
|
|
aigcService.updateMatchMiniprogramStatus(statusParam);
|
|
|
}
|
|
|
continue;
|