fix(all):清除历史无用日志处理类

This commit is contained in:
doufenghu
2018-08-07 17:56:52 +08:00
parent 24ff953eb5
commit 22854f2d7c
47 changed files with 0 additions and 5543 deletions

View File

@@ -1,230 +0,0 @@
/**
*@Title: DfIpPortUdpController.java
*@Package com.nis.web.controller.restful
*@Description TODO
*@author wx
*@date 2016年9月7日 下午3:58:16
*@version 版本号
*/
package com.nis.web.controller.restful;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.restful.DfIpPortUdp;
import com.nis.domain.restful.DfIpPortUdpSource;
import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfIpPortUdpService;
import com.wordnik.swagger.annotations.ApiOperation;
/**
* @ClassName: DfIpPortUdpController.java
* @Description: TODO
* @author (wx)
* @date 2016年9月7日 下午3:58:16
* @version V1.0
*/
@RestController
//@RequestMapping("${servicePath}/cfg/v1")
public class DfIpPortUdpController extends BaseRestController {
protected final Logger logger = Logger.getLogger(this.getClass());
@Autowired
protected ServicesRequestLogService servicesRequestLogService;
@Autowired
protected DfIpPortUdpService dfIpPortUdpService;
// @Autowired
// protected CommonConfigService commonConfigService;
// @Autowired
// protected RedisDao redisDao;
/**
* saveDfIpPortUdpBatch(多条新增)
* (这里描述这个方法适用条件 可选)
* @param DfIpPortUdpSource
* @param request
* @param response
* @return
*Map
* @exception
* @since 1.0.0
*/
@SuppressWarnings("rawtypes")
@RequestMapping(value = "/dfIpPortUdpSources", method = RequestMethod.POST)
@ApiOperation(value = "保存IP+端口Udp协议G设备封堵配置", httpMethod = "POST", notes = "save ip port udp")
public Map saveDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_POST);
try{
this.chekckData(dfIpPortUdpSource,false);
dfIpPortUdpService.saveDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList());
// commonConfigService.saveOrUpdateConfigState("DF_IP_PORT_UDP", dfIpPortUdpSource.getOpTime());
// redisDao.saveMaps(dfIpPortUdpSource.getDfIpPortUdpList(), "DF_IP_PORT_UDP", DfIpPortUdp.class, "cfgId");
}catch(Exception e){
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if(e instanceof RestServiceException) throw e;
String info=OracleErrorCodeUtil.getOraCode(e);
if(!StringUtil.isEmpty(info))
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
else
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存IP+端口Udp协议G设备封堵配置失败", RestBusinessCode.unknow_error.getValue());
}
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存IP+端口Udp协议G设备封堵配置成功",dfIpPortUdpSource.getDfIpPortUdpList());
}
/**
*
* updateDfIpPortUdpBatch(多条更新)
* (这里描述这个方法适用条件 可选)
* @param DfIpPortUdpSource
* @param request
* @param response
* @return
*Map
* @exception
* @since 1.0.0
*/
@SuppressWarnings("rawtypes")
@RequestMapping(value = "/dfIpPortUdpSources", method = RequestMethod.PUT)
@ApiOperation(value = "更新IP+端口Udp协议G设备封堵配置", httpMethod = "PUT", notes = "update ip port udp")
public Map updateDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_PUT);
try{
this.chekckData(dfIpPortUdpSource,true);
dfIpPortUdpService.updateDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList());
// commonConfigService.saveOrUpdateConfigState("DF_IP_PORT_UDP", dfIpPortUdpSource.getOpTime());
// redisDao.updateMaps(dfIpPortUdpSource.getDfIpPortUdpList(), "DF_IP_PORT_UDP", DfIpPortUdp.class, "cfgId");
}catch(Exception e){
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if(e instanceof RestServiceException) throw e;
String info=OracleErrorCodeUtil.getOraCode(e);
if(!StringUtil.isEmpty(info))
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
else
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新IP+端口Udp协议G设备封堵配置失败", RestBusinessCode.unknow_error.getValue());
}
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新IP+端口Udp协议G设备封堵配置成功",dfIpPortUdpSource.getDfIpPortUdpList());
}
/**
*
* deleteDfIpPortUdp(单条删除)
* (这里描述这个方法适用条件 可选)
* @param id
* @param request
* @param response
* @return
*Map
* @exception
* @since 1.0.0
*/
@SuppressWarnings("rawtypes")
@RequestMapping(value = "/dfIpPortUdpSources/{cfgId}", method = RequestMethod.DELETE)
@ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp")
public Map deleteDfIpPortUdp(@PathVariable("cfgId") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{
dfIpPortUdpService.removeDfIpPortUdp(id);
// commonConfigService.saveOrUpdateConfigState("DF_IP_PORT_UDP", new Date());
}catch(Exception e){
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if(e instanceof RestServiceException) throw e;
String info=OracleErrorCodeUtil.getOraCode(e);
if(!StringUtil.isEmpty(info))
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
else
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除IP+端口Udp协议G设备封堵配置失败", RestBusinessCode.unknow_error.getValue());
}
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
}
/**
*
* deleteDfIpPortUdp(多条删除)
* (这里描述这个方法适用条件 可选)
* @param DfIpPortUdpSource
* @param request
* @param response
* @return
*Map
* @exception
* @since 1.0.0
*/
@SuppressWarnings("rawtypes")
@RequestMapping(value = "/dfIpPortUdpSources", method = RequestMethod.DELETE)
@ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp")
public Map deleteDfIpPortUdp(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_DELETE);
try{
dfIpPortUdpService.removeDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList());
// commonConfigService.saveOrUpdateConfigState("DF_IP_PORT_UDP", dfIpPortUdpSource.getOpTime());
}catch(Exception e){
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if(e instanceof RestServiceException) throw e;
String info=OracleErrorCodeUtil.getOraCode(e);
if(!StringUtil.isEmpty(info))
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
else
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除IP+端口Udp协议G设备封堵配置失败", RestBusinessCode.unknow_error.getValue());
}
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",dfIpPortUdpSource.getDfIpPortUdpList());
}
/**
*
* chekckData(操作验证时间)
* (这里描述这个方法适用条件 可选)
* @param entity
* @return
*boolean
* @exception
* @since 1.0.0
*/
private void chekckData(DfIpPortUdpSource entity,boolean update){
Date now=new Date();
for(DfIpPortUdp dfIpPortUdp :entity.getDfIpPortUdpList()){
dfIpPortUdp.setLastUpdate(now);
if(dfIpPortUdp.getOpTime()==null)
dfIpPortUdp.setOpTime(entity.getOpTime());
if(!update){//新增时判断非空值
if(dfIpPortUdp.getEffectiveRange()==null)dfIpPortUdp.setEffectiveRange("0");
if(dfIpPortUdp.getProtocol()==null)dfIpPortUdp.setProtocol(0);
if(dfIpPortUdp.getDirection()==null)dfIpPortUdp.setDirection(0);
}
}
}
}

