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

Conflicts:
	src/main/java/com/nis/web/controller/BaseController.java
	src/main/resources/messages/message_en.properties
	src/main/resources/messages/message_ru.properties
This commit is contained in:
duandongmei
2018-08-21 13:31:21 +08:00
26 changed files with 1370 additions and 25 deletions

View File

@@ -0,0 +1,67 @@
package com.nis.web.controller.log.ntc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.nis.domain.FunctionServiceDict;
import com.nis.domain.PageLog;
import com.nis.domain.log.NtcIpLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/log/ntc/p2pLogs")
public class P2pLogController extends BaseController {
@RequestMapping(value = {"list", ""})
public String list(@ModelAttribute("log") NtcIpLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcIpLog> page = new PageLog<NtcIpLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
initLogSearchValue(log, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
logger.info("查询结果:" + recv);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcIpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpLog>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
page.setList(fromJson.getData().getList());
List<NtcIpLog> list = page.getList();
for (NtcIpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
}
model.addAttribute("page", page);
}
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/p2pList";
}
}

View File

@@ -22,12 +22,13 @@
<result column="config_port_pattern" property="configPortPattern" jdbcType="VARCHAR" /> <result column="config_port_pattern" property="configPortPattern" jdbcType="VARCHAR" />
<result column="config_direction" property="configDirection" jdbcType="VARCHAR" /> <result column="config_direction" property="configDirection" jdbcType="VARCHAR" />
<result column="config_protocol" property="configProtocol" jdbcType="VARCHAR" /> <result column="config_protocol" property="configProtocol" jdbcType="VARCHAR" />
<result column="config_region_sort" property="configRegionSort" jdbcType="INTEGER" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat,region_type dict_id, function_id, config_region_value,config_region_code, config_district, config_desc, is_valid,is_maat,region_type
,config_multi_keywords,config_hex,config_expr_type,config_match_method,config_service_type,config_ip_port_show,config_ip_type, ,config_multi_keywords,config_hex,config_expr_type,config_match_method,config_service_type,config_ip_port_show,config_ip_type,
config_ip_pattern,config_port_pattern,config_direction,config_protocol config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_region_sort
</sql> </sql>
<select id="getList" resultMap="BaseResultMap" > <select id="getList" resultMap="BaseResultMap" >
select select
@@ -43,7 +44,10 @@
<if test="configRegionCode != null"> <if test="configRegionCode != null">
AND config_region_code=#{configRegionCode,jdbcType=VARCHAR} AND config_region_code=#{configRegionCode,jdbcType=VARCHAR}
</if> </if>
order by dict_id,config_region_code <if test="configRegionSort != null">
AND config_region_sort=#{configRegionSort,jdbcType=VARCHAR}
</if>
order by dict_id,config_region_sort
</select> </select>
</mapper> </mapper>

View File

@@ -11,7 +11,7 @@
<result column="service_name" property="serviceName" jdbcType="VARCHAR" /> <result column="service_name" property="serviceName" jdbcType="VARCHAR" />
<result column="service_desc" property="serviceDesc" jdbcType="VARCHAR" /> <result column="service_desc" property="serviceDesc" jdbcType="VARCHAR" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="region_code" property="regionCode" jdbcType="INTEGER" /> <result column="region_code" property="regionCode" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >

View File

