|
|
@@ -3,7 +3,6 @@ package com.tzld.piaoquan.longarticle.service.local.impl;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
|
|
|
@@ -110,15 +109,15 @@ public class CoreServiceImpl implements CoreService {
|
|
|
@ApolloJsonValue("${fwhGhIdList:[]}")
|
|
|
private List<String> fwhGhIdList;
|
|
|
|
|
|
- @Value("${recall.video.config.code:VIDEO_TOPIC}")
|
|
|
- private String recallVideoConfigCode;
|
|
|
-
|
|
|
@Value("${content.mini.video.num:3}")
|
|
|
private Integer miniVideoNum;
|
|
|
|
|
|
@ApolloJsonValue("${recall.publish.miniprogram.accounts:[]}")
|
|
|
private List<String> recallPublishMiniprogramAccounts;
|
|
|
|
|
|
+ @ApolloJsonValue("${recall.video.config.codes:[\"VIDEO_TOPIC\",\"VIDEO_TITLE\"]}")
|
|
|
+ private List<String> recallVideoConfigCodes;
|
|
|
+
|
|
|
@Value("${recall.replace.title.cover.switch:true}")
|
|
|
private Boolean replaceRecallTitleCoverSwitch;
|
|
|
|
|
|
@@ -547,10 +546,7 @@ public class CoreServiceImpl implements CoreService {
|
|
|
param.setSimMin(0.6);
|
|
|
param.setRovMin(0.0);
|
|
|
param.setDays(30);
|
|
|
- if (StringUtils.isNotEmpty(recallVideoConfigCode)) {
|
|
|
- param.setConfigCode(recallVideoConfigCode);
|
|
|
- }
|
|
|
- RecallVideoScoreVO result = videoVectorService.recallWithScore(param);
|
|
|
+ RecallVideoScoreVO result = videoVectorService.recallWithScore(param, recallVideoConfigCodes);
|
|
|
if (result == null || CollectionUtils.isEmpty(result.getItems())) {
|
|
|
log.info("recallWithScore no results, contentId={}, title={}", matchContent.getSourceId(), matchContent.getTitle());
|
|
|
return;
|
|
|
@@ -566,14 +562,14 @@ public class CoreServiceImpl implements CoreService {
|
|
|
continue;
|
|
|
}
|
|
|
// 通过视频ID获取OSS路径和标题
|
|
|
- JSONObject videoDetailJson = VideoUtils.getVideoDetail(item.getVideoId());
|
|
|
- if (videoDetailJson == null) {
|
|
|
+ VideoDetail videoDetail = VideoUtils.getVideoDetail(item.getVideoId());
|
|
|
+ if (videoDetail == null) {
|
|
|
log.warn("getVideoDetail null for videoId={}, contentId={}", item.getVideoId(), matchContent.getSourceId());
|
|
|
continue;
|
|
|
}
|
|
|
- String ossVideoPath = videoDetailJson.getString("ossVideoPath");
|
|
|
- String title = videoDetailJson.getString("title");
|
|
|
- String shareImgPath = videoDetailJson.getString("shareImgPath");
|
|
|
+ String ossVideoPath = videoDetail.getOssVideoPath();
|
|
|
+ String title = videoDetail.getTitle();
|
|
|
+ String shareImgPath = videoDetail.getShareImgPath();
|
|
|
if (StringUtils.isEmpty(ossVideoPath)) {
|
|
|
log.warn("ossVideoPath empty for videoId={}, contentId={}", item.getVideoId(), matchContent.getSourceId());
|
|
|
continue;
|
|
|
@@ -965,21 +961,20 @@ public class CoreServiceImpl implements CoreService {
|
|
|
log.info("getRecallPublishMiniprograms found {} recall records, contentId={}", recallList.size(), publishContent.getSourceId());
|
|
|
List<VideoDetail> videoDetails = new ArrayList<>();
|
|
|
for (VectorMatchVideo recall : recallList) {
|
|
|
- try {
|
|
|
- VideoDetail videoDetail = videoService.publish(recall.getVideoOssPath(), "69637498", recall.getVideoTitle());
|
|
|
- if (videoDetail == null || StringUtils.isEmpty(videoDetail.getVideoId())) {
|
|
|
- log.warn("videoService.publish failed, recallId={}, videoId={}", recall.getId(), recall.getVideoId());
|
|
|
- continue;
|
|
|
- }
|
|
|
- videoDetail.setUid("69637498");
|
|
|
- videoDetail.setSource("piaoquan");
|
|
|
- videoDetail.setKimiTitle(recall.getVideoTitle());
|
|
|
- videoDetail.setVideoOss(recall.getVideoOssPath());
|
|
|
- videoDetail.setCoverOss(recall.getCoverUrl());
|
|
|
- videoDetails.add(videoDetail);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("publish recall video error, recallId={}, videoId={}", recall.getId(), recall.getVideoId(), e);
|
|
|
+ if (recall.getVideoId() == null) {
|
|
|
+ log.warn("recall videoId null, recallId={}", recall.getId());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ VideoDetail videoDetail = VideoUtils.getVideoDetail(recall.getVideoId());
|
|
|
+ if (videoDetail == null) {
|
|
|
+ log.warn("getVideoDetail null for videoId={}, recallId={}", recall.getVideoId(), recall.getId());
|
|
|
+ continue;
|
|
|
}
|
|
|
+ videoDetail.setSource("piaoquan");
|
|
|
+ videoDetail.setKimiTitle(recall.getVideoTitle());
|
|
|
+ videoDetail.setVideoOss(videoDetail.getOssVideoPath());
|
|
|
+ videoDetail.setCoverOss(videoDetail.getShareImgPath());
|
|
|
+ videoDetails.add(videoDetail);
|
|
|
}
|
|
|
if (CollectionUtils.isEmpty(videoDetails)) {
|
|
|
return null;
|