Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
wangxin
2018-06-28 17:23:43 +08:00
30 changed files with 285 additions and 122 deletions

View File

@@ -29,7 +29,8 @@ public class AppByteCfg extends BaseCfg<AppByteCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String bytes;
private String cfgKeywords;
@@ -99,10 +100,10 @@ public class AppByteCfg extends BaseCfg<AppByteCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -135,5 +136,13 @@ public class AppByteCfg extends BaseCfg<AppByteCfg> {
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -29,7 +29,8 @@ public class AppDomainCfg extends BaseCfg<AppDomainCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String domain;
private String cfgKeywords;
@@ -98,10 +99,10 @@ public class AppDomainCfg extends BaseCfg<AppDomainCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -131,4 +132,13 @@ public class AppDomainCfg extends BaseCfg<AppDomainCfg> {
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -29,7 +29,8 @@ public class AppHttpCfg extends BaseCfg<AppHttpCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String district;
private String cfgKeywords;
@@ -99,10 +100,10 @@ public class AppHttpCfg extends BaseCfg<AppHttpCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -135,5 +136,13 @@ public class AppHttpCfg extends BaseCfg<AppHttpCfg> {
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -29,7 +29,8 @@ public class AppInnerRuleCfg extends BaseCfg<AppInnerRuleCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String ruleFile;
private String cfgKeywords;
@@ -98,10 +99,10 @@ public class AppInnerRuleCfg extends BaseCfg<AppInnerRuleCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -127,5 +128,12 @@ public class AppInnerRuleCfg extends BaseCfg<AppInnerRuleCfg> {
this.cfgKeywords = cfgKeywords;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -21,7 +21,8 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String appName;
@Expose
@@ -219,10 +220,10 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -237,5 +238,11 @@ public class AppIpCfg extends BaseCfg<AppIpCfg> {
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -29,7 +29,8 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
private Integer compileId;
@Expose
private Integer ratelimit;
private String appCode;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String appName;
private String cfgKeywords;
@@ -98,10 +99,10 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public String getAppCode() {
public Integer getAppCode() {
return appCode;
}
public void setAppCode(String appCode) {
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
@@ -125,4 +126,13 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -92,7 +92,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/policyCfgList?function="+entity.getFunctionId();
return "redirect:" + adminPath +"/app/policyCfgList?functionId="+entity.getFunctionId();
}
/**
* 策略配置审核
@@ -198,7 +198,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/ipCfgList?function="+entity.getFunctionId();
return "redirect:" + adminPath +"/app/ipCfgList?functionId="+entity.getFunctionId();
}
/**
* 协议IP配置审核
@@ -259,7 +259,7 @@ public class AppCfgController extends BaseController {
for(AppHttpCfg entity:page.getList()){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
entity.setAppName(app.getSpecServiceName());
entity.setCfgKeywords(entity.getCfgKeywords().replace(Constants.KEYWORD_EXPR, "&"));
// entity.setCfgKeywords(entity.getCfgKeywords().replace(Constants.KEYWORD_EXPR, "&"));
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
@@ -304,7 +304,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/httpCfgList?function="+entity.getFunctionId();
return "redirect:" + adminPath +"/app/httpCfgList?functionId="+entity.getFunctionId();
}
/**
* http配置审核
@@ -409,7 +409,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/domainCfgList?function="+entity.getFunctionId();
return "redirect:" + adminPath +"/app/domainCfgList?functionId="+entity.getFunctionId();
}
/**
* domain配置审核
@@ -514,7 +514,7 @@ public class AppCfgController extends BaseController {
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/byteCfgList?function="+entity.getFunctionId();
return "redirect:" + adminPath +"/app/byteCfgList?functionId="+entity.getFunctionId();
}
/**
* byte配置审核

View File

@@ -4,7 +4,8 @@
<resultMap id="AppPolicyCfgMap" type="com.nis.domain.configuration.AppPolicyCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
@@ -33,7 +34,8 @@
<resultMap id="AppIpCfgMap" type="com.nis.domain.configuration.AppIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
@@ -68,7 +70,8 @@
<resultMap id="AppHttpCfgMap" type="com.nis.domain.configuration.AppHttpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="district" property="district" jdbcType="VARCHAR" />
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
@@ -98,7 +101,8 @@
<resultMap id="AppDomainCfgMap" type="com.nis.domain.configuration.AppDomainCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="domain" property="domain" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
@@ -127,7 +131,8 @@
<resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="bytes" property="bytes" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
@@ -156,7 +161,8 @@
<resultMap id="AppInnerRuleCfgMap" type="com.nis.domain.configuration.AppInnerRuleCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="VARCHAR" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="rule_file" property="ruleFile" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
@@ -184,7 +190,7 @@
</resultMap>
<sql id="AppPolicyCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,
@@ -192,7 +198,7 @@
</sql>
<sql id="AppIpCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID, r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID, r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
@@ -201,7 +207,7 @@
</sql>
<sql id="AppHttpCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
@@ -209,7 +215,7 @@
</sql>
<sql id="AppDomainCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
@@ -217,7 +223,7 @@
</sql>
<sql id="AppByteCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
@@ -225,14 +231,14 @@
</sql>
<sql id="AppInnerRuleCfg_Column" >
r.CFG_ID, r.APP_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.RULE_FILE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
</sql>
<sql id="AppCommonCfg_Value_List" >
#{appCode,jdbcType=VARCHAR},#{specServiceId,jdbcType=INTEGER},
#{appCode,jdbcType=INTEGER},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER},
#{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
@@ -912,7 +918,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_policy_cfg (
APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,
@@ -927,7 +933,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_ip_cfg (
APP_CODE,SPEC_SERVICE_ID, CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID, CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
@@ -945,7 +951,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_http_cfg (
APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
@@ -961,7 +967,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_domain_cfg (
APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
@@ -977,7 +983,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_byte_cfg (
APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
@@ -993,7 +999,7 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_inner_rule_cfg (
APP_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
@@ -1012,8 +1018,11 @@
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null and appCode != ''">
APP_CODE = #{appCode,jdbcType=VARCHAR},
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
@@ -1093,8 +1102,11 @@
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null and appCode != ''">
APP_CODE = #{appCode,jdbcType=VARCHAR},
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
@@ -1200,8 +1212,11 @@
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null and appCode != ''">
APP_CODE = #{appCode,jdbcType=VARCHAR},
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
@@ -1295,8 +1310,11 @@
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null and appCode != ''">
APP_CODE = #{appCode,jdbcType=VARCHAR},
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
@@ -1387,8 +1405,11 @@
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null and appCode != ''">
APP_CODE = #{appCode,jdbcType=VARCHAR},
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},

View File

@@ -28,6 +28,7 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AppCfgDao;
import com.nis.web.dao.configuration.AreaIpCfgDao;
@@ -126,7 +127,7 @@ public class AppCfgService extends BaseService {
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -185,7 +186,7 @@ public class AppCfgService extends BaseService {
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -242,7 +243,7 @@ public class AppCfgService extends BaseService {
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -299,7 +300,7 @@ public class AppCfgService extends BaseService {
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -352,7 +353,7 @@ public class AppCfgService extends BaseService {
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -390,7 +391,12 @@ public class AppCfgService extends BaseService {
entity.setTableName(AppPolicyCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
entity.setCfgKeywords(entity.getAppCode());
if(entity.getBehavCode()!=null){
entity.setCfgKeywords(entity.getAppCode()+"&"+entity.getBehavCode());
}else{
entity.setCfgKeywords(entity.getAppCode()+"");
}
List<AppPolicyCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
@@ -424,18 +430,17 @@ public class AppCfgService extends BaseService {
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置用户自定义域
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
//限速业务需要设置
String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit");
if(!actionCode.equals("默认")){
if(entity.getAction().equals(Integer.parseInt(actionCode))){
userRegion += Constants.USER_REGION_SPLIT+"RATE_LIMIT="+entity.getRatelimit();
}
}
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
@@ -514,18 +519,8 @@ public class AppCfgService extends BaseService {
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置用户自定义域
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
@@ -605,18 +600,8 @@ public class AppCfgService extends BaseService {
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置用户自定义域
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
@@ -696,18 +681,10 @@ public class AppCfgService extends BaseService {
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置用户自定义域
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
"DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+
"DOMAIN_STR="+entity.getDomain();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
@@ -789,17 +766,7 @@ public class AppCfgService extends BaseService {
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置用户自定义域
String userRegion = "";
if(!StringUtil.isEmpty(entity.getAppCode())){
userRegion = userRegion+entity.getAppCode()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
if(entity.getRatelimit()!=null){
userRegion = userRegion+entity.getRatelimit()+Constants.USER_REGION_SPLIT;
}else{
userRegion = userRegion+Constants.USER_REGION_SPLIT;
}
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);

View File

@@ -174,7 +174,7 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}

View File

@@ -45,6 +45,7 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.IpUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
@@ -413,6 +414,41 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//判断http配置是否需要设置自定义域参数
String actionValue = DictUtils.getDictCode("SERVICE_ACTION", "action_monit");
String userRegion = "";
//只有监测业务,并且头域的匹配区域不匹配字典中的信息时需要设置
if(!actionValue.equals("默认") && entity.getAction().equals(Integer.parseInt(actionValue))){
//请求头域
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpReqHdrList()){
String dictValue = DictUtils.getDictCode("REQUEST_HEADER_DISTRICT", head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
}
}
}
}
//应答头域
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
for(ComplexkeywordCfg head:entity.getHttpResHdrList()){
String dictValue = DictUtils.getDictCode("RESPONSE_HEADER_DISTRICT", head.getDistrict());
if(StringUtil.isEmpty(dictValue) || dictValue.equals("默认")){
if(userRegion.equals("")){
userRegion += "HTTP_HEADER="+head.getDistrict();
}else{
userRegion += ";"+"HTTP_HEADER="+head.getDistrict();
}
}
}
}
maatCfg.setUserRegion(userRegion);
}
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
@@ -869,7 +905,8 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
maatCfg.setIsValid(entity.getIsValid());
// dns reject userRegion=;dnsStrategyId;
if(!StringUtil.isEmpty(entity.getDnsStrategyId())){
maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
// maatCfg.setUserRegion(Constants.USER_REGION_SPLIT+entity.getDnsStrategyId()+Constants.USER_REGION_SPLIT);
maatCfg.setUserRegion("DNS_STRATEGY="+entity.getDnsStrategyId());
}
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);