...
|
...
|
@@ -4,15 +4,9 @@ import com.yoho.core.config.ConfigReader; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
public class SearchDynamicConfigService {
|
|
|
|
|
|
// 返回智能搜索词的数量
|
|
|
private static final int SMART_SUGGESTION_TERM_COUNT = 3;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
...
|
...
|
@@ -120,18 +114,4 @@ public class SearchDynamicConfigService { |
|
|
public boolean isSearchSuggestionFromConversionOpen(){
|
|
|
return configReader.getBoolean("search.suggestion.tips.conversion.open", true);
|
|
|
}
|
|
|
|
|
|
public List<String> defaultSuggestTips() {
|
|
|
List<String> results = new ArrayList<>(SMART_SUGGESTION_TERM_COUNT);
|
|
|
String values = configReader.getString("search.suggestion.tips.conversion.default", "潮流,运动,休闲");
|
|
|
|
|
|
for (String item : values.split(",")) {
|
|
|
results.add(item);
|
|
|
if (results.size() == SMART_SUGGESTION_TERM_COUNT) {
|
|
|
return results;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return results;
|
|
|
}
|
|
|
} |
...
|
...
|
|