|
|
@@ -42,7 +42,6 @@ import com.tzld.videoVector.service.VideoSearchService;
|
|
|
import com.tzld.videoVector.service.recall.VectorRecallTestService;
|
|
|
import com.tzld.videoVector.util.Md5Util;
|
|
|
import com.tzld.videoVector.util.RedisUtils;
|
|
|
-import com.tzld.videoVector.util.VectorUtils;
|
|
|
import com.tzld.videoVector.model.po.pgVector.ArticleVector;
|
|
|
import com.tzld.videoVector.model.po.pgVector.MaterialVector;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -979,9 +978,9 @@ public class VectorRecallTestServiceImpl implements VectorRecallTestService {
|
|
|
raw.getString("usageCount"),
|
|
|
raw.getString("使用次数")
|
|
|
);
|
|
|
- meta.tags = extractStringList(raw, "target_post", "tags");
|
|
|
+ meta.tags = extractStringList(raw, "target_post");
|
|
|
if (meta.tags == null) {
|
|
|
- meta.tags = extractStringList(raw, null, "tags");
|
|
|
+ meta.tags = extractStringList(raw, null);
|
|
|
}
|
|
|
if (meta.tags == null) {
|
|
|
String tagsStr = firstNonBlankString(raw.getString("标签"), nestedString(raw, "target_post", "label"));
|
|
|
@@ -998,14 +997,13 @@ public class VectorRecallTestServiceImpl implements VectorRecallTestService {
|
|
|
return meta;
|
|
|
}
|
|
|
|
|
|
- private List<String> extractStringList(JSONObject raw, String objKey, String fieldKey) {
|
|
|
- JSONArray arr = objKey != null ? nestedArray(raw, objKey, fieldKey) : raw.getJSONArray(fieldKey);
|
|
|
+ private List<String> extractStringList(JSONObject raw, String objKey) {
|
|
|
+ JSONArray arr = objKey != null ? nestedArray(raw, objKey, "tags") : raw.getJSONArray("tags");
|
|
|
if (arr == null || arr.isEmpty()) {
|
|
|
return null;
|
|
|
}
|
|
|
List<String> list = new ArrayList<>(arr.size());
|
|
|
- for (int i = 0; i < arr.size(); i++) {
|
|
|
- Object item = arr.get(i);
|
|
|
+ for (Object item : arr) {
|
|
|
if (item == null) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -1445,6 +1443,7 @@ public class VectorRecallTestServiceImpl implements VectorRecallTestService {
|
|
|
continue;
|
|
|
}
|
|
|
try {
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
Map<String, Object> detail = JSONObject.parseObject(json, Map.class);
|
|
|
if (detail != null && !detail.isEmpty()) {
|
|
|
results.get(i).setVideoDetail(detail);
|
|
|
@@ -1904,8 +1903,7 @@ public class VectorRecallTestServiceImpl implements VectorRecallTestService {
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
List<String> result = new ArrayList<>(arr.size());
|
|
|
- for (int i = 0; i < arr.size(); i++) {
|
|
|
- Object item = arr.get(i);
|
|
|
+ for (Object item : arr) {
|
|
|
if (item == null) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -1954,7 +1952,6 @@ public class VectorRecallTestServiceImpl implements VectorRecallTestService {
|
|
|
String articleId;
|
|
|
String title;
|
|
|
String summary;
|
|
|
- List<String> tags;
|
|
|
String cover;
|
|
|
String url;
|
|
|
String source;
|