...
|
...
|
@@ -2,7 +2,6 @@ package com.yoho.search.service.scene.recall; |
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.Iterator;
|
...
|
...
|
@@ -140,7 +139,7 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
return new SearchApiResult().setData(dataMap);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|
|
|
return new SearchApiResult().setData(null).setMessage("SortProductList Exception").setCode(500);
|
|
|
return new SearchApiResult().setData(new JSONObject()).setMessage("SortProductList Exception").setCode(500);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -249,16 +248,21 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
}
|
|
|
|
|
|
private List<Integer> getUserGlobalBrandIds(Map<String, String> paramMap) {
|
|
|
String uid = MapUtils.getString(paramMap, "uid", "0");
|
|
|
String vectorFeatureVersion = searchDynamicConfigService.personalizedSearchVersion();
|
|
|
String userVectorFeature = bigDataRedisService.getUserBrandVectorFeature(uid, vectorFeatureVersion);
|
|
|
JSONArray jsonArray = JSON.parseArray(userVectorFeature);
|
|
|
List<Integer> results = new ArrayList<Integer>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
results.add(Integer.valueOf(jsonArray.getString(i)));
|
|
|
try {
|
|
|
String uid = MapUtils.getString(paramMap, "uid", "0");
|
|
|
String vectorFeatureVersion = searchDynamicConfigService.personalizedSearchVersion();
|
|
|
String userVectorFeature = bigDataRedisService.getUserBrandVectorFeature(uid, vectorFeatureVersion);
|
|
|
JSONArray jsonArray = JSON.parseArray(userVectorFeature);
|
|
|
List<Integer> results = new ArrayList<Integer>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
results.add(Integer.valueOf(jsonArray.getString(i)));
|
|
|
}
|
|
|
logger.warn("[getUserGlobalBrandIds,uid is[{}], brandId is [{}] ]", uid, results);
|
|
|
return results;
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|
|
|
return new ArrayList<Integer>();
|
|
|
}
|
|
|
logger.warn("[getUserGlobalBrandIds,uid is[{}], brandId is [{}] ]", uid, results);
|
|
|
return results;
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|