将HTTP和DNS配置的自定义域参数的key提取到配置文件中

Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
zhangwei
2018-07-10 09:39:00 +08:00
parent bdc2a88d5b
commit 6c3e8c2375
4 changed files with 41 additions and 10 deletions

View File

@@ -421,12 +421,12 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
//请求头域
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){
String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict());
String dictValue = DictUtils.getDictCode(Constants.HTTP_HEADER_DICT_MODULE, head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
userRegion += Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
userRegion += Constants.USER_REGION_SPLIT+Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict();
}
}
@@ -435,12 +435,12 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
//应答头域
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpResHdrList()){
String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict());
String dictValue = DictUtils.getDictCode(Constants.HTTP_HEADER_DICT_MODULE, head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
userRegion += Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict();
}else{
userRegion += Constants.USER_REGION_SPLIT+"HTTP_HEADER="+head.getDistrict();
userRegion += Constants.USER_REGION_SPLIT+Constants.HTTP_HEADER_USER_REGION_KEY+"="+head.getDistrict();
}
}
@@ -905,7 +905,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
// dns reject userRegion=;dnsStrategyId;
if(!StringUtil.isEmpty(entity.getDnsStrategyId())){
// maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
maatCfg.setUserRegion("DNS_STRATEGY="+entity.getDnsStrategyId());
maatCfg.setUserRegion(Constants.DNS_STRATEGY_USER_REGION_KEY+"="+entity.getDnsStrategyId());
}
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);