@@ -14,6 +14,7 @@ import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex;
import com.nis.domain.configuration.AppInnerRuleCfg; import com.nis.domain.configuration.AppInnerRuleCfg;
import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppStringCfg; import com.nis.domain.configuration.AppStringCfg;
import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.BaseStringCfg;
@@ -64,7 +65,13 @@ public interface AppCfgDao {
public List<AppInnerRuleCfg> findAppInnerRuleList(AppInnerRuleCfg entity) ; public List<AppInnerRuleCfg> findAppInnerRuleList(AppInnerRuleCfg entity) ;
public AppInnerRuleCfg getAppInnerRuleCfg(Long cfgId) ; public AppInnerRuleCfg getAppInnerRuleCfg(Long cfgId) ;
public int insertAppInnerRuleCfg(AppInnerRuleCfg entity); public int insertAppInnerRuleCfg(AppInnerRuleCfg entity);
public int updateAppInnerRuleCfg(AppInnerRuleCfg entity); public int updateAppInnerRuleCfg(AppInnerRuleCfg entity);
//app ssl证书特征增删改查
public List<AppSslCertCfg> findAppSslList(AppSslCertCfg entity);
public AppSslCertCfg getAppSslCfg(Long cfgId);
public int insertAppSslCfg(AppSslCertCfg entity);
public int updateAppSslCfg(AppSslCertCfg entity);
//审核配置 //审核配置
public void auditCfg(BaseCfg entity); public void auditCfg(BaseCfg entity);
//修改配置状态 //修改配置状态

View File

@@ -228,6 +228,37 @@
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" /> <result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" /> <result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap> </resultMap>
<resultMap id="AppSslCfgMap" type="com.nis.domain.configuration.AppSslCertCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<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" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
</resultMap>
<sql id="AppPolicyCfg_Column" > <sql id="AppPolicyCfg_Column" >
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.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
@@ -298,6 +329,13 @@
a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable a.compile_id,a.is_area_effective,a.classify,a.attribute,a.lable
,a.area_effective_ids,a.function_id,a.cfg_region_code ,a.area_effective_ids,a.function_id,a.cfg_region_code
</sql> </sql>
<sql id="AppSslCfg_Column" >
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,
r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
</sql>
<!-- <sql id="AppCfg_Column_List_with_id_alias" > <!-- <sql id="AppCfg_Column_List_with_id_alias" >
<choose> <choose>
<when test="page !=null and page.alias != null and page.alias != ''"> <when test="page !=null and page.alias != null and page.alias != ''">
@@ -367,7 +405,13 @@
FROM app_inner_rule_cfg r FROM app_inner_rule_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT} WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select> </select>
<select id="getAppSslCfg" resultMap="AppSslCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppSslCfg_Column" />
FROM app_ssl_cert_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="findAppPolicyList" resultMap="AppPolicyCfgMap"> <select id="findAppPolicyList" resultMap="AppPolicyCfgMap">
select select
<include refid="AppPolicyCfg_Column"/> <include refid="AppPolicyCfg_Column"/>
@@ -1002,7 +1046,108 @@
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<select id="findAppSslList" resultMap="AppSslCfgMap">
select
<include refid="AppSslCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_ssl_cert_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="cfgKeywords != null and cfgKeywords != ''">
AND r.CFG_KEYWORDS like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
<if test="district != null and district != ''">
AND r.DISTRICT =#{district,jdbcType=VARCHAR}
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<insert id="insertAppPolicyCfg" parameterType="com.nis.domain.configuration.AppPolicyCfg" > <insert id="insertAppPolicyCfg" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId"> <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
@@ -1103,6 +1248,22 @@
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppSslCfg" parameterType="com.nis.domain.configuration.AppSslCertCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_ssl_cert_cfg (
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,
DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
)values (
<include refid="AppCommonCfg_Value_List" />,
#{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
)
</insert>
<!-- insert ip_port_cfg表信息 --> <!-- insert ip_port_cfg表信息 -->
<insert id="insertAppPolicyIpCfg" parameterType="com.nis.domain.configuration.IpPortCfg" > <insert id="insertAppPolicyIpCfg" parameterType="com.nis.domain.configuration.IpPortCfg" >
@@ -1687,6 +1848,105 @@
and function_id=#{functionId,jdbcType=INTEGER} and function_id=#{functionId,jdbcType=INTEGER}
</trim> </trim>
</update> </update>
<update id="updateAppSslCfg" parameterType="com.nis.domain.configuration.AppSslCertCfg" >
update app_ssl_cert_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<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},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="district != null and district != ''">
district=#{district,jdbcType=VARCHAR},
</if>
<if test="cfgKeywords != null and cfgKeywords != ''">
cfg_keywords=#{cfgKeywords,jdbcType=VARCHAR},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<update id="auditCfg" parameterType="com.nis.domain.configuration.BaseCfg"> <update id="auditCfg" parameterType="com.nis.domain.configuration.BaseCfg">
update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER}, update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER},

View File

@@ -23,6 +23,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" /> <result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AvVoipIpCfgMap" type="com.nis.domain.configuration.AvVoipIpCfg" > <resultMap id="AvVoipIpCfgMap" type="com.nis.domain.configuration.AvVoipIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -157,7 +158,7 @@
r.CFG_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, r.CFG_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.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.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.function_id,r.do_log
</sql> </sql>
<sql id="AvVoipIp_Column" > <sql id="AvVoipIp_Column" >
r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port
@@ -545,7 +546,8 @@
ATTRIBUTE, ATTRIBUTE,
LABLE, LABLE,
AREA_EFFECTIVE_IDS, AREA_EFFECTIVE_IDS,
function_id function_id,
do_log
)values ( )values (
#{cfgDesc,jdbcType=VARCHAR}, #{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER}, #{action,jdbcType=INTEGER},
@@ -565,7 +567,8 @@
#{attribute,jdbcType=VARCHAR}, #{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER} #{functionId,jdbcType=INTEGER},
#{doLog,jdbcType=INTEGER}
) )
</insert> </insert>
<!-- insert AV_VOIP_IP_CFG表信息 --> <!-- insert AV_VOIP_IP_CFG表信息 -->
@@ -804,6 +807,9 @@
<if test="serviceId != null" > <if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER}, service_id = #{serviceId,jdbcType=INTEGER},
</if> </if>
<if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if>
</trim> </trim>
</set> </set>
<where> <where>

View File

@@ -0,0 +1,37 @@
package com.nis.web.dao.configuration;
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.ComplexkeywordCfg;
import com.nis.domain.configuration.DnsDomainCfg;
import com.nis.domain.configuration.DnsIpCfg;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.InterceptPktBin;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.SslKeywordCfg;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
/**
* WEB相关配置数据处理类
* @author dell
*
*/
@MyBatisDao
public interface InterceptCfgDao extends CrudDao<CfgIndexInfo>{
public List<InterceptPktBin> getInterceptPktBin(CfgIndexInfo entity);
public void insertInterceptPktBin(InterceptPktBin entity);
public void deleteInterceptPktBin(CfgIndexInfo entity);
public void deleteInterceptIpCfg(CfgIndexInfo entity);
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.InterceptCfgDao" >
<resultMap id="stringCfgMap" type="com.nis.domain.configuration.BaseStringCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type " property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
</resultMap>
<sql id="StrCfg_Column" >
a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,
a.action,a.is_valid,a.is_audit,a.creator_id,a.create_time,a.editor_id,a.edit_time, a.auditor_id,
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="getInterceptPktBinList" resultMap="stringCfgMap">
SELECT
<include refid="StrCfg_Column" />
FROM intercept_pkt_bin a where compile_id=#{compileId} and function_id=#{functionId}
</select>
<!-- insert intercept_pkt_bin 表信息 -->
<insert id="saveInterceptPktBin" parameterType="com.nis.domain.configuration.InterceptPktBin" >
insert into intercept_pkt_bin (
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,
user_region1,
user_region2,
user_region3,
user_region4,
user_region5
)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},
#{userRegion1,jdbcType=VARCHAR},
#{userRegion2,jdbcType=VARCHAR},
#{userRegion3,jdbcType=VARCHAR},
#{userRegion4,jdbcType=VARCHAR},
#{userRegion5,jdbcType=VARCHAR}
)
</insert>
<delete id="deleteDnsIpCfg" >
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- 删除pkt bin子配置 -->
<delete id="deleteInterceptPktBin" >
delete from intercept_pkt_bin where compile_id=#{compileId} and function_id=#{functionId}
</delete>
</mapper>

