|
|
@@ -203,16 +203,25 @@ public class SearchServiceImpl implements SearchService{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<String> getSimilarKeywords(String keyword) throws SearchException {
|
|
|
+ public Map<String,Object> getSimilarKeywords(String keyword) throws SearchException {
|
|
|
Map<String, Object> map = new HashedMap();
|
|
|
map.put("keyword", keyword);
|
|
|
- String str = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_KEYWORD_URL, String.class, map);
|
|
|
- if(StringUtils.isEmpty(str)) {
|
|
|
+ //String str = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_KEYWORD_URL, String.class, map);
|
|
|
+ String strC = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_COMPONENT_URL, String.class, map);
|
|
|
+ String strB = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_BRAND_URL, String.class, map);
|
|
|
+ String strK = restTemplate.getForObject(sysConf.getSearchUrl() + SearchUrl.SIMILAR_KIND_URL, String.class, map);
|
|
|
+ if(StringUtils.isEmpty(strC) && StringUtils.isEmpty(strB) && StringUtils.isEmpty(strK)) {
|
|
|
return null;
|
|
|
}else {
|
|
|
try {
|
|
|
- List<String> reMap = FastjsonUtils.fromJson(str, List.class);
|
|
|
- return reMap;
|
|
|
+ List<String> reMapC = FastjsonUtils.fromJson(strC, List.class);
|
|
|
+ List<String> reMapB = FastjsonUtils.fromJson(strB, List.class);
|
|
|
+ List<String> reMapK = FastjsonUtils.fromJson(strK, List.class);
|
|
|
+ map.clear();
|
|
|
+ map.put("kind",reMapK);
|
|
|
+ map.put("componet",reMapC);
|
|
|
+ map.put("brand",reMapB);
|
|
|
+ return map;
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return null;
|