增加ssl配置功能

This commit is contained in:
zhangwei
2018-05-31 17:07:26 +08:00
parent 6eafbf6f59
commit df4f6e68ae
16 changed files with 545 additions and 114 deletions

View File

@@ -5,6 +5,7 @@ import java.util.List;
import com.nis.domain.configuration.AvFileSampleCfg;
import com.nis.domain.configuration.AvSignSampleCfg;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.DnsDomainCfg;
import com.nis.domain.configuration.DnsIpCfg;
@@ -13,6 +14,7 @@ import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.SslKeywordCfg;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@@ -26,7 +28,7 @@ import com.nis.web.dao.MyBatisDao;
public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{
public CfgIndexInfo getCfgIndexInfo(Long id);
public List<CfgIndexInfo> getHttpList(CfgIndexInfo entity);
public List<CfgIndexInfo> getWebsiteList(CfgIndexInfo entity);
public List<IpPortCfg> getIpPortList(CfgIndexInfo entity);
public List<HttpUrlCfg> getHttpUrlList(CfgIndexInfo entity);
public List<HttpResHeadCfg> getHttpResHdrList(CfgIndexInfo entity);
@@ -34,7 +36,7 @@ public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{
public List<HttpReqHeadCfg> getHttpReqHdrList(CfgIndexInfo entity);
public List<HttpBodyCfg> getHttpReqBodyList(CfgIndexInfo entity);
public void saveCfgIndex(CfgIndexInfo entity);
public void saveHttpIpCfg(IpPortCfg entity);
public void saveIpPortCfg(IpPortCfg entity);
public void saveHttpUrlCfg(HttpUrlCfg entity);
public void saveHttpReqHdrCfg(HttpReqHeadCfg entity);
public void saveHttpResHdrCfg(HttpResHeadCfg entity);
@@ -57,4 +59,9 @@ public interface WebsiteCfgDao extends CrudDao<CfgIndexInfo>{
public void deleteDnsIpCfg(CfgIndexInfo entity);
public void deleteDnsDomainCfg(CfgIndexInfo entity);
public List<BaseStringCfg> getSslKewordList(CfgIndexInfo entity);
public void saveSslKeywordCfg(BaseStringCfg entity);
public void deleteSslIpCfg(CfgIndexInfo entity);
public void deleteSslKeywordCfg(CfgIndexInfo entity);
}

View File

@@ -143,7 +143,7 @@
a.audit_time,a.service_id,a.request_id,a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable,
a.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code
</sql>
<select id="getHttpList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<select id="getWebsiteList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
SELECT
<include refid="ConfigIndex_Column" />
<trim prefix="," prefixOverrides=",">
@@ -289,6 +289,15 @@
</where>
)
</if>
<!-- <if test="sslCfg!=null">
AND a.compile_id in (select f.compile_id from ssl_keyword_cfg f
<where>
<if test="sslCfg.cfgKeywords != null and sslCfg.cfgKeywords != ''">
and f.cfg_keywords like concat(concat('%',#{sslCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
</where>
)
</if> -->
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
@@ -320,7 +329,7 @@
<select id="getHttpReqBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
<include refid="StrCfg_Column" />
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type='http_res_body' and function_id=#{functionId}
FROM http_body_cfg a where compile_id=#{compileId} and cfg_type='http_req_body' and function_id=#{functionId}
</select>
<select id="getHttpResBodyList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
@@ -337,7 +346,14 @@
<include refid="ComplexCfg_Column" />
FROM http_res_head_cfg a where compile_id=#{compileId} and function_id=#{functionId}
</select>
<select id="getSslKewordList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
SELECT
<include refid="StrCfg_Column" />
FROM ssl_keyword_cfg a where compile_id=#{compileId} and function_id=#{functionId}
<if test="cfgType != null and cfgType != ''">
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
</if>
</select>
<!-- insert cfgIndexInfox -->
<insert id="saveCfgIndex" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
@@ -386,7 +402,7 @@
)
</insert>
<!-- insert ip_port_cfg表信息 -->
<insert id="saveHttpIpCfg" parameterType="com.nis.domain.configuration.IpPortCfg" >
<insert id="saveIpPortCfg" parameterType="com.nis.domain.configuration.IpPortCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
@@ -800,4 +816,71 @@
</trim>
</update>
<!-- insert ssl_keyword_cfg表信息 -->
<insert id="saveSslKeywordCfg" parameterType="com.nis.domain.configuration.SslKeywordCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into ssl_keyword_cfg (
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,
function_id,
cfg_keywords,
cfg_type,
cfg_region_code,
expr_type,
match_method,
is_hexbin
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{cfgKeywords,jdbcType=VARCHAR},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER},
#{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER}
)
</insert>
<!-- 删除ssl子配置 -->
<delete id="deleteSslIpCfg" >
delete from ip_port_cfg where compile_id=#{compileId} and protocol_id=10 and function_id=#{functionId}
</delete>
<!-- 删除ssl关键字配置 -->
<delete id="deleteSslKeywordCfg">
delete from ssl_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
</mapper>