View File

@@ -0,0 +1,25 @@
package com.nis.web.dao.configuration;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.nis.domain.callback.ProxyFileStrategyCfg;
import com.nis.web.dao.MyBatisDao;
/**
* 特定协议相关配置数据处理类
* @author dell
*
*/
@MyBatisDao
public interface ProxyFileStrategyDao {
public List<ProxyFileStrategyCfg> findPage(ProxyFileStrategyCfg entity) ;
public ProxyFileStrategyCfg getCfgById(@Param("cfgId")Long cfgId);
public void insert(ProxyFileStrategyCfg entity);
public void update(ProxyFileStrategyCfg entity);
}

View File

@@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.ProxyFileStrategyDao" >
<resultMap id="ProxyFileStrategyCfg" type="com.nis.domain.callback.ProxyFileStrategyCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="file_id" property="fileId" jdbcType="VARCHAR" />
<result column="file_desc" property="fileDesc" jdbcType="VARCHAR" />
<result column="url" property="url" jdbcType="VARCHAR" />
<result column="content_type" property="contentType" jdbcType="VARCHAR" />
<result column="content_length" property="contentLength" jdbcType="VARCHAR" />
<result column="md5" property="md5" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="level" property="level" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
</resultMap>
<sql id="ProxyFileStrategyCfgColumn" >
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.cfg_type,a.cfg_region_code,
a.FILE_ID,a.FILE_DESC,a.URL,a.CONTENT_TYPE,a.CONTENT_LENGTH,a.MD5
</sql>
<!-- voip条件查询列表信息 -->
<select id="findPage" resultMap="ProxyFileStrategyCfg" parameterType="com.nis.domain.callback.ProxyFileStrategyCfg" >
SELECT
<include refid="ProxyFileStrategyCfgColumn" />
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
FROM proxy_file_strategy_cfg a
left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id
left join sys_user u on a.auditor_id=u.id
left join request_info ri on a.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="cfgId != null">
AND a.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND a.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND a.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND a.IS_VALID != -1
</if>
<if test="isAudit != null">
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND a.CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editorName != null and editorName != ''">
AND a.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditorName != null and auditorName != ''">
AND a.AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="serviceId != null">
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND a.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND a.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND a.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND a.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND a.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND a.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND a.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<if test="functionId != null">
AND a.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="fileDesc != null and fileDesc != ''">
AND a.file_desc like concat(concat('%',#{fileDesc,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.CFG_ID desc
</otherwise>
</choose>
</select>
<!-- 根据Id获取ProxyFileStrategyCfg信息 -->
<select id="getCfgById" resultMap="ProxyFileStrategyCfg">
SELECT
<include refid="ProxyFileStrategyCfgColumn" />
FROM proxy_file_strategy_cfg a
<where>
<if test="cfgId != null">
and a.CFG_ID=#{cfgId,jdbcType=INTEGER}
</if>
</where>
</select>
<insert id="insert" parameterType="com.nis.domain.callback.ProxyFileStrategyCfg" >
insert into proxy_file_strategy_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_type,
cfg_region_code,
file_id,
file_desc,
url,
content_type,
content_length,
md5
)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},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{fileId,jdbcType=VARCHAR},
#{fileDesc,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR},
#{contentType,jdbcType=VARCHAR},
#{contentLength,jdbcType=INTEGER},
#{md5,jdbcType=VARCHAR}
)
</insert>
<update id="update" parameterType="com.nis.domain.callback.ProxyFileStrategyCfg" >
update proxy_file_strategy_cfg
<set>
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
edit_time = #{editTime,jdbcType=TIMESTAMP},
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null" >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null" >
cfg_type = #{cfgType,jdbcType=VARCHAR},
</if>
<if test="fileId != null" >
file_id = #{fileId ,jdbcType=VARCHAR},
</if>
<if test="fileDesc != null" >
file_desc = #{fileDesc ,jdbcType=VARCHAR},
</if>
<if test="url != null" >
url = #{url ,jdbcType=VARCHAR},
</if>
<if test="contentType != null" >
content_type = #{contentType ,jdbcType=VARCHAR},
</if>
<if test="contentLength != null" >
content_length = #{contentLength ,jdbcType=BIGINT},
</if>
<if test="md5 != null" >
md5 = #{md5 ,jdbcType=VARCHAR},
</if>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -16,6 +16,7 @@ import com.nis.domain.configuration.AppDomainCfg;
import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.MaatCfg;
@@ -84,6 +85,13 @@ public class AppCfgService extends BaseService {
page.setList(list); page.setList(list);
return page; return page;
} }
public Page<AppSslCertCfg> findAppSslList(Page<AppSslCertCfg> page, AppSslCertCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<AppSslCertCfg> list = appCfgDao.findAppSslList(entity);
page.setList(list);
return page;
}
public AppPolicyCfg getAppPolicyCfg(Long cfgId){ public AppPolicyCfg getAppPolicyCfg(Long cfgId){
AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId); AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId);
List<IpPortCfg> ipPortList = appCfgDao.getAppPolicyIpList(policy); List<IpPortCfg> ipPortList = appCfgDao.getAppPolicyIpList(policy);
@@ -102,6 +110,9 @@ public class AppCfgService extends BaseService {
public AppByteCfg getAppByteCfg(Long cfgId){ public AppByteCfg getAppByteCfg(Long cfgId){
return appCfgDao.getAppByteCfg(cfgId); return appCfgDao.getAppByteCfg(cfgId);
} }
public AppSslCertCfg getAppSslCfg(Long cfgId){
return appCfgDao.getAppSslCfg(cfgId);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class) @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception{ public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception{
//设置区域运营商信息 //设置区域运营商信息
@@ -398,7 +409,65 @@ public class AppCfgService extends BaseService {
} }
} }
} }
} }
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAppSslCfg(AppSslCertCfg entity) throws Exception{
//设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.insertAppSslCfg(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.updateAppSslCfg(entity);
//删除旧的区域IP新增新的区域IP
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){ public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){
String configType=entity.getConfigType(); String configType=entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean(); ToMaatBean maatBean = new ToMaatBean();
@@ -864,6 +933,87 @@ public class AppCfgService extends BaseService {
logger.info("app字节配置取消配置响应信息"+result.getMsg()); logger.info("app字节配置取消配置响应信息"+result.getMsg());
} }
} }
public void auditAppSslCfg(AppSslCertCfg entity,Integer isAudit){
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppSslCertCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
List<AppSslCertCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,3,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("app SSL配置下发配置参数"+json);
//调用服务接口下发配置
//ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
//logger.info("app SSL配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("app SSL配置下发配置参数"+json);
//调用服务接口下发配置
//ToMaatResult result = ConfigServiceUtil.put(json,1);
//logger.info("app SSL配置取消配置响应信息"+result.getMsg());
}
}
public void updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId){ public void updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId){
AppPolicyCfg entity = new AppPolicyCfg(); AppPolicyCfg entity = new AppPolicyCfg();
String[] idArray = ids.split(","); String[] idArray = ids.split(",");
@@ -983,4 +1133,26 @@ public class AppCfgService extends BaseService {
} }
} }
public void updateAppSslCfgValid(Integer isValid,String ids,Integer functionId){
AppSslCertCfg entity = new AppSslCertCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
entity.setTableName(AppSslCertCfg.getTablename());
entity.setFunctionId(functionId);
appCfgDao.updateCfgValid(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.updateCfgValid(cfg);
}
}
}
} }

