|
@@ -236,7 +236,6 @@ public class ContentServiceImpl implements ContentService {
|
|
|
log.info("articleSortResponse={}", articleSortResponse);
|
|
log.info("articleSortResponse={}", articleSortResponse);
|
|
|
String message = String.format("排序结果为空 planId=%s accountName=%s", planAccount.getPlanId(), planAccount.getAccountName());
|
|
String message = String.format("排序结果为空 planId=%s accountName=%s", planAccount.getPlanId(), planAccount.getAccountName());
|
|
|
LarkRobotUtil.sendMessage(message);
|
|
LarkRobotUtil.sendMessage(message);
|
|
|
-
|
|
|
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
ArticleSortResponseData data = articleSortResponse.getData();
|
|
ArticleSortResponseData data = articleSortResponse.getData();
|
|
@@ -258,11 +257,33 @@ public class ContentServiceImpl implements ContentService {
|
|
|
String message = String.format("排序结果不足 planId=%s accountName=%s num=%s",
|
|
String message = String.format("排序结果不足 planId=%s accountName=%s num=%s",
|
|
|
planAccount.getPlanId(), planAccount.getAccountName(), articleSortResponse.getData().getRank_list().size());
|
|
planAccount.getPlanId(), planAccount.getAccountName(), articleSortResponse.getData().getRank_list().size());
|
|
|
LarkRobotUtil.sendMessage(message);
|
|
LarkRobotUtil.sendMessage(message);
|
|
|
|
|
+ // 清除待发布缓存,成功后异步触发一次 /recommend 重建数据
|
|
|
|
|
+ triggerRebuildRecommend(planAccount, articleSortRequest);
|
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
|
}
|
|
}
|
|
|
return data.getRank_list();
|
|
return data.getRank_list();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 排序结果不足时调用:
|
|
|
|
|
+ * 1. 调用 /deleteGzhWaiting 清除当前 planId + accountId 的待发布缓存
|
|
|
|
|
+ * 2. 清除成功后异步触发一次 /recommend 重新生成排序数据(不关心返回结果)
|
|
|
|
|
+ */
|
|
|
|
|
+ private void triggerRebuildRecommend(PlanAccount planAccount, ArticleSortRequest articleSortRequest) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ boolean deleteSuccess = sortService.deleteGzhWaiting(planAccount.getPlanId(), planAccount.getAccountId());
|
|
|
|
|
+ if (deleteSuccess) {
|
|
|
|
|
+ sortService.asyncRecommend(articleSortRequest);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("deleteGzhWaiting fail, skip asyncRecommend planId={} accountId={}",
|
|
|
|
|
+ planAccount.getPlanId(), planAccount.getAccountId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("triggerRebuildRecommend error planId={} accountId={} errorMsg:{}",
|
|
|
|
|
+ planAccount.getPlanId(), planAccount.getAccountId(), e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public List<VideoDetail> getPublishVideoDetail(MatchVideo matchVideo, Integer publicFlag, PlanAccount planAccount, PublishContent publishContent) {
|
|
public List<VideoDetail> getPublishVideoDetail(MatchVideo matchVideo, Integer publicFlag, PlanAccount planAccount, PublishContent publishContent) {
|
|
|
List<CrawlerVideo> contentMiniVideos = getContentMiniVideo(matchVideo.getContentId(), publicFlag, planAccount);
|
|
List<CrawlerVideo> contentMiniVideos = getContentMiniVideo(matchVideo.getContentId(), publicFlag, planAccount);
|
|
|
log.info("getPublishVideoDetail contentMiniVideos={}", contentMiniVideos);
|
|
log.info("getPublishVideoDetail contentMiniVideos={}", contentMiniVideos);
|