|
|
@@ -109,7 +109,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getDeconstructResult(GetDeconstructParam param) {
|
|
|
+ public JSONObject getDeconstructResult(GetDeconstructParam param) {
|
|
|
if (param == null || param.getTaskId() == null || param.getTaskId().trim().isEmpty()) {
|
|
|
log.error("getDeconstructResult 参数或 taskId 为空");
|
|
|
return null;
|
|
|
@@ -228,7 +228,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
/**
|
|
|
* 从数据库记录构建返回结果
|
|
|
*/
|
|
|
- private String buildResultFromContent(DeconstructContent content) {
|
|
|
+ private JSONObject buildResultFromContent(DeconstructContent content) {
|
|
|
JSONObject jsonResult = new JSONObject();
|
|
|
jsonResult.put("taskId", content.getTaskId());
|
|
|
jsonResult.put("status", content.getStatus());
|
|
|
@@ -238,7 +238,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
jsonResult.put("fromCache", true);
|
|
|
|
|
|
if (content.getResultJson() != null) {
|
|
|
- jsonResult.put("result", content.getResultJson());
|
|
|
+ jsonResult.put("result", JSONObject.parseObject(content.getResultJson()));
|
|
|
}
|
|
|
|
|
|
if (content.getFailureReason() != null) {
|
|
|
@@ -260,13 +260,13 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
jsonResult.put("url", urlObj);
|
|
|
}
|
|
|
|
|
|
- return jsonResult.toJSONString();
|
|
|
+ return jsonResult;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 从API结果构建返回结果
|
|
|
*/
|
|
|
- private String buildResultFromApiResult(DeconstructResult result) {
|
|
|
+ private JSONObject buildResultFromApiResult(DeconstructResult result) {
|
|
|
JSONObject jsonResult = new JSONObject();
|
|
|
jsonResult.put("taskId", result.getTaskId());
|
|
|
jsonResult.put("status", result.getStatus());
|
|
|
@@ -276,7 +276,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
jsonResult.put("fromCache", false);
|
|
|
|
|
|
if (result.getResult() != null) {
|
|
|
- jsonResult.put("result", result.getResult());
|
|
|
+ jsonResult.put("result", JSONObject.parseObject(result.getResult()));
|
|
|
}
|
|
|
|
|
|
if (result.getReason() != null) {
|
|
|
@@ -298,7 +298,7 @@ public class VideoSearchServiceImpl implements VideoSearchService {
|
|
|
jsonResult.put("url", urlObj);
|
|
|
}
|
|
|
|
|
|
- return jsonResult.toJSONString();
|
|
|
+ return jsonResult;
|
|
|
}
|
|
|
|
|
|
/**
|