View File

@@ -1,91 +0,0 @@
/**
* @Title: DfKeyConvertUrlController.java
* @Package com.nis.web.controller.restful
* @Description: TODO(用一句话描述该文件做什么)
* @author (DDM)
* @date 2016年9月27日 上午10:17:20
* @version V1.0
*/
package com.nis.web.controller.restful;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyConvertUrlService;
import com.wordnik.swagger.annotations.ApiOperation;
/**
*
* @ClassName: DfKeyConvertUrlController
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (DDM)
* @date 2016年9月27日 上午10:17:20
* @version V1.0
*/
@RestController
//@RequestMapping("${servicePath}/log/v1")
@SuppressWarnings({ "rawtypes" })
public class DfKeyConvertUrlController extends BaseRestController{
protected final Logger logger = Logger.getLogger(this.getClass());
@Autowired
protected DfKeyConvertUrlService dfKeyConvertUrlService;
@Autowired
protected ServicesRequestLogService servicesRequestLogService;
protected int logSource = 0;
@RequestMapping(value="/dfKeyConvertUrlSources", method = RequestMethod.GET)
@ApiOperation(value="关键字业务转换URL日志信息获取" , httpMethod = "GET", notes="get log list")
public Map dfKeyConvertUrlSources(
@RequestParam(value = "searchActiveSys", required = false, defaultValue = Constants.ACTIVESYS_B) String searchActiveSys,
Page page, DfKeyConvertUrl dfKeyConvertUrl, HttpServletRequest request,
HttpServletResponse response, Model model) {
if(!Constants.ACTIVESYS_A.equals(searchActiveSys)
&& !Constants.ACTIVESYS_C.equals(searchActiveSys)
) {
searchActiveSys=Constants.ACTIVESYS_B;
}
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null);
//请求参数校验
dfKeyConvertUrlService.queryConditionCheck(thread,start,dfKeyConvertUrl,page);
Page<DfKeyConvertUrl> dfKeyConvertUrlPage = null;
try {
dfKeyConvertUrlPage = dfKeyConvertUrlService.findFlowControlStopPage(new Page<DfKeyConvertUrl>(request, response,DfKeyConvertUrl.class), dfKeyConvertUrl);
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(thread, System.currentTimeMillis() - start, "关键字业务转换URL日志信息检索失败");
}
((RestServiceException) e).setLogSource(logSource);
throw ((RestServiceException) e);
}
return serviceLogResponse(thread, System.currentTimeMillis()-start, request, "关键字业务转换URL日志信息检索成功",dfKeyConvertUrlPage
, logSource);
}
}

View File