View File

@@ -624,11 +624,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}else{ }else{
// 审核未通过状态的配置 修改后状态改为未审核 // 审核未通过状态的配置 修改后状态改为未审核
CfgIndexInfo cfgIndexInfo = fileTransferCfgDao.getCfgIndexInfo(entity.getCfgId()); entity.setIsValid(0);
if(cfgIndexInfo.getIsAudit() == 2) { entity.setIsAudit(0);
entity.setIsValid(0);
entity.setIsAudit(0);
}
entity.setEditTime(new Date()); entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditorId(entity.getCurrentUser().getId());
fileTransferCfgDao.updateCfgIndex(entity); fileTransferCfgDao.updateCfgIndex(entity);

View File

@@ -408,15 +408,25 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
if(entity.getAction().equals(16)){ if(entity.getAction().equals(16)){
String userRegion1=StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1(); String userRegion1=StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1();
userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+userRegion1; userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+userRegion1;
String userRegion2=StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2(); String userRegion3=StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3();//应答文件
userRegion=userRegion+";"+Constants.REDIRECT_CONTENT_KEY+"="+userRegion2; if(StringUtils.isNotBlank(userRegion3)) {
userRegion=userRegion+";"+Constants.CONTENT_FILE_ID_KEY+"="+userRegion3;
}else {//应答内容
String userRegion2=StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2();
userRegion=userRegion+";"+Constants.REDIRECT_CONTENT_KEY+"="+userRegion2;
}
} }
//HTTP redirect response code is not null ;response content is not null(userRegion is not null) //HTTP redirect response code is not null ;response content is not null(userRegion is not null)
if(entity.getAction().equals(48)){ if(entity.getAction().equals(48)){
String userRegion1=StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1(); String userRegion1=StringUtil.isEmpty(entity.getUserRegion1()) ? "":entity.getUserRegion1();
userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+userRegion1; userRegion=Constants.REDIRECT_RESPONSE_CODE_KEY+"="+userRegion1;
String userRegion2=StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2(); String userRegion3=StringUtil.isEmpty(entity.getUserRegion3()) ? "":entity.getUserRegion3();//应答文件
userRegion=userRegion+";"+Constants.REDIRECT_URL_KEY+"="+userRegion2; if(StringUtils.isNotBlank(userRegion3)) {
userRegion=userRegion+";"+Constants.CONTENT_FILE_ID_KEY+"="+userRegion3;
}else {//应答内容
String userRegion2=StringUtil.isEmpty(entity.getUserRegion2()) ? "":entity.getUserRegion2();
userRegion=userRegion+";"+Constants.REDIRECT_URL_KEY+"="+userRegion2;
}
} }
//HTTP replace replace type is not null ;find is not null;replace with is not null(userRegion is not null) //HTTP replace replace type is not null ;find is not null;replace with is not null(userRegion is not null)
if(entity.getAction().equals(80)){ if(entity.getAction().equals(80)){

View File

@@ -0,0 +1,114 @@
package com.nis.web.service.configuration;
import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.nis.domain.Page;
import com.nis.domain.SysUser;
import com.nis.domain.callback.ProxyFileStrategyCfg;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.maat.ToMaatResult;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.FileUtils;
import com.nis.util.JsonMapper;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.ProxyFileStrategyDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
@Service
public class ProxyFileStrategyService extends BaseService{
@Autowired
protected ProxyFileStrategyDao proxyFileDao;
/**
* 分页查询
* @param page
* @param entity
* @return
*/
public Page<ProxyFileStrategyCfg> findPage(Page page, ProxyFileStrategyCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
List<ProxyFileStrategyCfg> list=proxyFileDao.findPage(entity);
page.setList(list);
return page;
}
public ProxyFileStrategyCfg getCfgById(Long cfgId) {
return proxyFileDao.getCfgById(cfgId);
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(ProxyFileStrategyCfg entity){
Date createTime=new Date();
//设置区域运营商信息
setAreaEffectiveIds(entity);
//新增
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setIsValid(0);
entity.setIsAudit(0);
//修改
proxyFileDao.insert(entity);
}else{
Date editTime=new Date();
entity.setIsValid(0);
entity.setIsAudit(0);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
proxyFileDao.update(entity);
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void update(Integer isAudit,Integer isValid,String ids,Integer functionId){
ProxyFileStrategyCfg entity = new ProxyFileStrategyCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setFunctionId(functionId);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
proxyFileDao.update(entity);
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id){
Date auditTime = new Date();//审核时间
ProxyFileStrategyCfg entity = proxyFileDao.getCfgById(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
proxyFileDao.update(entity);
}
/**
* 获取所有的 响应文件 策略
* @return
*/
public List<ProxyFileStrategyCfg> getProxyFileStrategyCfgList(ProxyFileStrategyCfg entity){
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
List<ProxyFileStrategyCfg> list=proxyFileDao.findPage(entity);
return list;
}
}

View File

@@ -1082,7 +1082,7 @@ PXY_INTERCEPT_PKT_BIN=Intercept Messages
certificate=Certificate certificate=Certificate
app_ssl_config=APP SSL Cert Feature app_ssl_config=APP SSL Cert Feature
call_external_procedures_failed=Call external procedures failedfile_strategy=\u6587\u4EF6\u7B56\u7565 call_external_procedures_failed=Call external procedures failed
file_strategy=File Strategy file_strategy=File Strategy
file_desc=File Desc file_desc=File Desc
content_type=Content Type content_type=Content Type

View File

@@ -1024,6 +1024,7 @@ MM_AV_URL=\u0410\u0443\u0434\u0438\u043E \u0438 \u0432\u0435\u0434\u0438\u043E U
MM_VOIP_IP=VoIP IP MM_VOIP_IP=VoIP IP
MM_VOIP_ACCOUNT=\u0421\u0447\u0435\u0442 VoIP MM_VOIP_ACCOUNT=\u0421\u0447\u0435\u0442 VoIP
#=======================for import ip configuration================= #=======================for import ip configuration=================
<<<<<<< HEAD
drop_ip=\u041E\u0442\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u043D\u0438\u0435IP drop_ip=\u041E\u0442\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u043D\u0438\u0435IP
loop_ip=\u0420\u0435\u0444\u043B\u044E\u043A\u0441 IP loop_ip=\u0420\u0435\u0444\u043B\u044E\u043A\u0441 IP
drop_or_loop_ip=\u041E\u0442\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u043D\u0438\u0435/\u0420\u0435\u0444\u043B\u044E\u043A\u0441 IP drop_or_loop_ip=\u041E\u0442\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u043D\u0438\u0435/\u0420\u0435\u0444\u043B\u044E\u043A\u0441 IP
@@ -1038,4 +1039,15 @@ app_desc=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0441\u043E\u0446\u0
tunnel_code=\u0421\u0435\u0440\u0438\u0439\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F tunnel_code=\u0421\u0435\u0440\u0438\u0439\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F
tunnel_name=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F tunnel_name=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F
tunnel_desc= \u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F tunnel_desc= \u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0437\u0430\u0448\u0438\u0444\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0442\u0443\u043D\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F
call_external_procedures_failed=\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u044B\u0437\u043E\u0432\u0430 \u0432\u043D\u0435\u0448\u043D\u0435\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B call_external_procedures_failed=\u041E\u0448\u0438\u0431\u043A\u0430 \u0432\u044B\u0437\u043E\u0432\u0430 \u0432\u043D\u0435\u0448\u043D\u0435\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B
=======
drop_ip=IP Drop
loop_ip=IP Loop
drop_or_loop_ip=IP Drop Or Loop
reject_or_monit_ip=IP Reject Or Monit
file_desc=File Desc
content_type=Content Type
content_length=Content Length
response_file=Response File
>>>>>>> branch 'develop' of http://10.0.6.99/gwall/gwall.git

View File

@@ -450,7 +450,7 @@ ipv6_default_ip_range_value=::-::
port_default=0 port_default=0
port_mask_default=0/65535 port_mask_default=0/65535
#MAAT CFG \u4e00\u4e9b\u9ed8\u8ba4\u503c #MAAT CFG \u4e00\u4e9b\u9ed8\u8ba4\u503c
maat_cfg_dolog_default=1 maat_cfg_dolog_default=2
maat_cfg_dolog_doblacklist_default=1 maat_cfg_dolog_doblacklist_default=1
maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configpercent_default=100
maat_cfg_dolog_configoption_default=1 maat_cfg_dolog_configoption_default=1

View File

@@ -3,5 +3,5 @@ ALTER TABLE function_region_dict ADD config_ip_type VARCHAR(20) NULL COMMENT 'ip
ALTER TABLE function_region_dict ADD config_ip_pattern VARCHAR(10) NULL COMMENT 'ip的格式 1:ip掩码;2:IP范围;3:IP;使用逗号分隔'; ALTER TABLE function_region_dict ADD config_ip_pattern VARCHAR(10) NULL COMMENT 'ip的格式 1:ip掩码;2:IP范围;3:IP;使用逗号分隔';
ALTER TABLE function_region_dict ADD config_port_pattern VARCHAR(10) NULL COMMENT '端口的格式1:port;2:port_mask;使用逗号分隔'; ALTER TABLE function_region_dict ADD config_port_pattern VARCHAR(10) NULL COMMENT '端口的格式1:port;2:port_mask;使用逗号分隔';
ALTER TABLE function_region_dict ADD config_direction VARCHAR(10) NULL COMMENT 'IP方向0,双向;1,单向.使用逗号分隔'; ALTER TABLE function_region_dict ADD config_direction VARCHAR(10) NULL COMMENT 'IP方向0,双向;1,单向.使用逗号分隔';
ALTER TABLE function_service_dict ADD region_code INT(11) NULL COMMENT 'function_region_dict 表中的config_region_code字段值'; ALTER TABLE function_service_dict ADD region_code VARCHAR(20) NULL COMMENT 'function_region_dict 表中的config_region_code字段值';
ALTER TABLE function_region_dict ADD config_protocol VARCHAR(20) NULL COMMENT '协议 0:任意;6:TCP;17:UDP;1:ICMP;50:ESP;51:AH'; ALTER TABLE function_region_dict ADD config_protocol VARCHAR(20) NULL COMMENT '协议 0:任意;6:TCP;17:UDP;1:ICMP;50:ESP;51:AH';

View File

@@ -0,0 +1,8 @@
ALTER TABLE function_region_dict ADD config_region_sort INT(11) COMMENT 'region排序';
UPDATE function_region_dict SET config_region_sort=1 WHERE config_region_code=1;
UPDATE function_region_dict SET config_region_sort=2 WHERE config_region_code=2;
UPDATE function_region_dict SET config_region_sort=3 WHERE config_region_code=3;
UPDATE function_region_dict SET config_region_sort=4 WHERE config_region_code=4;
UPDATE function_region_dict SET config_region_sort=5 WHERE config_region_code=5;
UPDATE function_region_dict SET config_region_sort=6 WHERE config_region_code=6;
UPDATE function_region_dict SET config_region_sort=7 WHERE config_region_code=7;

View File

@@ -0,0 +1,60 @@
/*
Navicat MariaDB Data Transfer
Source Server : 10.0.6.249
Source Server Version : 100214
Source Host : 10.0.6.249:3306
Source Database : gwall
Target Server Type : MariaDB
Target Server Version : 100214
File Encoding : 65001
Date: 2018-08-20 20:40:02
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for app_layer_header_cfg
-- ----------------------------
DROP TABLE IF EXISTS `app_layer_header_cfg`;
CREATE TABLE `app_layer_header_cfg` (
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`district` varchar(128) NOT NULL,
`cfg_keywords` varchar(1024) NOT NULL,
`app_code` int(11) NOT NULL,
`behav_code` int(11) DEFAULT NULL,
`spec_service_id` varchar(255) NOT NULL COMMENT 'specific_service_cfg .spec_service_id',
`cfg_desc` varchar(128) DEFAULT '',
`action` int(11) NOT NULL COMMENT '1:阻æ­ï¼ˆreject)2ï¼šçæµï¼ˆmonit)5:管控白名单(Control whitelist)6ï¼šçæµç™½åå•ï¼ˆmonit whitelist)7ï¼šç®¡æŽ§çæµéƒ½ç™½åå•ï¼ˆglobal whitelist)',
`is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) åæ¶ˆå®¡æ ¸é€šè¿‡ï¼Œæ­¤å­—段置0',
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3åæ¶ˆå®¡æ ¸é€šè¿‡\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
`creator_id` int(11) NOT NULL COMMENT 'sys_user.id',
`create_time` datetime NOT NULL,
`editor_id` int(11) DEFAULT NULL COMMENT '来自sys_user.id',
`edit_time` datetime DEFAULT NULL,
`auditor_id` int(11) DEFAULT NULL COMMENT '来自sys_user.id',
`audit_time` datetime DEFAULT NULL,
`service_id` int(11) NOT NULL COMMENT '业务id',
`request_id` int(11) NOT NULL COMMENT '来自request_info.id',
`compile_id` int(11) NOT NULL,
`is_area_effective` int(11) NOT NULL DEFAULT 0,
`classify` varchar(128) DEFAULT '',
`attribute` varchar(128) DEFAULT '',
`lable` varchar(128) DEFAULT '',
`area_effective_ids` varchar(1024) DEFAULT '',
`function_id` int(11) NOT NULL,
`ratelimit` int(11) DEFAULT 0 COMMENT '限速比例',
`cfg_type` varchar(64) NOT NULL DEFAULT '',
`cfg_region_code` int(11) NOT NULL,
`expr_type` int(11) NOT NULL DEFAULT 0 COMMENT '0无表达式1与表达式',
`match_method` int(11) NOT NULL DEFAULT 3 COMMENT 'expr_type:0时有意义其它情况必须置0。0子串匹配1右匹配2左匹配3完全匹配',
`is_hexbin` int(11) NOT NULL DEFAULT 0 COMMENT '默认为0:大小写不敏感且非HEX;1:HEX格式二进制;2:大小写敏感且非HEX',
`user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1',
`user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2',
`user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3',
`user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4',
`user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5',
PRIMARY KEY (`cfg_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@@ -0,0 +1,60 @@
/*
Navicat MariaDB Data Transfer
Source Server : 10.0.6.249
Source Server Version : 100214
Source Host : 10.0.6.249:3306
Source Database : gwall
Target Server Type : MariaDB
Target Server Version : 100214
File Encoding : 65001
Date: 2018-08-20 20:39:54
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for app_ssl_cert_cfg
-- ----------------------------
DROP TABLE IF EXISTS `app_ssl_cert_cfg`;
CREATE TABLE `app_ssl_cert_cfg` (
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`district` varchar(128) NOT NULL,
`cfg_keywords` varchar(1024) NOT NULL,
`app_code` int(11) NOT NULL,
`behav_code` int(11) DEFAULT NULL,
`spec_service_id` varchar(255) NOT NULL COMMENT 'specific_service_cfg .spec_service_id',
`cfg_desc` varchar(128) DEFAULT '',
`action` int(11) NOT NULL COMMENT '1:阻æ­ï¼ˆreject)2ï¼šçæµï¼ˆmonit)5:管控白名单(Control whitelist)6ï¼šçæµç™½åå•ï¼ˆmonit whitelist)7ï¼šç®¡æŽ§çæµéƒ½ç™½åå•ï¼ˆglobal whitelist)',
`is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) åæ¶ˆå®¡æ ¸é€šè¿‡ï¼Œæ­¤å­—段置0',
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3åæ¶ˆå®¡æ ¸é€šè¿‡\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
`creator_id` int(11) NOT NULL COMMENT 'sys_user.id',
`create_time` datetime NOT NULL,
`editor_id` int(11) DEFAULT NULL COMMENT '来自sys_user.id',
`edit_time` datetime DEFAULT NULL,
`auditor_id` int(11) DEFAULT NULL COMMENT '来自sys_user.id',
`audit_time` datetime DEFAULT NULL,
`service_id` int(11) NOT NULL COMMENT '业务id',
`request_id` int(11) NOT NULL COMMENT '来自request_info.id',
`compile_id` int(11) NOT NULL,
`is_area_effective` int(11) NOT NULL DEFAULT 0,
`classify` varchar(128) DEFAULT '',
`attribute` varchar(128) DEFAULT '',
`lable` varchar(128) DEFAULT '',
`area_effective_ids` varchar(1024) DEFAULT '',
`function_id` int(11) NOT NULL,
`ratelimit` int(11) DEFAULT 0 COMMENT '限速比例',
`cfg_type` varchar(64) NOT NULL DEFAULT '',
`cfg_region_code` int(11) NOT NULL,
`expr_type` int(11) NOT NULL DEFAULT 0 COMMENT '0无表达式1与表达式',
`match_method` int(11) NOT NULL DEFAULT 3 COMMENT 'expr_type:0时有意义其它情况必须置0。0子串匹配1右匹配2左匹配3完全匹配',
`is_hexbin` int(11) NOT NULL DEFAULT 0 COMMENT '默认为0:大小写不敏感且非HEX;1:HEX格式二进制;2:大小写敏感且非HEX',
`user_region1` varchar(1024) DEFAULT '' COMMENT '预留自定义域1',
`user_region2` varchar(1024) DEFAULT '' COMMENT '预留自定义域2',
`user_region3` varchar(1024) DEFAULT '' COMMENT '预留自定义域3',
`user_region4` varchar(1024) DEFAULT '' COMMENT '预留自定义域4',
`user_region5` varchar(1024) DEFAULT '' COMMENT '预留自定义域5',
PRIMARY KEY (`cfg_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

View File

@@ -1 +1,3 @@
INSERT INTO function_service_dict (`dict_id`, `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('101', '510', '0', '16', 'reject', '34', 'p2p_reject', NULL, '1', NULL, NULL, NULL, NULL); INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('510', '0', '16', 'reject', '34', 'p2p_reject', NULL, '1', NULL, NULL, NULL, NULL);
INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('520', '0', '1', 'monit', '1029', 'app_ssl_cert_feature_monit', NULL, '1', NULL, NULL, NULL, NULL);
INSERT INTO function_service_dict (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`) VALUES ('530', '0', '1', 'monit', '1031', 'app_header_feature_monit', NULL, '1', NULL, NULL, NULL, NULL);

View File

@@ -0,0 +1,12 @@
UPDATE sys_data_dictionary_name SET REMARK='ddos 攻击类型' WHERE mark='ATTACK_TYPE';
DELETE FROM sys_data_dictionary_item WHERE dictionary_id=99;
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200594,'ICMP_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200595,'IPFRAG_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200596,'SYN_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200597,'ACK_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200598,'RST_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200599,'DNS_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200600,'NTP_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200601,'UDP_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200602,'HTTP_Flood','',0,1,1,99);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(200603,'SSDP_Flood','',0,1,1,99);

View File

@@ -0,0 +1 @@
alter table task_info add do_log int(11) COMMENT 'do_log:0不需要1记录所有日志2只记录结构化日志。默认是2'

View File

@@ -0,0 +1,64 @@
#ip地址
UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND ACTION IN(16,1);
UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND ACTION IN(32,96);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=27;
UPDATE function_region_dict SET config_service_type='ipaddr',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17,1' WHERE dict_id=35;
#ip限流
UPDATE function_service_dict SET region_code=1 WHERE function_id=302 AND ACTION IN(64);
UPDATE function_region_dict SET config_service_type='ratelimit',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=67;
#IP复用策略
UPDATE function_service_dict SET region_code=1 WHERE function_id=300 AND ACTION IN(96);
UPDATE function_region_dict SET config_service_type='ipmulitiplex',config_ip_port_show='1' ,config_ip_type='4,6',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=68;
#IP拦截
UPDATE function_service_dict SET region_code=1 WHERE function_id=200 AND ACTION IN(1,128,64,80);
UPDATE function_region_dict SET config_service_type='ratelimit',config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=53;
#音视频IP
UPDATE function_service_dict SET region_code=2 WHERE function_id=20 AND ACTION IN(1,16);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=17;
#图片IP
UPDATE function_service_dict SET region_code=1 WHERE function_id=21 AND ACTION IN(1,16);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=24;
#APP IP
UPDATE function_service_dict SET region_code=1 WHERE function_id=405 AND ACTION IN(1);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0,6,17' WHERE dict_id=62;
#IP白名单
UPDATE function_service_dict SET region_code=1 WHERE function_id=3 AND ACTION IN(128);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0,6,17' WHERE dict_id=7;
#http ip
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=8 AND ACTION IN(16,1);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=14;
#ssl ip
UPDATE function_service_dict SET region_code='1,2,3,4' WHERE function_id=34 AND ACTION IN(16,1);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=23;
# mail ip
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=35 AND ACTION IN(16,1);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=33;
# ddos ip
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=301 AND ACTION IN(32);
UPDATE function_region_dict SET config_ip_port_show='2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=74;
# ftp ip
UPDATE function_service_dict SET region_code='1,2,3' WHERE function_id=51 AND ACTION IN(1,16);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=38;
# pxy control
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=207 AND ACTION IN(16);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=84;
#pxy redirect
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=208 AND ACTION IN(48);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=90;
#pxy replace
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=209 AND ACTION IN(80);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=96;
#pxy monit
UPDATE function_service_dict SET region_code='1,2,3,4,5,6' WHERE function_id=210 AND ACTION IN(1);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=105;
#pxy whitelist
UPDATE function_service_dict SET region_code='1,2,3' WHERE function_id=211 AND ACTION IN(128);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0',config_protocol='0' WHERE dict_id=101;
#voip ip
UPDATE function_service_dict SET region_code='1,2' WHERE function_id=24 AND ACTION IN(1,16);
UPDATE function_region_dict SET config_ip_port_show='1,2' ,config_ip_type='4,6,46,64,10',config_ip_pattern='1,2,3',config_port_pattern='1,2',config_direction='0,1',config_protocol='0,6,17' WHERE dict_id=8;

View File

@@ -2,4 +2,11 @@
\u4FEE\u6539\u5B57\u5178LOG_STREAM_TYPE\uFF0C\u5C06\u6807\u8BC60\u30011\u30012\u6539\u4E3A1\u30012\u30013 \u4FEE\u6539\u5B57\u5178LOG_STREAM_TYPE\uFF0C\u5C06\u6807\u8BC60\u30011\u30012\u6539\u4E3A1\u30012\u30013
2018-08-03 2018-08-03
\u589E\u52A0\u5B57\u5178ATTACK_TYPE\uFF0C\u4F9D\u636E\u534F\u8BAE\u7EDF\u8BA1\u5DF2\u6709\u7C7B\u578B \uFF1AUDP-Flood: 1069 \uFF0CSYN-Flood: 1070 \u589E\u52A0\u5B57\u5178ATTACK_TYPE\uFF0C\u4F9D\u636E\u534F\u8BAE\u7EDF\u8BA1\u5DF2\u6709\u7C7B\u578B \uFF1AUDP-Flood: 1069 \uFF0CSYN-Flood: 1070
2018-08-20\uFF08do_log:0\u4E0D\u9700\u89811\u8BB0\u5F55\u6240\u6709\u65E5\u5FD72\u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7\u3002\u9ED8\u8BA4\u662F2\uFF09
\u65B0\u589E\u662F\u5426\u8BB0\u5F55\u65E5\u5FD7 DO_LOG
\u6807\u8BC6 \u503C describe \u662F\u5426\u53EF\u7528 \u662F\u5426\u53EF\u7EF4\u62A4
0 no_log \u4E0D\u8BB0\u5F55\u65E5\u5FD7 \u662F \u662F
1 all_log \u8BB0\u5F55\u6240\u6709\u65E5\u5FD7 \u662F \u662F
2 framework_log \u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7