|
@@ -765,6 +765,42 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
return filteredMatches;
|
|
return filteredMatches;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public JSONObject getDeconstructResultByChannelContentId(String channelContentId) {
|
|
|
|
|
+ if (!StringUtils.hasText(channelContentId)) {
|
|
|
|
|
+ log.error("getDeconstructResultByChannelContentId channelContentId为空");
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ log.info("通过channelContentId查询解构结果,channelContentId={}", channelContentId);
|
|
|
|
|
+
|
|
|
|
|
+ // 从数据库查询
|
|
|
|
|
+ DeconstructContent content = getDeconstructContentByChannelContentId(channelContentId);
|
|
|
|
|
+ if (content == null) {
|
|
|
|
|
+ log.info("未找到channelContentId={}对应的解构记录", channelContentId);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果状态非终态,尝试从API刷新
|
|
|
|
|
+ boolean needRefresh = content.getStatus() == null
|
|
|
|
|
+ || content.getStatus() == 0
|
|
|
|
|
+ || content.getStatus() == 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (needRefresh && StringUtils.hasText(content.getTaskId())) {
|
|
|
|
|
+ log.info("解构任务未完成,调用API刷新,channelContentId={}, taskId={}, status={}",
|
|
|
|
|
+ channelContentId, content.getTaskId(), content.getStatus());
|
|
|
|
|
+ DeconstructResult result = deconstructService.getDeconstructResult(content.getTaskId());
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ GetDeconstructParam param = new GetDeconstructParam();
|
|
|
|
|
+ param.setChannelContentId(channelContentId);
|
|
|
|
|
+ updateContentFromResult(content, result, content.getTaskId(), param);
|
|
|
|
|
+ return buildResultFromApiResult(result);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return buildResultFromContent(content);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Map<String, String> getAllConfigCodes() {
|
|
public Map<String, String> getAllConfigCodes() {
|
|
|
try {
|
|
try {
|