DynamicConfigService.java
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.yoho.search.consumer.common;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.core.config.ConfigReader;
import com.yoho.search.consumer.suggests.common.KeywordType;
@Component
public class DynamicConfigService {
@Autowired
private ConfigReader configReader;
/**
* 全球购融合到有货是否开启
*
* @return
*/
public boolean isTblToYohoOpen() {
return configReader.getBoolean("search.degrade.consumer.adaptor.tbltoyoho.open", false);
}
public boolean suggestKeywordTypeOpen(KeywordType keywordType) {
String globleEnabledKey = keywordType.getGlobleEnabledKey();
if (StringUtils.isBlank(globleEnabledKey)) {
return true;
}
return configReader.getBoolean(globleEnabledKey, true);
}
/**
* 是否打开搜索无结果或结果太少时的搜索词建议功能
* @return
*/
public boolean isIncreasementSpiderOpen(){
return configReader.getBoolean("search.suggestion.increasement.spider.open", true);
}
}