@@ -1,93 +0,0 @@
/**
* @Title: dfKeyMailAddController.java
* @Package com.nis.web.controller.restful
* @Description: 关键字业务转换邮件地址日志服务
* @author (ZBC)
* @date 2016年11月09日 下午02:25:00
* @version V1.0
*/
package com.nis.web.controller.restful;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyMailAdd;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyMailAddService;
import com.wordnik.swagger.annotations.ApiOperation;
/**
*
* @ClassName: dfKeyMailAddController
* @Description: 关键字业务转换邮件地址日志服务
* @author (ZBC)
* @date 2016年11月09日 下午02:25:00
* @version V1.0
*/
@RestController
//@RequestMapping("${servicePath}/log/v1")
@SuppressWarnings({ "rawtypes" })
public class DfKeyMailAddController extends BaseRestController {
protected final Logger logger = Logger.getLogger(this.getClass());
@Autowired
protected ServicesRequestLogService servicesRequestLogService;
@Autowired
protected DfKeyMailAddService dfKeyMailAddService;
protected int logSource = 0;
@RequestMapping(value = "/dfKeyMailAddSources", method = RequestMethod.GET)
@ApiOperation(value = "关键字业务转换邮件地址日志信息获取", httpMethod = "GET", notes = "get log list")
public Map dfKeyConvertUrlSources(
@RequestParam(value = "searchActiveSys", required = false, defaultValue = Constants.ACTIVESYS_B) String searchActiveSys,
Page page, DfKeyMailAdd dfKeyMailAdd, HttpServletRequest request,
HttpServletResponse response, Model model) {
if(!Constants.ACTIVESYS_A.equals(searchActiveSys)
&& !Constants.ACTIVESYS_C.equals(searchActiveSys)
) {
searchActiveSys=Constants.ACTIVESYS_B;
}
long start = System.currentTimeMillis();
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
// 请求参数校验
dfKeyMailAddService.queryConditionCheck(thread, start, dfKeyMailAdd, page);
Page<DfKeyMailAdd> dfKeyMailAddPage = null;
try {
dfKeyMailAddPage = dfKeyMailAddService.findDfKeyMailAddPage(
new Page<DfKeyMailAdd>(request, response, DfKeyMailAdd.class), dfKeyMailAdd);
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e.getMessage());
logger.error(e.getCause());
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(thread, System.currentTimeMillis() - start, "关键字业务转换邮件地址日志信息检索失败");
}
((RestServiceException) e).setLogSource(logSource);
throw ((RestServiceException) e);
}
return serviceLogResponse(thread, System.currentTimeMillis() - start, request, "关键字业务转换邮件地址日志信息检索成功",
dfKeyMailAddPage, logSource);
}
}

View File

@@ -1,91 +0,0 @@
/**
* @Title: DjLogSearchController.java
* @Package com.nis.web.controller.restful
* @Description: TODO(用一句话描述该文件做什么)
* @author (zbc)
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
package com.nis.web.controller.restful;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.Page;
import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.IntervalTimeSearchService;
import com.wordnik.swagger.annotations.ApiOperation;
/**
*
* @ClassName: DjLogSearchController
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
@RestController
//@RequestMapping("${servicePath}/log/v1")
@SuppressWarnings({ "rawtypes" })
public class IntervalTimeSearchController extends BaseRestController{
protected final Logger logger = Logger.getLogger(this.getClass());
@Autowired
protected IntervalTimeSearchService timeSearchService;
@Autowired
protected ServicesRequestLogService servicesRequestLogService;
protected Integer logSource = 0;
@RequestMapping(value="/djFlowControlStopSources", method = RequestMethod.GET)
@ApiOperation(value="监测规则流控信息获取" , httpMethod = "GET", notes="get log list")
public Map djFlowControlStopList(
@RequestParam(value = "searchActiveSys", required = false, defaultValue = Constants.ACTIVESYS_B) String searchActiveSys,
Page page, DjFlowControlStop flowControlStop, HttpServletRequest request,
HttpServletResponse response, Model model) {
if (!Constants.ACTIVESYS_A.equals(searchActiveSys)
&& !Constants.ACTIVESYS_C.equals(searchActiveSys)
) {
searchActiveSys=Constants.ACTIVESYS_B;
}
long start=System.currentTimeMillis();
AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null);
//请求参数校验
timeSearchService.queryConditionCheck(thread,start,flowControlStop,page);
Page<DjFlowControlStop> flowControlStopPage = null;
try {
flowControlStopPage = timeSearchService.findFlowControlStopPage(new Page<DjFlowControlStop>(request, response,DjFlowControlStop.class), flowControlStop);
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
e.printStackTrace();
logger.error(e);
if (!(e instanceof RestServiceException)) {
e = new RestServiceException(thread, System.currentTimeMillis() - start, "监测规则流控信息检索失败");
}
((RestServiceException) e).setLogSource(logSource);
throw ((RestServiceException) e);
}
return serviceLogResponse(thread, System.currentTimeMillis()-start,request, "监测规则流控信息检索成功", flowControlStopPage
, logSource);
}
}

View File

@@ -1,20 +0,0 @@
package com.nis.web.dao;
import com.nis.domain.restful.DfIpPortUdp;
import com.nis.domain.restful.JdjInfo;
/**
* @ClassName: JdjInfoDao.java
* @Description: TODO
* @author (dell)
* @date 2016年9月9日 上午10:02:33
* @version V1.0
*/
@MyBatisDao
public interface DfIpPortUdpDao extends CrudDao<DfIpPortUdp>{
int delete(long id);
int insert(DfIpPortUdp record);
int update(DfIpPortUdp record);
}

