将HTTP和DNS配置的自定义域参数的key提取到配置文件中
Signed-off-by: zhangwei <zhangwei@intranet.com>
This commit is contained in:
@@ -429,4 +429,19 @@ public final class Constants {
|
||||
public static final String DIGEST_FILE_TYPE = Configurations.getStringProperty("digest_file_type","");
|
||||
public static final long DIGEST_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("digest_single_file_max_size",10485760l);//10M
|
||||
public static final long DIGEST_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("digest_total_file_max_size",52428800l);//50M
|
||||
|
||||
//YSP文件特征配置相关参数,用于调用外部程序生成特征文件时使用
|
||||
public static final String AV_FILE_PATH = Configurations.getStringProperty("av_file_path", "/home/ysp/");
|
||||
public static final String AV_SAMPLE_AUDIO_REGION = Configurations.getStringProperty("av_sample_audio_region", "av_sample_audio");
|
||||
public static final String AV_SAMPLE_VEDIO_REGION = Configurations.getStringProperty("av_sample_vedio_region", "av_sample_vedio");
|
||||
public static final String AV_SAMPLE_PITURE_REGION = Configurations.getStringProperty("av_sample_pitrue_region", "av_sample_pitrue");
|
||||
public static final String AV_SAMPLE_VOIP_REGION = Configurations.getStringProperty("av_sample_voip_region", "av_sample_voip");
|
||||
public static final String AUDIO_SAMPLE_CREATE_PROC = Configurations.getStringProperty("audio_sample_create_proc", "./audio_convert_proc");
|
||||
public static final String VEDIO_SAMPLE_CREATE_PROC = Configurations.getStringProperty("vedio_sample_create_proc", "./vedio_convert_proc");
|
||||
public static final String PICTURE_SAMPLE_CREATE_PROC = Configurations.getStringProperty("picture_sample_create_proc", "./picture_convert_proc");
|
||||
//HTTP自定义域相关参数
|
||||
public static String HTTP_HEADER_USER_REGION_KEY=Configurations.getStringProperty("http_header_user_region_key", "HTTP_HEADER");
|
||||
public static String HTTP_HEADER_DICT_MODULE=Configurations.getStringProperty("http_header_dict_module", "REQUEST_HEADER_DISTRICT");
|
||||
//DNS自定义域参数
|
||||
public static String DNS_STRATEGY_USER_REGION_KEY=Configurations.getStringProperty("dns_strategy_user_region_key", "DNS_STRATEGY");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -320,7 +320,7 @@ redirect_response_code_startwith=30
|
||||
sample_upload_url_keyword=/av
|
||||
digest_upload_url_keyword=/fileTransfer
|
||||
#样例和摘要文件大小类型设置
|
||||
sample_file_type=,mp4,flv,ivf,mp2v,
|
||||
sample_file_type=,mp4,flv,ivf,mp2v,jpg,
|
||||
#10M 10485760
|
||||
sample_single_file_max_size=10485760
|
||||
#12M 12582912
|
||||
@@ -329,4 +329,20 @@ digest_file_type=,txt,doc,img,
|
||||
#10M10485760
|
||||
digest_single_file_max_size=10485760
|
||||
#12M12582912
|
||||
digest_total_file_max_size=12582912
|
||||
digest_total_file_max_size=12582912
|
||||
#YSP文件保存路径
|
||||
av_file_path=d:\\ysp\\
|
||||
#YSP文件特征类型
|
||||
av_sample_audio_region=av_sample_audio
|
||||
av_sample_vedio_region=av_sample_vedio
|
||||
av_sample_pitrue_region=av_sample_pitrue
|
||||
av_sample_voip_region=av_sample_voip
|
||||
#样例文件生成程序
|
||||
audio_sample_create_proc=java -jar d:\\sampleTest.jar
|
||||
vedio_sample_create_proc=java -jar d:\\sampleTest.jar
|
||||
picture_sample_create_proc=java -jar d:\\sampleTest.jar
|
||||
#http自定义域相关参数
|
||||
http_header_user_region_key=HTTP_HEADER
|
||||
http_header_dict_module=REQUEST_HEADER_DISTRICT
|
||||
#dns自定义域参数key
|
||||
dns_strategy_user_region_key=DNS_STRATEGY
|
||||
@@ -11,7 +11,7 @@
|
||||
</style>
|
||||
<script type="text/javascript">top.$.jBox.closeTip();</script>
|
||||
<c:if test="${not empty content}">
|
||||
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1 && fn:indexOf(content,'failed') eq -1 && fn:indexOf(content,'Exception') eq -1?'success':'error'}"/></c:if>
|
||||
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1 && fn:indexOf(content,'failed') eq -1 && fn:indexOf(content,'Exception') eq -1 && fn:indexOf(content,'null') eq -1?'success':'error'}"/></c:if>
|
||||
<div id="messageBox" class="alert alert-${ctype}"><button data-dismiss="alert" class="close">×</button><spring:message code="${content}"/></div>
|
||||
<script type="text/javascript">if(!top.$.jBox.tip.mess) {top.$.jBox.tip.mess=1;top.$.jBox.tip("<spring:message code='${content}'/>","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();}</script>
|
||||
</c:if>
|
||||
Reference in New Issue
Block a user