|
|
@ -14,7 +14,6 @@ import com.fr.general.http.HttpToolbox; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONException; |
|
|
|
import com.fr.json.JSONException; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONTokener; |
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.CodeUtils; |
|
|
|
import com.fr.stable.CodeUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
@ -61,8 +60,6 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { |
|
|
|
try { |
|
|
|
try { |
|
|
|
String result = HttpToolbox.get(AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j])); |
|
|
|
String result = HttpToolbox.get(AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j])); |
|
|
|
AlphaFineHelper.checkCancel(); |
|
|
|
AlphaFineHelper.checkCancel(); |
|
|
|
Object json = new JSONTokener(result).nextValue(); |
|
|
|
|
|
|
|
if (json instanceof JSONObject) { |
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(result); |
|
|
|
JSONObject jsonObject = new JSONObject(result); |
|
|
|
if (jsonObject.optString("status").equals("success")) { |
|
|
|
if (jsonObject.optString("status").equals("success")) { |
|
|
|
JSONArray jsonArray = jsonObject.optJSONArray("result"); |
|
|
|
JSONArray jsonArray = jsonObject.optJSONArray("result"); |
|
|
@ -77,7 +74,6 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (JSONException e) { |
|
|
|
} catch (JSONException e) { |
|
|
|
FineLoggerFactory.getLogger().error("recommend search error! :" + e.getMessage()); |
|
|
|
FineLoggerFactory.getLogger().error("recommend search error! :" + e.getMessage()); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
@ -94,6 +90,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { |
|
|
|
} |
|
|
|
} |
|
|
|
complementAdviceModelList = ComplementAdviceManager.getInstance().getAllSearchResult(searchText); |
|
|
|
complementAdviceModelList = ComplementAdviceManager.getInstance().getAllSearchResult(searchText); |
|
|
|
moreModelList.clear(); |
|
|
|
moreModelList.clear(); |
|
|
|
|
|
|
|
|
|
|
|
if (recommendModelList.size() > 0) { |
|
|
|
if (recommendModelList.size() > 0) { |
|
|
|
if (complementAdviceModelList.size() == 0) { |
|
|
|
if (complementAdviceModelList.size() == 0) { |
|
|
|
if (recommendModelList.size() > AlphaFineConstants.SHOW_SIZE - 2) { |
|
|
|
if (recommendModelList.size() > AlphaFineConstants.SHOW_SIZE - 2) { |
|
|
|