View File

@@ -1,240 +0,0 @@
<?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.DfIpPortUdpDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.DfIpPortUdp">
<id column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="ADDR_TYPE" jdbcType="INTEGER" property="addrType" />
<result column="SRC_IP" jdbcType="VARCHAR" property="srcIp" />
<result column="MASK_SRC_IP" jdbcType="VARCHAR" property="maskSrcIp" />
<result column="SRC_PORT" jdbcType="VARCHAR" property="srcPort" />
<result column="MASK_SRC_PORT" jdbcType="VARCHAR" property="maskSrcPort" />
<result column="DST_IP" jdbcType="VARCHAR" property="dstIp" />
<result column="MASK_DST_IP" jdbcType="VARCHAR" property="maskDstIp" />
<result column="DST_PORT" jdbcType="VARCHAR" property="dstPort" />
<result column="MASK_DST_PORT" jdbcType="VARCHAR" property="maskDstPort" />
<result column="PROTOCOL" jdbcType="INTEGER" property="protocol" />
<result column="DIRECTION" jdbcType="INTEGER" property="direction" />
<result column="IS_VALID" jdbcType="INTEGER" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result property="lastUpdate" column="LAST_UPDATE"/>
<result property="effectiveRange" column="EFFECTIVE_RANGE"/>
<result property="activeSys" column="ACTIVE_SYS"/>
</resultMap>
<sql id="Base_Column_List">
CFG_ID, ADDR_TYPE, SRC_IP, MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT, DST_IP, MASK_DST_IP,
DST_PORT, MASK_DST_PORT, PROTOCOL, DIRECTION, IS_VALID, OP_TIME,lastUpdate,effectiveRange,activeSys
</sql>
<!--
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from DF_IP_PORT_UDP
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
-->
<delete id="delete" parameterType="java.lang.Long">
delete from DF_IP_PORT_UDP
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</delete>
<!--
<insert id="insert" parameterType="com.nis.domain.restful.DfIpPortUdp">
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="id">
SELECT SEQ_DF_IP_PORT_UDP.Nextval as ID from DUAL
</selectKey>
insert into DF_IP_PORT_UDP (CFG_ID, ADDR_TYPE, SRC_IP,
MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT,
DST_IP, MASK_DST_IP, DST_PORT,
MASK_DST_PORT, PROTOCOL, DIRECTION,
IS_VALID, OP_TIME)
values (#{id,jdbcType=BIGINT}, #{addrType,jdbcType=INTEGER}, #{srcIp,jdbcType=VARCHAR},
#{maskSrcIp,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR}, #{maskSrcPort,jdbcType=VARCHAR},
#{dstIp,jdbcType=VARCHAR}, #{maskDstIp,jdbcType=VARCHAR}, #{dstPort,jdbcType=VARCHAR},
#{maskDstPort,jdbcType=VARCHAR}, #{protocol,jdbcType=INTEGER}, #{direction,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER}, #{opTime,jdbcType=TIMESTAMP})
</insert>
-->
<insert id="insert" parameterType="com.nis.domain.restful.DfIpPortUdp">
<!--
<selectKey resultType="java.lang.Long" order="BEFORE" keyProperty="cfgId">
SELECT SEQ_DF_IP_PORT_UDP.Nextval as ID from DUAL
</selectKey>
-->
insert into DF_IP_PORT_UDP
<trim prefix="(" suffix=")" suffixOverrides=",">
CFG_ID,
<if test="addrType != null">
ADDR_TYPE,
</if>
<if test="srcIp != null">
SRC_IP,
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP,
</if>
<if test="srcPort != null">
SRC_PORT,
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT,
</if>
<if test="dstIp != null">
DST_IP,
</if>
<if test="maskDstIp != null">
MASK_DST_IP,
</if>
<if test="dstPort != null">
DST_PORT,
</if>
<if test="maskDstPort != null">
MASK_DST_PORT,
</if>
<if test="protocol != null">
PROTOCOL,
</if>
<if test="direction != null">
DIRECTION,
</if>
<if test="isValid != null">
IS_VALID,
</if>
<if test="opTime != null">
OP_TIME,
</if>
<if test="opTime != null">
LAST_UPDATE,
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE,
</if>
<if test="activeSys != null">
ACTIVE_SYS,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{cfgId,jdbcType=BIGINT},
<if test="addrType != null">
#{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
#{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
#{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
#{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
#{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
#{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
#{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
#{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
#{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
#{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
#{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
#{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
#{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="effectiveRange != null">
#{effectiveRange,jdbcType=VARCHAR},
</if>
<if test="activeSys != null">
#{activeSys,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="update" parameterType="com.nis.domain.restful.DfIpPortUdp">
update DF_IP_PORT_UDP
<set>
<if test="addrType != null">
ADDR_TYPE = #{addrType,jdbcType=INTEGER},
</if>
<if test="srcIp != null">
SRC_IP = #{srcIp,jdbcType=VARCHAR},
</if>
<if test="maskSrcIp != null">
MASK_SRC_IP = #{maskSrcIp,jdbcType=VARCHAR},
</if>
<if test="srcPort != null">
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
</if>
<if test="maskSrcPort != null">
MASK_SRC_PORT = #{maskSrcPort,jdbcType=VARCHAR},
</if>
<if test="dstIp != null">
DST_IP = #{dstIp,jdbcType=VARCHAR},
</if>
<if test="maskDstIp != null">
MASK_DST_IP = #{maskDstIp,jdbcType=VARCHAR},
</if>
<if test="dstPort != null">
DST_PORT = #{dstPort,jdbcType=VARCHAR},
</if>
<if test="maskDstPort != null">
MASK_DST_PORT = #{maskDstPort,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
PROTOCOL = #{protocol,jdbcType=INTEGER},
</if>
<if test="direction != null">
DIRECTION = #{direction,jdbcType=INTEGER},
</if>
<if test="isValid != null">
IS_VALID = #{isValid,jdbcType=INTEGER},
</if>
<if test="opTime != null">
OP_TIME = #{opTime,jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE = #{lastUpdate,jdbcType=TIMESTAMP},
</if>
<if test="effectiveRange != null">
EFFECTIVE_RANGE=#{effectiveRange,jdbcType=VARCHAR},
</if>
<if test="activeSys != null">
ACTIVE_SYS=#{activeSys,jdbcType=INTEGER},
</if>
</set>
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</update>
<!--
<update id="updateByPrimaryKey" parameterType="com.nis.domain.restful.DfIpPortUdp">
update DF_IP_PORT_UDP
set ADDR_TYPE = #{addrType,jdbcType=INTEGER},
SRC_IP = #{srcIp,jdbcType=VARCHAR},
MASK_SRC_IP = #{maskSrcIp,jdbcType=VARCHAR},
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
MASK_SRC_PORT = #{maskSrcPort,jdbcType=VARCHAR},
DST_IP = #{dstIp,jdbcType=VARCHAR},
MASK_DST_IP = #{maskDstIp,jdbcType=VARCHAR},
DST_PORT = #{dstPort,jdbcType=VARCHAR},
MASK_DST_PORT = #{maskDstPort,jdbcType=VARCHAR},
PROTOCOL = #{protocol,jdbcType=INTEGER},
DIRECTION = #{direction,jdbcType=INTEGER},
IS_VALID = #{isValid,jdbcType=INTEGER},
OP_TIME = #{opTime,jdbcType=TIMESTAMP}
where CFG_ID = #{cfgId,jdbcType=BIGINT}
</update>
-->
</mapper>

View File

@@ -1,28 +0,0 @@
/**
* @Title: DfKeyConvertUrlDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author DDM
* @date 2016年9月27日下午9:59:58
* @version V1.0
*/
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.domain.restful.DjFlowControlStop;
/**
* @ClassName: DfKeyConvertUrlDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author DDM
* @date 2016年9月27日下午9:59:58
* @version V1.0
*/
@MyBatisDao
public interface DfKeyConvertUrlDao extends CrudDao<Serializable>{
List<DfKeyConvertUrl> findDfKeyConvertUrlPage(DfKeyConvertUrl entity);
}

View File

@@ -1,44 +0,0 @@
<?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.DfKeyConvertUrlDao">
<!-- DJ_FLOWCONTROL_STOP -->
<sql id="dfKeyConvertUrlProperty">
ID,KEY_ID,URL,OP_TIME
</sql>
<resultMap id="DfKeyConvertUrlMap" type="com.nis.domain.restful.DfKeyConvertUrl">
<result column="id" jdbcType="INTEGER" property="id" />
<result column="key_id" jdbcType="INTEGER" property="keyId" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findDfKeyConvertUrlPage" parameterType="com.nis.domain.restful.DfKeyConvertUrl" resultMap="DfKeyConvertUrlMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dfKeyConvertUrlProperty"/>
</otherwise>
</choose>
FROM DF_KEY_CONVERT_URL
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchId != null and searchId !=''">
AND id > ${searchId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,20 +0,0 @@
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DfKeyMailAdd;
/**
* @ClassName: DfKeyMailAddDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ZBC)
* @date 2016年11月09日 下午02:25:00
* @version V1.0
*/
@MyBatisDao
public interface DfKeyMailAddDao extends CrudDao<Serializable> {
List<DfKeyMailAdd> findDfKeyMailAddPage(DfKeyMailAdd entity);
}

View File

@@ -1,45 +0,0 @@
<?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.DfKeyMailAddDao">
<!-- DF_KEY_MAIL_ADDR -->
<sql id="dfKeyMailAddProperty">
ID,KEY_ID,MAIL_ADDR,OP_TIME
</sql>
<resultMap id="DfKeyMailAddMap" type="com.nis.domain.restful.DfKeyMailAdd">
<result column="id" jdbcType="INTEGER" property="id" />
<result column="key_id" jdbcType="INTEGER" property="keyId" />
<result column="mail_addr" jdbcType="VARCHAR" property="mailAddr" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findDfKeyMailAddPage" parameterType="com.nis.domain.restful.DfKeyMailAdd"
resultMap="DfKeyMailAddMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="dfKeyMailAddProperty"/>
</otherwise>
</choose>
FROM DF_KEY_MAIL_ADDR
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="searchId != null and searchId !=''">
AND id > ${searchId}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,64 +0,0 @@
/**
* @Title: DjLogSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author zbc
* @date 2016年9月7日 下午2:32:25
* @version V1.0
*/
package com.nis.web.dao;
import java.util.List;
import com.nis.domain.LogEntity;
import com.nis.domain.restful.DjDnsLog;
import com.nis.domain.restful.DjFtpLog;
import com.nis.domain.restful.DjHttpKeywordLog;
import com.nis.domain.restful.DjHttpReqLog;
import com.nis.domain.restful.DjHttpResLog;
import com.nis.domain.restful.DjIpPortLog;
import com.nis.domain.restful.DjIpsecLog;
import com.nis.domain.restful.DjL2tpLog;
import com.nis.domain.restful.DjMailLog;
import com.nis.domain.restful.DjOpenvpnLog;
import com.nis.domain.restful.DjPptpLog;
import com.nis.domain.restful.DjSshLog;
import com.nis.domain.restful.DjSslLog;
/**
* @ClassName: DjLogSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月7日 下午2:32:25
* @version V1.0
*/
@MyBatisDao
@SuppressWarnings("rawtypes")
public interface DjLogSearchDao extends CrudDao<LogEntity>{
List<DjIpPortLog> findIpPortLogs(DjIpPortLog log);
List<DjHttpReqLog> findHttpReqLogs(DjHttpReqLog log);
List<DjHttpResLog> findHttpResLogs(DjHttpResLog log);
List<DjHttpKeywordLog> findHttpKeywordLogs(DjHttpKeywordLog log);
List<DjMailLog> findMailLogs(DjMailLog log);
List<DjDnsLog> findDnsLogs(DjDnsLog log);
List<DjFtpLog> findFtpLogs(DjFtpLog log);
List<DjPptpLog> findPptpLogs(DjPptpLog log);
List<DjL2tpLog> findL2tpLogs(DjL2tpLog log);
List<DjIpsecLog> findIpsecLogs(DjIpsecLog log);
List<DjOpenvpnLog> findOpenvpnLogs(DjOpenvpnLog log);
List<DjSshLog> findSshLogs(DjSshLog log);
List<DjSslLog> findSslLogs(DjSslLog log);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +0,0 @@
/**
* @Title: IntervalTimeSearchDao.java
* @Package com.nis.web.dao
* @Description: TODO(用一句话描述该文件做什么)
* @author zbc
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
package com.nis.web.dao;
import java.io.Serializable;
import java.util.List;
import com.nis.domain.restful.DjFlowControlStop;
/**
* @ClassName: IntervalTimeSearchDao
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
@MyBatisDao
public interface IntervalTimeSearchDao extends CrudDao<Serializable>{
List<DjFlowControlStop> findFlowControlStopPage(DjFlowControlStop entity);
}

View File

@@ -1,44 +0,0 @@
<?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.IntervalTimeSearchDao">
<!-- DJ_FLOWCONTROL_STOP -->
<sql id="flowControlStopProperty">
CFG_ID,SERVICE,ACTION,OP_TIME
</sql>
<resultMap id="DjFlowControlStopMap" type="com.nis.domain.restful.DjFlowControlStop">
<result column="CFG_ID" jdbcType="BIGINT" property="cfgId" />
<result column="service" jdbcType="INTEGER" property="service" />
<result column="action" jdbcType="INTEGER" property="action" />
<result column="op_time" jdbcType="TIMESTAMP" property="opTime" />
</resultMap>
<select id="findFlowControlStopPage" parameterType="com.nis.domain.restful.DjFlowControlStop" resultMap="DjFlowControlStopMap">
SELECT
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>
<include refid="flowControlStopProperty"/>
</otherwise>
</choose>
FROM DJ_FLOWCONTROL_STOP
<where>
<if test="optStartTime != null and optStartTime !=''">
<![CDATA[AND OP_TIME >= to_date(#{optStartTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<if test="optEndTime != null and optEndTime !=''">
<![CDATA[AND OP_TIME < to_date(#{optEndTime},'yyyy-MM-dd HH24:mi:ss')]]>
</if>
<!-- <if test="searchCfgId != null and searchCfgId !=''">
AND cfg_id =${searchCfgId}
</if> -->
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
</choose>
</select>
</mapper>

View File

@@ -1,46 +0,0 @@
/**
*@Title: DfIpPortUdpService.java
*@Package com.nis.web.service.restful
*@Description TODO
*@author wx
*@date 2016年9月7日 下午3:28:44
*@version 版本号
*/
package com.nis.web.service.restful;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.Page;
import com.nis.domain.restful.DfIpPortUdp;
import com.nis.web.dao.DfIpPortUdpDao;
import com.nis.web.service.CrudService;
/**
* @ClassName: DfIpPortUdpService.java
* @Description: TODO
* @author (wx)
* @date 2016年9月7日 下午3:28:44
* @version V1.0
*/
@Service
public class DfIpPortUdpService extends CrudService<DfIpPortUdpDao, DfIpPortUdp> {
@Autowired
public DfIpPortUdpDao dfIpPortUdpDao;
public void saveDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
// TODO Auto-generated method stub
super.saveBatch(entity,DfIpPortUdpDao.class);
}
public void updateDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
// TODO Auto-generated method stub
super.updateBatch(entity, DfIpPortUdpDao.class);
}
public void removeDfIpPortUdp(long id) {
dfIpPortUdpDao.delete(id);
}
public void removeDfIpPortUdpBatch(List<DfIpPortUdp> entity) {
super.deleteBatch(entity, DfIpPortUdpDao.class);
}
}

View File

@@ -1,111 +0,0 @@
package com.nis.web.service.restful;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyConvertUrlDao;
import com.nis.web.service.BaseLogService;
import com.nis.web.service.AuditLogThread;
/**
* @ClassName: DfKeyConvertUrlService
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (DDM)
* @date 2016年9月27日上午10:12:58
* @version V1.0
*/
@Service
public class DfKeyConvertUrlService extends BaseLogService {
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
protected final Logger logger = Logger.getLogger(this.getClass());
/**
* 持久层对象
*/
@Autowired
protected DfKeyConvertUrlDao dao;
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
*/
public Page<DfKeyConvertUrl> findFlowControlStopPage(Page<DfKeyConvertUrl> page,
DfKeyConvertUrl entity) {
entity.setPage(page);
page.setList(dao.findDfKeyConvertUrlPage(entity));
return page;
}
/**
* 关键字业务转换url查询条件检查
* wx
* @param entity
*/
public void queryConditionCheck(AuditLogThread thread, long start, DfKeyConvertUrl entity, Page page) {
try {
if (!StringUtil.isBlank(entity.getSearchId())) {
Long.parseLong(entity.getSearchId());
}
} catch (NumberFormatException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数格式错误",
RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数错误");
}
try {
if (!StringUtil.isBlank(entity.getOptStartTime())) {
sdf.parse(entity.getOptStartTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
}
try {
if (!StringUtil.isBlank(entity.getOptEndTime())) {
sdf.parse(entity.getOptEndTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
}
try {
checkCloumnIsExist(thread,start,DfKeyConvertUrl.class, page);
} catch (RestServiceException e) {
logger.error(e);
throw e;
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
}
}
}

View File

@@ -1,107 +0,0 @@
package com.nis.web.service.restful;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyMailAdd;
import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyMailAddDao;
import com.nis.web.service.BaseLogService;
import com.nis.web.service.AuditLogThread;
/**
* @ClassName: DfKeyMailAddService
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (ZBC)
* @date 2016年11月09日 下午02:25:00
* @version V1.0
*/
@Service
@SuppressWarnings({ "rawtypes" })
public class DfKeyMailAddService extends BaseLogService {
protected final Logger logger = Logger.getLogger(this.getClass());
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
protected DfKeyMailAddDao dao;
public Page<DfKeyMailAdd> findDfKeyMailAddPage(Page<DfKeyMailAdd> page, DfKeyMailAdd entity) {
entity.setPage(page);
page.setList(dao.findDfKeyMailAddPage(entity));
return page;
}
/**
* 查询条件检查
*/
public void queryConditionCheck(AuditLogThread thread, long start, DfKeyMailAdd entity, Page page) {
try {
if (!StringUtil.isBlank(entity.getSearchId())) {
Long.parseLong(entity.getSearchId());
}
} catch (NumberFormatException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数格式错误",
RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchId参数错误");
}
try {
if (!StringUtil.isBlank(entity.getOptStartTime())) {
sdf.parse(entity.getOptStartTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
}
try {
if (!StringUtil.isBlank(entity.getOptEndTime())) {
sdf.parse(entity.getOptEndTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
}
try {
checkCloumnIsExist(thread,start,DfKeyMailAdd.class, page);
} catch (RestServiceException e) {
logger.error(e);
throw e;
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
}
}
}

View File

@@ -1,379 +0,0 @@
package com.nis.web.service.restful;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.Page;
import com.nis.domain.restful.DjDnsLog;
import com.nis.domain.restful.DjFtpLog;
import com.nis.domain.restful.DjHttpKeywordLog;
import com.nis.domain.restful.DjHttpReqLog;
import com.nis.domain.restful.DjHttpResLog;
import com.nis.domain.restful.DjIpPortLog;
import com.nis.domain.restful.DjIpsecLog;
import com.nis.domain.restful.DjL2tpLog;
import com.nis.domain.restful.DjMailLog;
import com.nis.domain.restful.DjOpenvpnLog;
import com.nis.domain.restful.DjPptpLog;
import com.nis.domain.restful.DjSshLog;
import com.nis.domain.restful.DjSslLog;
import com.nis.util.Constants;
import com.nis.web.dao.DjLogSearchDao;
import com.nis.web.service.BaseLogService;
/**
* @ClassName: DjLogSearchService
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月7日 上午11:15:12
* @version V1.0
*/
@Service
public class DjLogSearchService extends BaseLogService {
/**
* 持久层对象
*/
@Autowired
protected DjLogSearchDao dao;
/**
* 查询端口封堵分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjIpPortLog> findIpPortPage(Page<DjIpPortLog> page, DjIpPortLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjIpPortLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findIpPortLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjHttpResLog> findHttpResPage(Page<DjHttpResLog> page, DjHttpResLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjHttpResLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findHttpResLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param httpReqLog
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjHttpReqLog> findHttpReqPage(Page<DjHttpReqLog> page, DjHttpReqLog httpReqLog,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
httpReqLog.setPage(page);
if(Constants.IS_USE_ES){
List<DjHttpReqLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, httpReqLog,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findHttpReqLogs(httpReqLog));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjHttpKeywordLog> findHttpKeywordPage(Page<DjHttpKeywordLog> page, DjHttpKeywordLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjHttpKeywordLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findHttpKeywordLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjHttpKeywordLog> findHttpMultiPartPage(Page<DjHttpKeywordLog> page, DjHttpKeywordLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjHttpKeywordLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findHttpKeywordLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjMailLog> findMailPage(Page<DjMailLog> page, DjMailLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjMailLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findMailLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjDnsLog> findDnsPage(Page<DjDnsLog> page, DjDnsLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjDnsLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findDnsLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjFtpLog> findFtpPage(Page<DjFtpLog> page, DjFtpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjFtpLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findFtpLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjPptpLog> findPptpPage(Page<DjPptpLog> page, DjPptpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjPptpLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findPptpLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjL2tpLog> findL2tpPage(Page<DjL2tpLog> page, DjL2tpLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjL2tpLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findL2tpLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjIpsecLog> findIpsecPage(Page<DjIpsecLog> page, DjIpsecLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjIpsecLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findIpsecLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjOpenvpnLog> findOpenvpnPage(Page<DjOpenvpnLog> page, DjOpenvpnLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjOpenvpnLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findOpenvpnLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjSshLog> findSshPage(Page<DjSshLog> page, DjSshLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjSshLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findSshLogs(entity));
}
return page;
}
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
* @throws IOException
* @throws JSONException
* @throws ParseException
* @throws ClientProtocolException
* @throws IllegalAccessException
* @throws IllegalArgumentException
*/
public Page<DjSslLog> findSslPage(Page<DjSslLog> page, DjSslLog entity,String activeSys) throws IllegalArgumentException, IllegalAccessException, ClientProtocolException, ParseException, JSONException, IOException {
entity.setPage(page);
if(Constants.IS_USE_ES){
List<DjSslLog> resultList=new ArrayList<>();
elasticsearchSqlDao.findLogs(resultList, entity,activeSys);
page.setList(resultList);
}else{
page.setList(dao.findSslLogs(entity));
}
return page;
}
}

View File

@@ -1,109 +0,0 @@
package com.nis.web.service.restful;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nis.domain.Page;
import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil;
import com.nis.web.dao.IntervalTimeSearchDao;
import com.nis.web.service.BaseLogService;
/**
* @ClassName: IntervalTimeSearchService
* @Description: TODO(这里用一句话描述这个类的作用)
* @author (zbc)
* @date 2016年9月8日下午8:11:58
* @version V1.0
*/
@Service
public class IntervalTimeSearchService extends BaseLogService {
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
protected final Logger logger = Logger.getLogger(this.getClass());
/**
* 持久层对象
*/
@Autowired
protected IntervalTimeSearchDao dao;
/**
* 查询分页数据
* @param page 分页对象
* @param entity
* @return
*/
public Page<DjFlowControlStop> findFlowControlStopPage(Page<DjFlowControlStop> page,
DjFlowControlStop entity) {
entity.setPage(page);
page.setList(dao.findFlowControlStopPage(entity));
return page;
}
/**
* 流控日志查询条件检查
* wx
* @param entity
*/
public void queryConditionCheck(AuditLogThread thread, long start, DjFlowControlStop entity, Page page) {
/*try {
if (!StringUtil.isBlank(entity.getSearchCfgId())) {
Long.parseLong(entity.getSearchCfgId());
}
} catch (NumberFormatException e) {
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchCfgId参数格式错误",
RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "searchCfgId参数错误");
}*/
try {
if (!StringUtil.isBlank(entity.getOptStartTime())) {
sdf.parse(entity.getOptStartTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optStartTime参数格式错误");
}
try {
if (!StringUtil.isBlank(entity.getOptEndTime())) {
sdf.parse(entity.getOptEndTime());
}
} catch (ParseException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数格式错误", RestBusinessCode.param_formate_error.getValue());
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread,System.currentTimeMillis()-start,"optEndTime参数错误");
}
try {
checkCloumnIsExist(thread,start,DjFlowControlStop.class, page);
} catch (RestServiceException e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw e;
} catch (Exception e) {
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
logger.error(e);
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求参数错误");
}
}
}