fix(all):细节和语义修正

This commit is contained in:
doufenghu
2018-07-19 10:19:57 +08:00
parent b55bad8343
commit 6ee382738a
33 changed files with 665 additions and 683 deletions

View File

@@ -34,7 +34,7 @@ public class ConfigSource extends ConfigCommonSource{
/** /**
* @Title: * @Title:
* @Description: TODO * @Description: TODO
* @param 入参 * @param
*/ */
public ConfigSource() { public ConfigSource() {
this.version = DEFAULT_VERSION; this.version = DEFAULT_VERSION;

View File

@@ -1,9 +1,8 @@
package com.nis.restful; package com.nis.restful;
import com.nis.web.service.AuditLogThread;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import com.nis.web.service.SaveRequestLogThread;
public class RestServiceException extends RuntimeException{ public class RestServiceException extends RuntimeException{
private int errorCode; private int errorCode;
@@ -25,7 +24,7 @@ public class RestServiceException extends RuntimeException{
// super(message); // super(message);
// this.errorCode = 998; //未知错误 // this.errorCode = 998; //未知错误
// } // }
public RestServiceException(SaveRequestLogThread thread,long time,String message) { public RestServiceException(AuditLogThread thread, long time, String message) {
super(message); super(message);
this.errorCode = 998; //未知错误 this.errorCode = 998; //未知错误
this.traceCode = thread.getTraceCode(); this.traceCode = thread.getTraceCode();
@@ -42,7 +41,7 @@ public class RestServiceException extends RuntimeException{
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
} }
public RestServiceException(SaveRequestLogThread thread,long time,String message,int errorCode) { public RestServiceException(AuditLogThread thread, long time, String message, int errorCode) {
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
this.traceCode = thread.getTraceCode(); this.traceCode = thread.getTraceCode();

View File

@@ -5,7 +5,7 @@ import java.util.Map;
import com.nis.restful.RestBusinessCode; import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
public class OracleErrorCodeUtil { public class OracleErrorCodeUtil {
/** /**
@@ -34,7 +34,7 @@ public class OracleErrorCodeUtil {
* 根据错误码抛出对应的异常,case内容为空的时候会按照下个case的异常内容来抛出异常修改时请注意 * 根据错误码抛出对应的异常,case内容为空的时候会按照下个case的异常内容来抛出异常修改时请注意
*/ */
public static void throwExceptionInfo(SaveRequestLogThread thread, long time, String errorCode) { public static void throwExceptionInfo(AuditLogThread thread, long time, String errorCode) {
switch (errorCode) { switch (errorCode) {

View File

@@ -17,6 +17,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@@ -31,7 +32,6 @@ import com.nis.restful.RestResult;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DateUtils; import com.nis.util.DateUtils;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
/** /**
@@ -63,8 +63,8 @@ public class BaseRestController {
* @version V1.0 * @version V1.0
*/ */
public Map serviceResponse(SaveRequestLogThread thread, long time, HttpServletRequest request, public Map serviceResponse(AuditLogThread thread, long time, HttpServletRequest request,
HttpServletResponse response, String msg) { HttpServletResponse response, String msg) {
RestResult restResult = new RestResult(); RestResult restResult = new RestResult();
String requestMethod = request.getMethod(); String requestMethod = request.getMethod();
if (requestMethod.equals(RequestMethod.GET.name())) { if (requestMethod.equals(RequestMethod.GET.name())) {
@@ -109,8 +109,8 @@ public class BaseRestController {
* 2016年8月24日 下午8:40:44 * 2016年8月24日 下午8:40:44
* @version V1.0 * @version V1.0
*/ */
public Map serviceResponse(SaveRequestLogThread thread, long time, HttpServletRequest request, public Map serviceResponse(AuditLogThread thread, long time, HttpServletRequest request,
HttpServletResponse response, String msg, Object data) { HttpServletResponse response, String msg, Object data) {
RestResult restResult = new RestResult(); RestResult restResult = new RestResult();
String requestMethod = request.getMethod(); String requestMethod = request.getMethod();
if (requestMethod.equals(RequestMethod.GET.name())) { if (requestMethod.equals(RequestMethod.GET.name())) {
@@ -191,8 +191,8 @@ public class BaseRestController {
* 2016年8月24日 下午8:40:44 * 2016年8月24日 下午8:40:44
* @version V1.0 * @version V1.0
*/ */
public Map compileServiceResponse(SaveRequestLogThread thread, long time, HttpServletRequest request, public Map compileServiceResponse(AuditLogThread thread, long time, HttpServletRequest request,
HttpServletResponse response, String msg, Object data) { HttpServletResponse response, String msg, Object data) {
RestResult restResult = new RestResult(); RestResult restResult = new RestResult();
String requestMethod = request.getMethod(); String requestMethod = request.getMethod();
if (requestMethod.equals(RequestMethod.GET.name())) { if (requestMethod.equals(RequestMethod.GET.name())) {
@@ -229,7 +229,7 @@ public class BaseRestController {
* @param logSource * @param logSource
* @return * @return
*/ */
public Map serviceLogResponse(SaveRequestLogThread auditLogThread, long executedTime, HttpServletRequest request, public Map serviceLogResponse(AuditLogThread auditLogThread, long executedTime, HttpServletRequest request,
String msg, Object data, Integer logSource) { String msg, Object data, Integer logSource) {
RestResult restResult = new RestResult(); RestResult restResult = new RestResult();
String requestMethod = request.getMethod(); String requestMethod = request.getMethod();
@@ -314,7 +314,7 @@ public class BaseRestController {
* @exception @since * @exception @since
* 1.0.0 * 1.0.0
*/ */
public void checkOpAction(SaveRequestLogThread thread, long time, int opAction, int need) { public void checkOpAction(AuditLogThread thread, long time, int opAction, int need) {
if (need != opAction) { if (need != opAction) {
switch (need) { switch (need) {
case Constants.OPACTION_POST: case Constants.OPACTION_POST:
@@ -338,7 +338,7 @@ public class BaseRestController {
+ ",对应的请求方式为" + convertOpAction(opAction) + "!", + ",对应的请求方式为" + convertOpAction(opAction) + "!",
RestBusinessCode.op_action_error.getValue()); RestBusinessCode.op_action_error.getValue());
default: default:
throw new RestServiceException(thread, time, "操作行为错误,未找到对应的服务!", throw new RestServiceException(thread, time, "操作行为错误,未找到属性opAction对应业务!",
RestBusinessCode.op_action_error.getValue()); RestBusinessCode.op_action_error.getValue());
} }
} }
@@ -359,10 +359,10 @@ public class BaseRestController {
} }
} }
protected SaveRequestLogThread saveRequestLog(ServicesRequestLogService service, int opAction, protected AuditLogThread saveRequestLog(ServicesRequestLogService service, int opAction,
HttpServletRequest request, Object data) { HttpServletRequest request, Object data) {
logger.debug("SaveRequestLogThread初始化开始----" + System.currentTimeMillis()); logger.debug("SaveRequestLogThread初始化开始----" + System.currentTimeMillis());
SaveRequestLogThread thread = SaveRequestLogThread.getNewSaveRequestLogThread(request); AuditLogThread thread = AuditLogThread.getNewSaveRequestLogThread(request);
thread.setService(service); thread.setService(service);
thread.setOpAction(opAction); thread.setOpAction(opAction);
thread.setTraceCode(sdf.format(new Date())+(Math.round((Math.random()*9+1)*10000)+"")); thread.setTraceCode(sdf.format(new Date())+(Math.round((Math.random()*9+1)*10000)+""));
@@ -381,9 +381,9 @@ public class BaseRestController {
} }
// 文件上传用 // 文件上传用
protected SaveRequestLogThread saveRequestLog(ServicesRequestLogService service, int opAction, protected AuditLogThread saveRequestLog(ServicesRequestLogService service, int opAction,
HttpServletRequest request, Object data, Object fileInfo) { HttpServletRequest request, Object data, Object fileInfo) {
SaveRequestLogThread thread = SaveRequestLogThread.getNewSaveRequestLogThread(request); AuditLogThread thread = AuditLogThread.getNewSaveRequestLogThread(request);
thread.setService(service); thread.setService(service);
// thread.setContent(fileInfo); // thread.setContent(fileInfo);
thread.setOpAction(opAction); thread.setOpAction(opAction);

View File

@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -27,7 +28,6 @@ import com.nis.util.Constants;
import com.nis.util.MD5Utils; import com.nis.util.MD5Utils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.wordnik.swagger.annotations.Api; import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -63,7 +63,7 @@ public class ConfigFileController extends BaseRestController {
"opTime:"+configFile.getOpTime() "opTime:"+configFile.getOpTime()
); );
JSONArray fileArray=new JSONArray(); JSONArray fileArray=new JSONArray();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, configFile,fileArray); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, configFile,fileArray);
String serviceDir=request.getRealPath("upload"); String serviceDir=request.getRealPath("upload");
try { try {
MultipartFile[] files=configFile.getFiles(); MultipartFile[] files=configFile.getFiles();
@@ -116,7 +116,7 @@ public class ConfigFileController extends BaseRestController {
HttpServletResponse response){ HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
JSONObject fileObject=new JSONObject(); JSONObject fileObject=new JSONObject();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, fileObject); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, fileObject);
BufferedInputStream bis = null; BufferedInputStream bis = null;
BufferedOutputStream bos = null; BufferedOutputStream bos = null;
String downLoadPath=null; String downLoadPath=null;

View File

@@ -15,7 +15,7 @@ import com.nis.domain.restful.ConfigPzIdSource;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.ConfigPzIdService; import com.nis.web.service.restful.ConfigPzIdService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -37,7 +37,7 @@ public class ConfigPzIdController extends BaseRestController {
public Map configPzIdSources(ConfigPzIdSource configPzIdSource, HttpServletRequest request, public Map configPzIdSources(ConfigPzIdSource configPzIdSource, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
configPzIdSource); configPzIdSource);
try { try {

View File

@@ -10,6 +10,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -30,7 +31,6 @@ import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.StringUtils; import com.nis.util.StringUtils;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.fdfs.FastDFSFile; import com.nis.web.service.fdfs.FastDFSFile;
import com.nis.web.service.fdfs.FileManager; import com.nis.web.service.fdfs.FileManager;
@@ -52,7 +52,7 @@ import net.sf.json.JSONObject;
// @Scope("prototype") // @Scope("prototype")
@RestController @RestController
@RequestMapping("${servicePath}") @RequestMapping("${servicePath}")
@Api(value = "ConfigSourcesController", description = "配置存储服务,包括管控、监测、白名单的控制类") @Api(value = "ConfigSourcesController", description = "配置规则服务,主要对MAAT规则和回调规则做解析、存储与更新操作")
public class ConfigSourcesController extends BaseRestController { public class ConfigSourcesController extends BaseRestController {
@Autowired @Autowired
@@ -65,55 +65,49 @@ public class ConfigSourcesController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.POST)
@ApiOperation(value = "业务配置存储", httpMethod = "POST", response = Map.class, notes = "对有效的配置(封堵|监测|白名单)存储") @ApiOperation(value = "MAAT规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收MAAT规则数据存储到流量处理平台配置线中")
@ApiParam(value = "业务配置数据源", name = "configSource", required = true) @ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
public Map createConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request, public Map createMaatConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
CompileVal.setBusinessCode(null); CompileVal.setBusinessCode(null);
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
configSource); configSource);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if (null != configSource && null != configSource.getConfigCompileList() if (null != configSource && null != configSource.getConfigCompileList()
&& configSource.getConfigCompileList().size() > 0) { && configSource.getConfigCompileList().size() > 0) {
int opAction = configSource.getOpAction(); checkOpAction(thread, System.currentTimeMillis() - start, configSource.getOpAction(), Constants.OPACTION_POST);
checkOpAction(thread, System.currentTimeMillis() - start, opAction, 1);
// 验证配置编译数据 // 验证配置编译数据
validateConfigSource(thread, start, configSource); validateConfigSource(thread, start, configSource);
Long benginTime = System.currentTimeMillis();
String msg = configSourcesService.saveMaatConfig(thread, start, configSource.getConfigCompileList(), sb); String msg = configSourcesService.saveMaatConfig(thread, start, configSource.getConfigCompileList(), sb);
// String msg = "";
if ("error".equals(msg)) { if ("error".equals(msg)) {
Exception exception = ConfigSourcesService.getMsgList().get(0); Exception exception = ConfigSourcesService.getMsgList().get(0);
throw new RestServiceException(thread, System.currentTimeMillis() - start, throw new RestServiceException(thread, System.currentTimeMillis() - start,
"存储编译配置时出现异常" + exception.getMessage(),CompileVal.getBusinessCode()); "Maat 规则存储异常" + exception.getMessage(), CompileVal.getBusinessCode());
} }
Long endSaveTime = System.currentTimeMillis();
Long time = (endSaveTime - benginTime) / 1000;
System.out.println("插入数据成功总共需要" + time + "");
} else { } else {
thread.setExceptionInfo("编译配置数据不能为空"); thread.setExceptionInfo("Maat规则不能为空");
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置数据不能为空", throw new RestServiceException(thread, System.currentTimeMillis() - start, "Maat规则不能为空",
RestBusinessCode.missing_args.getValue()); RestBusinessCode.missing_args.getValue());
} }
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
"编译配置数据插入成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null); "Maat规则下发成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
} }
@RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.PUT) @RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.PUT)
@ApiOperation(value = "业务配置状态更新", httpMethod = "PUT", response = Map.class, notes = "对有效的配置(封堵|监测|白名单)进行配置失效") @ApiOperation(value = "MAAT规则状态更新接口", httpMethod = "PUT", response = Map.class, notes = "接收Maat规则,对其状态置为失效")
@ApiParam(value = "业务配置数据源", name = "configSource", required = true) @ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
public Map updateConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request, public Map updateConfigSource(@RequestBody ConfigSource configSource, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
CompileVal.setBusinessCode(null); CompileVal.setBusinessCode(null);
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
configSource); configSource);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if (null == configSource.getOpTime()) { if (null == configSource.getOpTime()) {
@@ -132,29 +126,29 @@ public class ConfigSourcesController extends BaseRestController {
if (msg.equals("error")) { if (msg.equals("error")) {
Exception exception = ConfigSourcesService.getMsgList().get(0); Exception exception = ConfigSourcesService.getMsgList().get(0);
throw new RestServiceException(thread, System.currentTimeMillis() - start, throw new RestServiceException(thread, System.currentTimeMillis() - start,
"修改编译配置状态时出现异常" + exception.getMessage(),CompileVal.getBusinessCode()); "MAAT规则状态更新时出现异常" + exception.getMessage(),CompileVal.getBusinessCode());
} }
// configSourcesService.updateConfigSource(thread, start, // configSourcesService.updateConfigSource(thread, start,
// configSource.getConfigCompileList(), // configSource.getConfigCompileList(),
// configSource.getOpTime(), sb); // configSource.getOpTime(), sb);
} else { } else {
thread.setExceptionInfo("编译配置数据不能为空"); thread.setExceptionInfo("Maat规则不能为空");
throw new RestServiceException(thread, System.currentTimeMillis() - start, "编译配置数据不能为空" + sb.toString(), throw new RestServiceException(thread, System.currentTimeMillis() - start, "Maat规则不能为空" + sb.toString(),
RestBusinessCode.missing_args.getValue()); RestBusinessCode.missing_args.getValue());
} }
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
"编译配置修改成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null); "Maat规则状态更新成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
} }
@RequestMapping(value = "/cfg/v1/configModifySources", method = RequestMethod.PUT) @RequestMapping(value = "/cfg/v1/configModifySources", method = RequestMethod.PUT)
@ApiOperation(value = "编译配置修改", httpMethod = "PUT", response = Map.class, notes = "对有效的配置(封堵|监测|白名单)存储") @ApiOperation(value = "MAAT规则修改接口", httpMethod = "PUT", response = Map.class, notes = "接收Maat规则,对其规则内容进行修改")
@ApiParam(value = "编译配置修改", name = "configSource", required = true) @ApiParam(value = "MAAT规则对象", name = "configSource", required = true)
public Map configModifySources(@RequestBody ConfigSource configSource, HttpServletRequest request, public Map configModifySources(@RequestBody ConfigSource configSource, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
configSource); configSource);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if (null != configSource && null != configSource.getConfigCompileList() if (null != configSource && null != configSource.getConfigCompileList()
@@ -269,7 +263,7 @@ public class ConfigSourcesController extends BaseRestController {
"修改编译配置数据成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null); "修改编译配置数据成功" + sb.toString(), Constants.IS_DEBUG ? configSource : null);
} }
private void validateConfigSource(SaveRequestLogThread thread, long start, ConfigSource configSource) { private void validateConfigSource(AuditLogThread thread, long start, ConfigSource configSource) {
String errorInfo = ""; String errorInfo = "";
List<ConfigCompile> configCompileList = configSource.getConfigCompileList(); List<ConfigCompile> configCompileList = configSource.getConfigCompileList();
@@ -286,8 +280,8 @@ public class ConfigSourcesController extends BaseRestController {
} }
if (configCompileList.size() <= 0) { if (configCompileList.size() <= 0) {
errorInfo = "编译配置不能为空"; errorInfo = "Maat规则不能为空";
} }
if (!errorInfo.equals("")) { if (!errorInfo.equals("")) {
thread.setExceptionInfo(errorInfo); thread.setExceptionInfo(errorInfo);
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorInfo, throw new RestServiceException(thread, System.currentTimeMillis() - start, errorInfo,
@@ -297,54 +291,54 @@ public class ConfigSourcesController extends BaseRestController {
} }
@RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.POST, produces = org.springframework.http.MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.POST, produces = org.springframework.http.MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "回调配置存储", httpMethod = "POST", response = Map.class, notes = "回调配置存储服务") @ApiOperation(value = "回调(通用)规则存储接口", httpMethod = "POST", response = Map.class, notes = "接收回调规则数据,格式为结构化行列式JSON,存储到流量处理平台配置线中")
public Map createCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request, public Map createCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
CompileVal.setBusinessCode(null); CompileVal.setBusinessCode(null);
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
StringBuffer sb = new StringBuffer();
String msg = configSourcesService.saveCommonSources(thread, start, jsonString, sb); String msg = configSourcesService.saveCommonSources(thread, start, jsonString);
if (msg.equals("error")) { if (msg.equals("error")) {
Exception exception = ConfigSourcesService.getMsgList().get(0); Exception exception = ConfigSourcesService.getMsgList().get(0);
throw new RestServiceException(thread, System.currentTimeMillis() - start, throw new RestServiceException(thread, System.currentTimeMillis() - start,
"存储回调配置时出现异常" + exception.getMessage(), CompileVal.getBusinessCode()); "回调规则存储异常" + exception.getMessage(), CompileVal.getBusinessCode());
} }
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "配置数据插入成功", return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则下发成功",
Constants.IS_DEBUG ? jsonString : null); Constants.IS_DEBUG ? jsonString : null);
} }
@RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.PUT) @RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.PUT)
@ApiOperation(value = "回调配置状态修改", httpMethod = "PUT", response = Map.class, notes = "回调配置状态修改服务") @ApiOperation(value = "回调规则状态更新接口", httpMethod = "PUT", response = Map.class, notes = "接收回调规则,对其状态置为失效")
@ApiParam(value = "回调配置状态修改", name = "updateStatConfigSource", required = true)
public Map updateCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request, public Map updateCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
CompileVal.setBusinessCode(null); CompileVal.setBusinessCode(null);
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_PUT, request,
jsonString); jsonString);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
String msg = configSourcesService.updateCommonSources(thread, start, jsonString, new Date(), sb); String msg = configSourcesService.updateCommonSources(thread, start, jsonString, new Date(), sb);
if (msg.equals("error")) { if (msg.equals("error")) {
Exception exception = ConfigSourcesService.getMsgList().get(0); Exception exception = ConfigSourcesService.getMsgList().get(0);
throw new RestServiceException(thread, System.currentTimeMillis() - start, throw new RestServiceException(thread, System.currentTimeMillis() - start,
"修改回调配置状态时出现异常" + exception.getMessage(), CompileVal.getBusinessCode()); "回调规则状态更新异常" + exception.getMessage(), CompileVal.getBusinessCode());
} }
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "配置状态修改成功", return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "回调规则状态更新成功",
Constants.IS_DEBUG ? jsonString : null); Constants.IS_DEBUG ? jsonString : null);
} }
@RequestMapping(value = "/cfg/v1/fileUploadSources", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/fileUploadSources", method = RequestMethod.POST)
@ApiOperation(value = "样例文件上传服务", httpMethod = "POST", response = Map.class, notes = "样例文件上传服务") @ApiOperation(value = "样例文件上传服务接口", httpMethod = "POST", response = Map.class, notes = "样例文件上传服务")
@ApiParam(value = "样例文件上传服务", name = "MultipartFile", required = true) @ApiParam(value = "样例文件上传服务", name = "MultipartFile", required = true)
public Map fileUploadSource(@RequestBody MultipartFile file, HttpServletRequest request, public Map fileUploadSource(@RequestBody MultipartFile file, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息 ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
String filePath = ""; String filePath = "";
try { try {
@@ -402,12 +396,12 @@ public class ConfigSourcesController extends BaseRestController {
} }
@RequestMapping(value = "/cfg/v1/fileDigestSources", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/fileDigestSources", method = RequestMethod.POST)
@ApiOperation(value = "文件摘要获取", httpMethod = "POST", response = Map.class, notes = "文件摘要获取") @ApiOperation(value = "文件摘要获取接口", httpMethod = "POST", response = Map.class, notes = "文件摘要获取")
@ApiParam(value = "摘要文件", name = "MultipartFile", required = true) @ApiParam(value = "摘要文件", name = "MultipartFile", required = true)
public Map fileDigestSources(@RequestBody MultipartFile file, HttpServletRequest request, public Map fileDigestSources(@RequestBody MultipartFile file, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
file, null); file, null);
if (file == null) { if (file == null) {
thread.setExceptionInfo("请上传获取摘要的文件到file"); thread.setExceptionInfo("请上传获取摘要的文件到file");

View File

@@ -11,6 +11,7 @@ import com.nis.util.Constants;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -18,9 +19,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.nis.util.JsonMapper; import com.nis.util.JsonMapper;
import com.nis.web.controller.BaseController;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DashboardService; import com.nis.web.service.restful.DashboardService;
import com.wordnik.swagger.annotations.Api; import com.wordnik.swagger.annotations.Api;
@@ -43,7 +42,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "协议统计", httpMethod = "GET", notes = "对应协议统计实时统计查询服务。") @ApiOperation(value = "协议统计", httpMethod = "GET", notes = "对应协议统计实时统计查询服务。")
public Map<String,?> trafficProtocol(Model model, HttpServletRequest request, HttpServletResponse response){ public Map<String,?> trafficProtocol(Model model, HttpServletRequest request, HttpServletResponse response){
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<HashMap> list = new ArrayList<HashMap>(); List<HashMap> list = new ArrayList<HashMap>();
try { try {
List<Map> ipActiveChart = dashboardService.protocolChart(); List<Map> ipActiveChart = dashboardService.protocolChart();
@@ -74,7 +73,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String,?> trafficIpActive(Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String,?> trafficIpActive(Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<LinkedHashMap> list = new ArrayList<LinkedHashMap>(); List<LinkedHashMap> list = new ArrayList<LinkedHashMap>();
try { try {
List<LinkedHashMap> ipActiveChart = dashboardService.ipActiveChart(); List<LinkedHashMap> ipActiveChart = dashboardService.ipActiveChart();
@@ -100,7 +99,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String, ?> trafficApp(Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String, ?> trafficApp(Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> appChart = dashboardService.appChart(); List<Map> appChart = dashboardService.appChart();
@@ -122,7 +121,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户的操作系统列表显示") @ApiOperation(value = "操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户的操作系统列表显示")
public Map<String,?> trafficOsList(Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String,?> trafficOsList(Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> osChart = dashboardService.systemList(); List<Map> osChart = dashboardService.systemList();
@@ -145,7 +144,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String, ?> trafficBrowserChart(Integer osType,Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String, ?> trafficBrowserChart(Integer osType,Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> osChart = dashboardService.getBrowserBySystem(osType); List<Map> osChart = dashboardService.getBrowserBySystem(osType);
@@ -167,7 +166,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户的浏览器列表显示") @ApiOperation(value = "浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户的浏览器列表显示")
public Map<String, ?> trafficBsList(Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String, ?> trafficBsList(Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> bsChart = dashboardService.browserList(); List<Map> bsChart = dashboardService.browserList();
@@ -190,7 +189,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String,?> trafficSystemChart(Integer bsType,Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String,?> trafficSystemChart(Integer bsType,Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> bsChart = dashboardService.getSystemBybrowser(bsType); List<Map> bsChart = dashboardService.getSystemBybrowser(bsType);
@@ -213,7 +212,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String,?> trafficWebsiteList(Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String,?> trafficWebsiteList(Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> websiteChart = dashboardService.websiteList(); List<Map> websiteChart = dashboardService.websiteList();
@@ -236,7 +235,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String, ?> trafficWebTypeChart(Integer webId,Model model, HttpServletRequest request, HttpServletResponse response) { public Map<String, ?> trafficWebTypeChart(Integer webId,Model model, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
List<Map> list = new ArrayList<Map>(); List<Map> list = new ArrayList<Map>();
try { try {
List<Map> websiteChart = dashboardService.getTypeBywebsite(webId); List<Map> websiteChart = dashboardService.getTypeBywebsite(webId);

View File

@@ -6,6 +6,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
@@ -19,7 +20,6 @@ import com.nis.listener.SystemConfigListener;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DataDictionaryService; import com.nis.web.service.restful.DataDictionaryService;
@@ -36,7 +36,7 @@ public class DataDictionaryController extends BaseRestController {
public Map findAllDataDict(DataDictionaryValue dataDictionaryValue, HttpServletRequest request, public Map findAllDataDict(DataDictionaryValue dataDictionaryValue, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
dataDictionaryValue); dataDictionaryValue);
Page page = new Page(); Page page = new Page();
int no = dataDictionaryValue.getPagesNo() == null ? 1 : dataDictionaryValue.getPagesNo(); int no = dataDictionaryValue.getPagesNo() == null ? 1 : dataDictionaryValue.getPagesNo();
@@ -56,7 +56,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/getAllDictName", method = RequestMethod.GET) @RequestMapping(value = "/cfg/v1/getAllDictName", method = RequestMethod.GET)
public Map getAllDictName(HttpServletRequest request, HttpServletResponse response) { public Map getAllDictName(HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
null); null);
try { try {
return serviceResponse(thread, start, request, response, "编译配置获取成功", return serviceResponse(thread, start, request, response, "编译配置获取成功",
@@ -72,7 +72,7 @@ public class DataDictionaryController extends BaseRestController {
public Map addDictName(String dataDictId, String addDictName, String dictVal, HttpServletRequest request, public Map addDictName(String dataDictId, String addDictName, String dictVal, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
String option = ""; String option = "";
@@ -98,7 +98,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/delDictVal", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/delDictVal", method = RequestMethod.POST)
public Map delDictVal(String dictValId, HttpServletRequest request, HttpServletResponse response) { public Map delDictVal(String dictValId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
String saveDataDict = dataDictionaryService.delDictVal(dictValId); String saveDataDict = dataDictionaryService.delDictVal(dictValId);
@@ -116,7 +116,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/delDictName", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/delDictName", method = RequestMethod.POST)
public Map delDictName(String dictNameId, HttpServletRequest request, HttpServletResponse response) { public Map delDictName(String dictNameId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
String saveDataDict = dataDictionaryService.delDictName(dictNameId); String saveDataDict = dataDictionaryService.delDictName(dictNameId);
@@ -133,7 +133,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/getDict", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/getDict", method = RequestMethod.POST)
public Map getDict(String dictValId, ModelMap map, HttpServletRequest request, HttpServletResponse response) { public Map getDict(String dictValId, ModelMap map, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
DataDictionaryValue dict = dataDictionaryService.getDict(dictValId); DataDictionaryValue dict = dataDictionaryService.getDict(dictValId);
@@ -156,7 +156,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/updateDictName", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/updateDictName", method = RequestMethod.POST)
public Map updateDictName(String dictVal, String dictId, HttpServletRequest request, HttpServletResponse response) { public Map updateDictName(String dictVal, String dictId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
String option = "updateVal"; String option = "updateVal";
@@ -175,7 +175,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/setDataDictEffective", method = RequestMethod.POST) @RequestMapping(value = "/cfg/v1/setDataDictEffective", method = RequestMethod.POST)
public Map setDataDictEffective(HttpServletRequest request, HttpServletResponse response) { public Map setDataDictEffective(HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null); null);
try { try {
Map<String, List<DataDictionaryValue>> allDataDict = dataDictionaryService.getAllDataDict(); Map<String, List<DataDictionaryValue>> allDataDict = dataDictionaryService.getAllDataDict();

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfIpPortUdpService; import com.nis.web.service.restful.DfIpPortUdpService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class DfIpPortUdpController extends BaseRestController {
@ApiOperation(value = "保存IP+端口Udp协议G设备封堵配置", httpMethod = "POST", notes = "save ip port udp") @ApiOperation(value = "保存IP+端口Udp协议G设备封堵配置", httpMethod = "POST", notes = "save ip port udp")
public Map saveDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dfIpPortUdpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
this.chekckData(dfIpPortUdpSource,false); this.chekckData(dfIpPortUdpSource,false);
@@ -108,7 +108,7 @@ public class DfIpPortUdpController extends BaseRestController {
@ApiOperation(value = "更新IP+端口Udp协议G设备封堵配置", httpMethod = "PUT", notes = "update ip port udp") @ApiOperation(value = "更新IP+端口Udp协议G设备封堵配置", httpMethod = "PUT", notes = "update ip port udp")
public Map updateDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dfIpPortUdpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
this.chekckData(dfIpPortUdpSource,true); this.chekckData(dfIpPortUdpSource,true);
@@ -147,7 +147,7 @@ public class DfIpPortUdpController extends BaseRestController {
@ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp") @ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp")
public Map deleteDfIpPortUdp(@PathVariable("cfgId") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDfIpPortUdp(@PathVariable("cfgId") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
dfIpPortUdpService.removeDfIpPortUdp(id); dfIpPortUdpService.removeDfIpPortUdp(id);
@@ -185,7 +185,7 @@ public class DfIpPortUdpController extends BaseRestController {
@ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp") @ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp")
public Map deleteDfIpPortUdp(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDfIpPortUdp(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dfIpPortUdpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dfIpPortUdpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dfIpPortUdpSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
dfIpPortUdpService.removeDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList()); dfIpPortUdpService.removeDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList());

View File

@@ -26,7 +26,7 @@ import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyConvertUrlService; import com.nis.web.service.restful.DfKeyConvertUrlService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -66,7 +66,7 @@ public class DfKeyConvertUrlController extends BaseRestController{
} }
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null);
//请求参数校验 //请求参数校验
dfKeyConvertUrlService.queryConditionCheck(thread,start,dfKeyConvertUrl,page); dfKeyConvertUrlService.queryConditionCheck(thread,start,dfKeyConvertUrl,page);

View File

@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model; import org.springframework.ui.Model;
@@ -26,7 +27,6 @@ import com.nis.domain.restful.DfKeyMailAdd;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyMailAddService; import com.nis.web.service.restful.DfKeyMailAddService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -66,7 +66,7 @@ public class DfKeyMailAddController extends BaseRestController {
} }
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null); AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
// 请求参数校验 // 请求参数校验
dfKeyMailAddService.queryConditionCheck(thread, start, dfKeyMailAdd, page); dfKeyMailAddService.queryConditionCheck(thread, start, dfKeyMailAdd, page);

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DmbCkService; import com.nis.web.service.restful.DmbCkService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class DmbCkController extends BaseRestController {
@ApiOperation(value = "保存运营商信息", httpMethod = "POST", notes = "save provider info") @ApiOperation(value = "保存运营商信息", httpMethod = "POST", notes = "save provider info")
public Map saveDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbCkSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbCkSource);
super.checkOpAction(thread,System.currentTimeMillis()-start, dmbCkSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start, dmbCkSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
this.chekckData(dmbCkSource); this.chekckData(dmbCkSource);
@@ -108,7 +108,7 @@ public class DmbCkController extends BaseRestController {
@ApiOperation(value = "更新运营商信息", httpMethod = "PUT", notes = "update provider info") @ApiOperation(value = "更新运营商信息", httpMethod = "PUT", notes = "update provider info")
public Map updateDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDmbCkBatch(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbCkSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbCkSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
this.chekckData(dmbCkSource); this.chekckData(dmbCkSource);
@@ -146,7 +146,7 @@ public class DmbCkController extends BaseRestController {
@ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info") @ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info")
public Map deleteDmbCk(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDmbCk(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
dmbCkService.removeDmbCk(id); dmbCkService.removeDmbCk(id);
// commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date()); // commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date());
@@ -183,7 +183,7 @@ public class DmbCkController extends BaseRestController {
@ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info") @ApiOperation(value = "删除运营商信息", httpMethod = "DELETE", notes = "delete provider info")
public Map deleteDmbCk(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDmbCk(@RequestBody DmbCkSource dmbCkSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbCkSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbCkSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dmbCkSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
dmbCkService.removeDmbCkBatch(dmbCkSource.getDmbCkList()); dmbCkService.removeDmbCkBatch(dmbCkSource.getDmbCkList());

View File

@@ -30,7 +30,7 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DmbPortService; import com.nis.web.service.restful.DmbPortService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class DmbPortController extends BaseRestController {
@ApiOperation(value = "保存运营商端口信息", httpMethod = "POST", notes = "save provider port info") @ApiOperation(value = "保存运营商端口信息", httpMethod = "POST", notes = "save provider port info")
public Map saveDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbPortSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dmbPortSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
this.chekckData(dmbPortSource); this.chekckData(dmbPortSource);
@@ -108,7 +108,7 @@ public class DmbPortController extends BaseRestController {
@ApiOperation(value = "更新运营商端口信息", httpMethod = "PUT", notes = "update provider port info") @ApiOperation(value = "更新运营商端口信息", httpMethod = "PUT", notes = "update provider port info")
public Map updateDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDmbPortBatch(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbPortSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dmbPortSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
this.chekckData(dmbPortSource); this.chekckData(dmbPortSource);
@@ -146,7 +146,7 @@ public class DmbPortController extends BaseRestController {
@ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info") @ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info")
public Map deleteDmbPort(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDmbPort(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
dmbPortService.removeDmbPort(id); dmbPortService.removeDmbPort(id);
// commonConfigService.saveOrUpdateConfigState("DMB_PORT", new Date()); // commonConfigService.saveOrUpdateConfigState("DMB_PORT", new Date());
@@ -183,7 +183,7 @@ public class DmbPortController extends BaseRestController {
@ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info") @ApiOperation(value = "删除运营商端口信息", httpMethod = "DELETE", notes = "delete provider port info")
public Map deleteDmbPort(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDmbPort(@RequestBody DmbPortSource dmbPortSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbPortSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dmbPortSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dmbPortSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
dmbPortService.removeDmbPortBatch(dmbPortSource.getDmbPortList()); dmbPortService.removeDmbPortBatch(dmbPortSource.getDmbPortList());

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsFakeInfoService; import com.nis.web.service.restful.DnsFakeInfoService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "保存DNS欺骗信息", httpMethod = "POST", notes = "save dns fake info") @ApiOperation(value = "保存DNS欺骗信息", httpMethod = "POST", notes = "save dns fake info")
public Map saveDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
if(chekckData(dnsFakeInfoSource,false)){ if(chekckData(dnsFakeInfoSource,false)){
@@ -111,7 +111,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "更新DNS欺骗信息", httpMethod = "PUT", notes = "update dns fake info") @ApiOperation(value = "更新DNS欺骗信息", httpMethod = "PUT", notes = "update dns fake info")
public Map updateDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
if(chekckData(dnsFakeInfoSource,true)){ if(chekckData(dnsFakeInfoSource,true)){
@@ -152,7 +152,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info") @ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
public Map deleteDnsFakeInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsFakeInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
boolean isValid=dnsFakeInfoService.isValid(id); boolean isValid=dnsFakeInfoService.isValid(id);
if(!isValid){ if(!isValid){
@@ -196,7 +196,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info") @ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
public Map deleteDnsFakeInfo(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsFakeInfo(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeInfoSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
boolean isValid=dnsFakeInfoService.isValid(dnsFakeInfoSource.getDnsFakeInfoList()); boolean isValid=dnsFakeInfoService.isValid(dnsFakeInfoSource.getDnsFakeInfoList());

View File

@@ -30,7 +30,7 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsFakeIpService; import com.nis.web.service.restful.DnsFakeIpService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -68,7 +68,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "保存DNS欺骗IP地址", httpMethod = "POST", notes = "save dns fake ip") @ApiOperation(value = "保存DNS欺骗IP地址", httpMethod = "POST", notes = "save dns fake ip")
public Map saveDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeIpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsFakeIpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
if(chekckData(dnsFakeIpSource,false)){ if(chekckData(dnsFakeIpSource,false)){
@@ -107,7 +107,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "更新DNS欺骗IP地址", httpMethod = "PUT", notes = "update dns fake ip") @ApiOperation(value = "更新DNS欺骗IP地址", httpMethod = "PUT", notes = "update dns fake ip")
public Map updateDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeIpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsFakeIpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
if(chekckData(dnsFakeIpSource,true)){ if(chekckData(dnsFakeIpSource,true)){
@@ -147,7 +147,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip") @ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
public Map deleteDnsFakeIp(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsFakeIp(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
boolean isValid=dnsFakeIpService.isValid(id); boolean isValid=dnsFakeIpService.isValid(id);
if(!isValid){ if(!isValid){
@@ -191,7 +191,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip") @ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
public Map deleteDnsFakeIp(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsFakeIp(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeIpSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsFakeIpSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsFakeIpSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
boolean isValid=dnsFakeIpService.isValid(dnsFakeIpSource.getDnsFakeIpList()); boolean isValid=dnsFakeIpService.isValid(dnsFakeIpSource.getDnsFakeIpList());

View File

@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -29,7 +30,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsGroupTypeService; import com.nis.web.service.restful.DnsGroupTypeService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "保存DNS分组类型", httpMethod = "POST", notes = "save dns group type") @ApiOperation(value = "保存DNS分组类型", httpMethod = "POST", notes = "save dns group type")
public Map saveDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response) { public Map saveDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsGroupTypeSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsGroupTypeSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
// if(chekckData(dnsGroupTypeSource/*,false*/)) // if(chekckData(dnsGroupTypeSource/*,false*/))
@@ -112,7 +112,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "更新DNS分组类型", httpMethod = "PUT", notes = "update dns group type") @ApiOperation(value = "更新DNS分组类型", httpMethod = "PUT", notes = "update dns group type")
public Map updateDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){ public Map updateDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsGroupTypeSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsGroupTypeSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
// if(chekckData(dnsGroupTypeSource/*,true*/)) // if(chekckData(dnsGroupTypeSource/*,true*/))
@@ -154,7 +154,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type") @ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
public Map deleteDnsGroupType(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsGroupType(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
boolean isValid=dnsGroupTypeService.isValid(id); boolean isValid=dnsGroupTypeService.isValid(id);
if(!isValid){ if(!isValid){
@@ -198,7 +198,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type") @ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
public Map deleteDnsGroupType(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsGroupType(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsGroupTypeSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsGroupTypeSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsGroupTypeSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
boolean isValid=dnsGroupTypeService.isValid(dnsGroupTypeSource.getDnsGroupTypeList()); boolean isValid=dnsGroupTypeService.isValid(dnsGroupTypeSource.getDnsGroupTypeList());
@@ -234,7 +234,7 @@ public class DnsGroupTypeController extends BaseRestController {
* @exception * @exception
* @since 1.0.0 * @since 1.0.0
*/ */
private void chekckData(SaveRequestLogThread thread,long start,DnsGroupTypeSource entity,int opAction){ private void chekckData(AuditLogThread thread, long start, DnsGroupTypeSource entity, int opAction){
for(DnsGroupType dnsGroupType :entity.getDnsGroupTypeList()){ for(DnsGroupType dnsGroupType :entity.getDnsGroupTypeList()){
if(dnsGroupType.getOpTime()==null) if(dnsGroupType.getOpTime()==null)
dnsGroupType.setOpTime(entity.getOpTime()); dnsGroupType.setOpTime(entity.getOpTime());

View File

@@ -30,7 +30,7 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsResponseStrategyService; import com.nis.web.service.restful.DnsResponseStrategyService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -69,7 +69,7 @@ public class DnsResponseStrategyController extends BaseRestController {
@ApiOperation(value = "保存DNS响应策略", httpMethod = "POST", notes = "save dns response strategy") @ApiOperation(value = "保存DNS响应策略", httpMethod = "POST", notes = "save dns response strategy")
public Map saveDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response) { public Map saveDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsResponseStrategySource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, dnsResponseStrategySource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_POST);
try{ try{
chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_POST); chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_POST);
@@ -109,7 +109,7 @@ public class DnsResponseStrategyController extends BaseRestController {
@ApiOperation(value = "更新DNS响应策略", httpMethod = "PUT", notes = "update dns response strategy") @ApiOperation(value = "更新DNS响应策略", httpMethod = "PUT", notes = "update dns response strategy")
public Map updateDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){ public Map updateDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsResponseStrategySource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, dnsResponseStrategySource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_PUT); chekckData(thread,start,dnsResponseStrategySource,Constants.OPACTION_PUT);
@@ -149,7 +149,7 @@ public class DnsResponseStrategyController extends BaseRestController {
@ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy") @ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy")
public Map deleteDnsResponseStrategy(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsResponseStrategy(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
boolean isValid=dnsResponseStrategyService.isValid(id); boolean isValid=dnsResponseStrategyService.isValid(id);
if(!isValid){ if(!isValid){
@@ -192,7 +192,7 @@ public class DnsResponseStrategyController extends BaseRestController {
@ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy") @ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy")
public Map deleteDnsResponseStrategy(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){ public Map deleteDnsResponseStrategy(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsResponseStrategySource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, dnsResponseStrategySource);
super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,dnsResponseStrategySource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
boolean isValid=dnsResponseStrategyService.isValid(dnsResponseStrategySource.getDnsResponseStrategyList()); boolean isValid=dnsResponseStrategyService.isValid(dnsResponseStrategySource.getDnsResponseStrategyList());
@@ -225,7 +225,7 @@ public class DnsResponseStrategyController extends BaseRestController {
* @exception * @exception
* @since 1.0.0 * @since 1.0.0
*/ */
private void chekckData(SaveRequestLogThread thread,long start,DnsResponseStrategySource entity,int opAction){ private void chekckData(AuditLogThread thread, long start, DnsResponseStrategySource entity, int opAction){
Date now =new Date(); Date now =new Date();
for(DnsResponseStrategy dnsResponseStrategy :entity.getDnsResponseStrategyList()){ for(DnsResponseStrategy dnsResponseStrategy :entity.getDnsResponseStrategyList()){
@@ -250,7 +250,7 @@ public class DnsResponseStrategyController extends BaseRestController {
} }
} }
private void checkReqStrateId(SaveRequestLogThread thread,long start,DnsResponseStrategy dnsResponseStrategy,int opAction){ private void checkReqStrateId(AuditLogThread thread, long start, DnsResponseStrategy dnsResponseStrategy, int opAction){
//update时可以为空 //update时可以为空
if(opAction==Constants.OPACTION_PUT&&dnsResponseStrategy.getReqStrateId()==null)return; if(opAction==Constants.OPACTION_PUT&&dnsResponseStrategy.getReqStrateId()==null)return;
if(dnsResponseStrategy.getReqStrateId()==null){ if(dnsResponseStrategy.getReqStrateId()==null){

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.EncryptProtoRandomService; import com.nis.web.service.restful.EncryptProtoRandomService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class EncryptProtoRandomController extends BaseRestController {
@ApiOperation(value = "保存加密类协议随机封堵配置", httpMethod = "POST", notes = "save encrypt_proto_random") @ApiOperation(value = "保存加密类协议随机封堵配置", httpMethod = "POST", notes = "save encrypt_proto_random")
public Map saveEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response) { public Map saveEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, encryptProtoRandomSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, encryptProtoRandomSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
this.chekckData(encryptProtoRandomSource); this.chekckData(encryptProtoRandomSource);
@@ -108,7 +108,7 @@ public class EncryptProtoRandomController extends BaseRestController {
@ApiOperation(value = "更新加密类协议随机封堵配置", httpMethod = "PUT", notes = "update encrypt_proto_random") @ApiOperation(value = "更新加密类协议随机封堵配置", httpMethod = "PUT", notes = "update encrypt_proto_random")
public Map updateEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){ public Map updateEncryptProtoRandomBatch(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, encryptProtoRandomSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, encryptProtoRandomSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
this.chekckData(encryptProtoRandomSource); this.chekckData(encryptProtoRandomSource);
@@ -146,7 +146,7 @@ public class EncryptProtoRandomController extends BaseRestController {
@ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random") @ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random")
public Map deleteEncryptProtoRandom(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteEncryptProtoRandom(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
encryptProtoRandomService.removeEncryptProtoRandom(id); encryptProtoRandomService.removeEncryptProtoRandom(id);
// commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date()); // commonConfigService.saveOrUpdateConfigState("DMB_CK", new Date());
@@ -183,7 +183,7 @@ public class EncryptProtoRandomController extends BaseRestController {
@ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random") @ApiOperation(value = "删除加密类协议随机封堵配置", httpMethod = "DELETE", notes = "delete encrypt_proto_random")
public Map deleteEncryptProtoRandom(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteEncryptProtoRandom(@RequestBody EncryptProtoRandomSource encryptProtoRandomSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, encryptProtoRandomSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, encryptProtoRandomSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,encryptProtoRandomSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
encryptProtoRandomService.removeEncryptProtoRandomBatch(encryptProtoRandomSource.getEncryptProtoRandomList()); encryptProtoRandomService.removeEncryptProtoRandomBatch(encryptProtoRandomSource.getEncryptProtoRandomList());

View File

@@ -30,7 +30,7 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.FwqInfoService; import com.nis.web.service.restful.FwqInfoService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -70,7 +70,7 @@ public class FwqInfoController extends BaseRestController {
@ApiOperation(value = "保存服务器信息", httpMethod = "POST", notes = "save server info") @ApiOperation(value = "保存服务器信息", httpMethod = "POST", notes = "save server info")
public Map saveFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response) { public Map saveFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response) {
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, fwqInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, fwqInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
chekckData(fwqInfoSource); chekckData(fwqInfoSource);
@@ -108,7 +108,7 @@ public class FwqInfoController extends BaseRestController {
@ApiOperation(value = "更新服务器信息", httpMethod = "PUT", notes = "update server info") @ApiOperation(value = "更新服务器信息", httpMethod = "PUT", notes = "update server info")
public Map updateFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){ public Map updateFwqInfoBatch(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, fwqInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, fwqInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{
chekckData(fwqInfoSource); chekckData(fwqInfoSource);
@@ -146,7 +146,7 @@ public class FwqInfoController extends BaseRestController {
@ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info") @ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info")
public Map deleteFwqInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){ public Map deleteFwqInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
try{ try{
fwqInfoService.removeFwqInfo(id); fwqInfoService.removeFwqInfo(id);
// commonConfigService.saveOrUpdateConfigState("FWQ_INFO", new Date()); // commonConfigService.saveOrUpdateConfigState("FWQ_INFO", new Date());
@@ -183,7 +183,7 @@ public class FwqInfoController extends BaseRestController {
@ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info") @ApiOperation(value = "删除服务器信息", httpMethod = "DELETE", notes = "delete server info")
public Map deleteFwqInfo(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){ public Map deleteFwqInfo(@RequestBody FwqInfoSource fwqInfoSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, fwqInfoSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, fwqInfoSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_DELETE); super.checkOpAction(thread,System.currentTimeMillis()-start,fwqInfoSource.getOpAction(), Constants.OPACTION_DELETE);
try{ try{
fwqInfoService.removeFwqInfoBatch(fwqInfoSource.getFwqInfoList()); fwqInfoService.removeFwqInfoBatch(fwqInfoSource.getFwqInfoList());

View File

@@ -26,7 +26,7 @@ import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.IntervalTimeSearchService; import com.nis.web.service.restful.IntervalTimeSearchService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -67,7 +67,7 @@ public class IntervalTimeSearchController extends BaseRestController{
} }
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_GET,request, null);
//请求参数校验 //请求参数校验
timeSearchService.queryConditionCheck(thread,start,flowControlStop,page); timeSearchService.queryConditionCheck(thread,start,flowControlStop,page);

View File

@@ -10,6 +10,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -54,7 +55,6 @@ import com.nis.util.HiveJDBC;
import com.nis.util.JsonMapper; import com.nis.util.JsonMapper;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.HiveSqlService; import com.nis.web.service.HiveSqlService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.LogTestService; import com.nis.web.service.restful.LogTestService;
import com.nis.web.service.restful.NtcReportService; import com.nis.web.service.restful.NtcReportService;
@@ -87,7 +87,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcIpLogs(Page page, NtcIpLog ntcIpLog, Model model, HttpServletRequest request, public Map<String, ?> ntcIpLogs(Page page, NtcIpLog ntcIpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcIpLog> ntcIpLogPage = null; Page<NtcIpLog> ntcIpLogPage = null;
try { try {
@@ -152,7 +152,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcHttpLogs(Page page, NtcHttpLog ntcHttpLog, Model model, HttpServletRequest request, public Map<String, ?> ntcHttpLogs(Page page, NtcHttpLog ntcHttpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcHttpLog> ntcHttpLogPage = null; Page<NtcHttpLog> ntcHttpLogPage = null;
@@ -212,7 +212,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcDnsLogs(Page page, NtcDnsLog ntcDnsLog, Model model, HttpServletRequest request, public Map<String, ?> ntcDnsLogs(Page page, NtcDnsLog ntcDnsLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcDnsLog> ntcDnsLogPage = null; Page<NtcDnsLog> ntcDnsLogPage = null;
@@ -272,7 +272,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcMailLogs(Page page, NtcMailLog ntcMailLog, Model model, HttpServletRequest request, public Map<String, ?> ntcMailLogs(Page page, NtcMailLog ntcMailLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcMailLog> ntcMailLogPage = null; Page<NtcMailLog> ntcMailLogPage = null;
@@ -332,7 +332,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcSslLogs(Page page, NtcSslLog ntcSslLog, Model model, HttpServletRequest request, public Map<String, ?> ntcSslLogs(Page page, NtcSslLog ntcSslLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcSslLog> ntcSslLogPage = null; Page<NtcSslLog> ntcSslLogPage = null;
@@ -392,7 +392,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcPptpLogs(Page page, NtcPptpLog ntcPptpLog, Model model, HttpServletRequest request, public Map<String, ?> ntcPptpLogs(Page page, NtcPptpLog ntcPptpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcPptpLog> ntcPptpLogPage = null; Page<NtcPptpLog> ntcPptpLogPage = null;
@@ -451,7 +451,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcL2tpLogs(Page page, NtcL2tpLog ntcL2tpLog, Model model, HttpServletRequest request, public Map<String, ?> ntcL2tpLogs(Page page, NtcL2tpLog ntcL2tpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcL2tpLog> ntcL2tpLogPage = null; Page<NtcL2tpLog> ntcL2tpLogPage = null;
@@ -511,7 +511,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcOpenvpnLogs(Page page, NtcOpenvpnLog ntcOpenvpnLog, Model model, public Map<String, ?> ntcOpenvpnLogs(Page page, NtcOpenvpnLog ntcOpenvpnLog, Model model,
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcOpenvpnLog> ntcOpenvpnLogPage = null; Page<NtcOpenvpnLog> ntcOpenvpnLogPage = null;
@@ -571,7 +571,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcIpsecLogs(Page page, NtcIpsecLog ntcIpsecLog, Model model, HttpServletRequest request, public Map<String, ?> ntcIpsecLogs(Page page, NtcIpsecLog ntcIpsecLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcIpsecLog> ntcIpsecLogPage = null; Page<NtcIpsecLog> ntcIpsecLogPage = null;
@@ -631,7 +631,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcSshLogs(Page page, NtcSshLog ntcSshLog, Model model, HttpServletRequest request, public Map<String, ?> ntcSshLogs(Page page, NtcSshLog ntcSshLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcSshLog> ntcSshLogPage = null; Page<NtcSshLog> ntcSshLogPage = null;
@@ -691,7 +691,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcFtpLogs(Page page, NtcFtpLog ntcFtpLog, Model model, HttpServletRequest request, public Map<String, ?> ntcFtpLogs(Page page, NtcFtpLog ntcFtpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcFtpLog> ntcFtpLogPage = null; Page<NtcFtpLog> ntcFtpLogPage = null;
@@ -749,7 +749,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcAppLogs(Page page, NtcAppLog ntcAppLog, Model model, HttpServletRequest request, public Map<String, ?> ntcAppLogs(Page page, NtcAppLog ntcAppLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcAppLog> ntcAppLogPage = null; Page<NtcAppLog> ntcAppLogPage = null;
@@ -807,7 +807,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcDdosLogs(Page page, NtcDdosLog ntcDdosLog, Model model, HttpServletRequest request, public Map<String, ?> ntcDdosLogs(Page page, NtcDdosLog ntcDdosLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<NtcDdosLog> ntcDdosLogPage = null; Page<NtcDdosLog> ntcDdosLogPage = null;
@@ -865,7 +865,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> dkBehaviorLogs(Page page, DkBehaviorLog dkBehaviorLog, Model model, HttpServletRequest request, public Map<String, ?> dkBehaviorLogs(Page page, DkBehaviorLog dkBehaviorLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<DkBehaviorLog> logPage = null; Page<DkBehaviorLog> logPage = null;
@@ -918,7 +918,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> mmAvIpLogs(Page page, MmAvIpLog mmAvIpLog, Model model, HttpServletRequest request, public Map<String, ?> mmAvIpLogs(Page page, MmAvIpLog mmAvIpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<MmAvIpLog> logPage = null; Page<MmAvIpLog> logPage = null;
@@ -971,7 +971,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> mmAvUrlLogs(Page page, MmAvUrlLog mmAvUrlLog, Model model, HttpServletRequest request, public Map<String, ?> mmAvUrlLogs(Page page, MmAvUrlLog mmAvUrlLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<MmAvUrlLog> logPage = null; Page<MmAvUrlLog> logPage = null;
@@ -1024,7 +1024,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> mmPicIpLogs(Page page, MmPicIpLog mmPicIpLog, Model model, HttpServletRequest request, public Map<String, ?> mmPicIpLogs(Page page, MmPicIpLog mmPicIpLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<MmPicIpLog> logPage = null; Page<MmPicIpLog> logPage = null;
@@ -1077,7 +1077,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> mmPicUrlLogs(Page page, MmPicUrlLog mmPicUrlLog, Model model, HttpServletRequest request, public Map<String, ?> mmPicUrlLogs(Page page, MmPicUrlLog mmPicUrlLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<MmPicUrlLog> logPage = null; Page<MmPicUrlLog> logPage = null;
@@ -1131,7 +1131,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> mmVoipLogs(Page page, MmVoipLog mmVoipLog, Model model, HttpServletRequest request, public Map<String, ?> mmVoipLogs(Page page, MmVoipLog mmVoipLog, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<MmVoipLog> logPage = null; Page<MmVoipLog> logPage = null;
@@ -1184,7 +1184,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcPzReport(Page page, NtcPzReport ntcPzReport, Model model, HttpServletRequest request, public Map<String, ?> ntcPzReport(Page page, NtcPzReport ntcPzReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> ntcPzReportPage = null; Page<?> ntcPzReportPage = null;
@@ -1222,7 +1222,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcServiceReport(Page page, NtcServiceReport ntcServiceReport, Model model, HttpServletRequest request, public Map<String, ?> ntcServiceReport(Page page, NtcServiceReport ntcServiceReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1258,7 +1258,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcTagReport(Page page, NtcTagReport ntcTagReport, Model model, HttpServletRequest request, public Map<String, ?> ntcTagReport(Page page, NtcTagReport ntcTagReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1294,7 +1294,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcAttrTypeReport(Page page, NtcAttrTypeReport ntcAttrTypeReport, Model model, HttpServletRequest request, public Map<String, ?> ntcAttrTypeReport(Page page, NtcAttrTypeReport ntcAttrTypeReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1331,7 +1331,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcLwhhReport(Page page, NtcLwhhReport ntcLwhhReport, Model model, HttpServletRequest request, public Map<String, ?> ntcLwhhReport(Page page, NtcLwhhReport ntcLwhhReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1369,7 +1369,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcSrcipDomesticReport(Page page, NtcSrcipDomesticReport ntcSrcipDomesticReport, Model model, HttpServletRequest request, public Map<String, ?> ntcSrcipDomesticReport(Page page, NtcSrcipDomesticReport ntcSrcipDomesticReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1405,7 +1405,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcDestipCountryReport(Page page, NtcDestipCountryReport ntcDestipCountryReport, Model model, HttpServletRequest request, public Map<String, ?> ntcDestipCountryReport(Page page, NtcDestipCountryReport ntcDestipCountryReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;
@@ -1441,7 +1441,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcEntranceReport(Page page, NtcEntranceReport ntcEntranceReport, Model model, HttpServletRequest request, public Map<String, ?> ntcEntranceReport(Page page, NtcEntranceReport ntcEntranceReport, Model model, HttpServletRequest request,
HttpServletResponse response) { HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null); request, null);
Page<?> reportPage = null; Page<?> reportPage = null;

View File

@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import com.nis.domain.restful.*; import com.nis.domain.restful.*;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
@@ -21,7 +22,6 @@ import com.nis.util.ExceptionUtil;
import com.nis.util.FileUtils; import com.nis.util.FileUtils;
import com.nis.util.ServiceAndRDBIndexReal; import com.nis.util.ServiceAndRDBIndexReal;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.ConfigRedisService; import com.nis.web.service.restful.ConfigRedisService;
import com.nis.web.service.restful.ConfigSourcesService; import com.nis.web.service.restful.ConfigSourcesService;
@@ -381,7 +381,7 @@ public class MaatTestController {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
for (int a = 0; a < forCount; a++) { for (int a = 0; a < forCount; a++) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = new SaveRequestLogThread(); AuditLogThread thread = new AuditLogThread();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>(); List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
for (int i = 0; i < saveCount; i++) { for (int i = 0; i < saveCount; i++) {
@@ -413,7 +413,7 @@ public class MaatTestController {
public String testSaveMaat(@RequestParam(required = true) Integer service, public String testSaveMaat(@RequestParam(required = true) Integer service,
@RequestParam(required = true) Integer saveCount) { @RequestParam(required = true) Integer saveCount) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = new SaveRequestLogThread(); AuditLogThread thread = new AuditLogThread();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>(); List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
for (int i = 0; i < saveCount; i++) { for (int i = 0; i < saveCount; i++) {

View File

@@ -11,12 +11,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.ServicesRequestLog;
import com.nis.domain.restful.ServicesRequestLogBean; import com.nis.domain.restful.ServicesRequestLogBean;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
@RestController @RestController
@@ -31,7 +30,7 @@ public class ServicesRequestLogController extends BaseRestController {
Page<ServicesRequestLogBean> queryAllCompile = null; Page<ServicesRequestLogBean> queryAllCompile = null;
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
log); log);
try { try {
queryAllCompile = servicesRequestLogService queryAllCompile = servicesRequestLogService

View File

@@ -5,6 +5,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -20,7 +21,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil; import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController; import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService; import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.SystemFunStatusService; import com.nis.web.service.restful.SystemFunStatusService;
import com.wordnik.swagger.annotations.ApiOperation; import com.wordnik.swagger.annotations.ApiOperation;
@@ -59,7 +59,7 @@ public class SystemFunStatusController extends BaseRestController {
HttpServletRequest request, HttpServletResponse response) { HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, systemFunStatusSource); AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request, systemFunStatusSource);
super.checkOpAction(thread, System.currentTimeMillis() - start, systemFunStatusSource.getOpAction(), Constants.OPACTION_POST); super.checkOpAction(thread, System.currentTimeMillis() - start, systemFunStatusSource.getOpAction(), Constants.OPACTION_POST);
try{ try{
@@ -100,7 +100,7 @@ public class SystemFunStatusController extends BaseRestController {
HttpServletRequest request, HttpServletResponse response){ HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis(); long start=System.currentTimeMillis();
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, systemFunStatusSource); AuditLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, systemFunStatusSource);
super.checkOpAction(thread,System.currentTimeMillis()-start,systemFunStatusSource.getOpAction(), Constants.OPACTION_PUT); super.checkOpAction(thread,System.currentTimeMillis()-start,systemFunStatusSource.getOpAction(), Constants.OPACTION_PUT);
try{ try{

View File

@@ -1,435 +1,433 @@
/** /**
*@Title: SaveLogThread.java *@Title: SaveLogThread.java
*@Package com.nis.web.service.logthread *@Package com.nis.web.service.logthread
*@Description TODO *@Description TODO
*@author dell *@author dell
*@date 2016年10月14日 下午6:26:41 *@date 2016年10月14日 下午6:26:41
*@version 版本号 *@version 版本号
*/ */
package com.nis.web.service; package com.nis.web.service;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Date; import java.util.Date;
import javax.servlet.ServletInputStream; import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.nis.datasource.CustomerContextHolder; import com.nis.datasource.CustomerContextHolder;
/** /**
* 审计日志工作线程 * 审计日志工作线程
* @ClassName: SaveLogThread.java * @ClassName: SaveLogThread.java
* @Description: 用于记录业务操作日志后期用于审计及相关联调验证工作 * @Description: 用于记录业务操作日志后期用于审计及相关联调验证工作
* @author (dell) * @author (dell)
* @date 2016年10月14日 下午6:26:41 * @date 2016年10月14日 下午6:26:41
* @version V1.0 * @version V1.0
*/ */
public class SaveRequestLogThread implements Runnable { public class AuditLogThread implements Runnable {
private Logger logger = Logger.getLogger(SaveRequestLogThread.class); private Logger logger = Logger.getLogger(AuditLogThread.class);
private ServicesRequestLogService service; private ServicesRequestLogService service;
private String remoteAddr; private String remoteAddr;
private String requestURI; private String requestURI;
private String queryString; private String queryString;
private String contextPath; private String contextPath;
private String operator; private String operator;
private String version; private String version;
private int opAction; private int opAction;
private Date opTime; private Date opTime;
private Object content; private Object content;
private Date requestTime; private Date requestTime;
private long consumerTime; private long consumerTime;
private int businessCode; private int businessCode;
private String exceptionInfo; private String exceptionInfo;
private String traceCode; private String traceCode;
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see java.lang.Runnable#run() * @see java.lang.Runnable#run()
*/ */
@Override @Override
public void run() { public void run() {
logger.info("线程开始执行!"); // 新开线程切换数据源不影响action中的数据源
// 新开线程切换数据源不影响action中的数据源 CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_A);// 开启数据源B
CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_B);// 开启数据源B if (service != null) {
// TODO Auto-generated method stub service.saveRequestLog(remoteAddr, requestURI, queryString, contextPath, operator, version, opAction,
if (service != null) { opTime, content, requestTime, consumerTime, businessCode, exceptionInfo, traceCode);
service.saveRequestLog(remoteAddr, requestURI, queryString, contextPath, operator, version, opAction, } else {
opTime, content, requestTime, consumerTime, businessCode, exceptionInfo, traceCode); logger.error("service 为空!");
} else { }
logger.error("service 为空!"); CustomerContextHolder.clearCustomerType();
} }
CustomerContextHolder.clearCustomerType();
} public AuditLogThread() {
super();
public SaveRequestLogThread() { }
super();
} /**
* 创建一个新的实例 AuditLogThread.
/** *
* 创建一个新的实例 SaveRequestLogThread. * @param service
* * @param requestURI
* @param service * @param queryString
* @param requestURI * @param contextPath
* @param queryString * @param operator
* @param contextPath * @param version
* @param operator * @param opAction
* @param version * @param opTime
* @param opAction * @param content
* @param opTime * @param requestTime
* @param content * @param consumerTime
* @param requestTime */
* @param consumerTime public AuditLogThread(ServicesRequestLogService service, String remoteAddr, String requestURI,
*/ String queryString, String contextPath, String operator, String version, int opAction, Date opTime,
public SaveRequestLogThread(ServicesRequestLogService service, String remoteAddr, String requestURI, Object content, Date requestTime, long consumerTime, String exceptionInfo) {
String queryString, String contextPath, String operator, String version, int opAction, Date opTime, super();
Object content, Date requestTime, long consumerTime, String exceptionInfo) { this.service = service;
super(); this.remoteAddr = remoteAddr;
this.service = service; this.requestURI = requestURI;
this.remoteAddr = remoteAddr; this.queryString = queryString;
this.requestURI = requestURI; this.contextPath = contextPath;
this.queryString = queryString; this.operator = operator;
this.contextPath = contextPath; this.version = version;
this.operator = operator; this.opAction = opAction;
this.version = version; this.opTime = opTime;
this.opAction = opAction; this.content = content;
this.opTime = opTime; this.requestTime = requestTime;
this.content = content; this.consumerTime = consumerTime;
this.requestTime = requestTime; this.exceptionInfo = exceptionInfo;
this.consumerTime = consumerTime; }
this.exceptionInfo = exceptionInfo;
} public AuditLogThread(ServicesRequestLogService service, String operator, String version, int opAction,
Date opTime, Object content, Date requestTime, long consumerTime, String exceptionInfo) {
public SaveRequestLogThread(ServicesRequestLogService service, String operator, String version, int opAction, super();
Date opTime, Object content, Date requestTime, long consumerTime, String exceptionInfo) { this.service = service;
super(); this.operator = operator;
this.service = service; this.version = version;
this.operator = operator; this.opAction = opAction;
this.version = version; this.opTime = opTime;
this.opAction = opAction; this.content = content;
this.opTime = opTime; this.requestTime = requestTime;
this.content = content; this.consumerTime = consumerTime;
this.requestTime = requestTime; this.exceptionInfo = exceptionInfo;
this.consumerTime = consumerTime; }
this.exceptionInfo = exceptionInfo;
} public static InputStream cloneInputStream(ServletInputStream inputStream) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
public static InputStream cloneInputStream(ServletInputStream inputStream) { byte[] buffer = new byte[1024];
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int len;
byte[] buffer = new byte[1024]; try {
int len; while ((len = inputStream.read(buffer)) > -1) {
try { byteArrayOutputStream.write(buffer, 0, len);
while ((len = inputStream.read(buffer)) > -1) { }
byteArrayOutputStream.write(buffer, 0, len); byteArrayOutputStream.flush();
} } catch (IOException e) {
byteArrayOutputStream.flush(); e.printStackTrace();
} catch (IOException e) { }
e.printStackTrace(); InputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
} return byteArrayInputStream;
InputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); }
return byteArrayInputStream;
} /**
* 获取非get请求的参数
/** * @param request
* 获取非get请求的参数 * @return
* @param request */
* @return private static String getBodyString(ServletRequest request) {
*/ StringBuilder sb = new StringBuilder();
private static String getBodyString(ServletRequest request) { InputStream inputStream = null;
StringBuilder sb = new StringBuilder(); BufferedReader reader = null;
InputStream inputStream = null; try {
BufferedReader reader = null; inputStream = cloneInputStream(request.getInputStream());
try { reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
inputStream = cloneInputStream(request.getInputStream()); String line = "";
reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); while ((line = reader.readLine()) != null) {
String line = ""; sb.append(line);
while ((line = reader.readLine()) != null) { }
sb.append(line); } catch (IOException e) {
} e.printStackTrace();
} catch (IOException e) { } finally {
e.printStackTrace(); if (inputStream != null) {
} finally { try {
if (inputStream != null) { inputStream.close();
try { } catch (IOException e) {
inputStream.close(); e.printStackTrace();
} catch (IOException e) { }
e.printStackTrace(); }
} if (reader != null) {
} try {
if (reader != null) { reader.close();
try { } catch (IOException e) {
reader.close(); e.printStackTrace();
} catch (IOException e) { }
e.printStackTrace(); }
} }
} return sb.toString();
} }
return sb.toString();
} public static AuditLogThread getNewSaveRequestLogThread(HttpServletRequest request) {
AuditLogThread thread = new AuditLogThread();
public static SaveRequestLogThread getNewSaveRequestLogThread(HttpServletRequest request) { thread.setRemoteAddr(request.getRemoteAddr());
SaveRequestLogThread thread = new SaveRequestLogThread(); thread.setRequestURI(request.getRequestURI());
thread.setRemoteAddr(request.getRemoteAddr()); if (request.getMethod().toLowerCase().equals("get")) {
thread.setRequestURI(request.getRequestURI()); thread.setQueryString(request.getQueryString());
if (request.getMethod().toLowerCase().equals("get")) { thread.setContent(request.getQueryString());
thread.setQueryString(request.getQueryString()); } else {
thread.setContent(request.getQueryString()); String contentType = request.getContentType();
} else { if(!contentType.contains("multipart/form-data")) {
String contentType = request.getContentType(); String bodyString = getBodyString(request);
if(!contentType.contains("multipart/form-data")) { thread.setQueryString(bodyString);
String bodyString = getBodyString(request); thread.setContent(bodyString);
thread.setQueryString(bodyString); }else {
thread.setContent(bodyString); //String bodyString = getBodyString(request);
}else { thread.setQueryString("contentTyp="+contentType+",一般是上传文件,此种请求不记录请求内容");
//String bodyString = getBodyString(request); thread.setContent("contentTyp="+contentType+",一般是上传文件,此种请求不记录请求内容");
thread.setQueryString("contentTyp="+contentType+",一般是上传文件,此种请求不记录请求内容"); }
thread.setContent("contentTyp="+contentType+",一般是上传文件,此种请求不记录请求内容"); }
} thread.setContextPath(request.getContextPath());
} thread.setRequestTime(new Date());
thread.setContextPath(request.getContextPath()); return thread;
thread.setRequestTime(new Date()); }
return thread;
} /**
* service
/** * @return service
* service */
* @return service
*/ public ServicesRequestLogService getService() {
return service;
public ServicesRequestLogService getService() { }
return service;
} /**
* @param service the service to set
/** */
* @param service the service to set public void setService(ServicesRequestLogService service) {
*/ this.service = service;
public void setService(ServicesRequestLogService service) { }
this.service = service;
} /**
* remoteAddr
/** * @return remoteAddr
* remoteAddr */
* @return remoteAddr
*/ public String getRemoteAddr() {
return remoteAddr;
public String getRemoteAddr() { }
return remoteAddr;
} /**
* @param remoteAddr the remoteAddr to set
/** */
* @param remoteAddr the remoteAddr to set public void setRemoteAddr(String remoteAddr) {
*/ this.remoteAddr = remoteAddr;
public void setRemoteAddr(String remoteAddr) { }
this.remoteAddr = remoteAddr;
} /**
* requestURI
/** * @return requestURI
* requestURI */
* @return requestURI
*/ public String getRequestURI() {
return requestURI;
public String getRequestURI() { }
return requestURI;
} /**
* @param requestURI the requestURI to set
/** */
* @param requestURI the requestURI to set public void setRequestURI(String requestURI) {
*/ this.requestURI = requestURI;
public void setRequestURI(String requestURI) { }
this.requestURI = requestURI;
} /**
* queryString
/** * @return queryString
* queryString */
* @return queryString
*/ public String getQueryString() {
return queryString;
public String getQueryString() { }
return queryString;
} /**
* @param queryString the queryString to set
/** */
* @param queryString the queryString to set public void setQueryString(String queryString) {
*/ this.queryString = queryString;
public void setQueryString(String queryString) { }
this.queryString = queryString;
} /**
* contextPath
/** * @return contextPath
* contextPath */
* @return contextPath
*/ public String getContextPath() {
return contextPath;
public String getContextPath() { }
return contextPath;
} /**
* @param contextPath the contextPath to set
/** */
* @param contextPath the contextPath to set public void setContextPath(String contextPath) {
*/ this.contextPath = contextPath;
public void setContextPath(String contextPath) { }
this.contextPath = contextPath;
} /**
* operator
/** * @return operator
* operator */
* @return operator
*/ public String getOperator() {
return operator;
public String getOperator() { }
return operator;
} /**
* @param operator the operator to set
/** */
* @param operator the operator to set public void setOperator(String operator) {
*/ this.operator = operator;
public void setOperator(String operator) { }
this.operator = operator;
} /**
* version
/** * @return version
* version */
* @return version
*/ public String getVersion() {
return version;
public String getVersion() { }
return version;
} /**
* @param version the version to set
/** */
* @param version the version to set public void setVersion(String version) {
*/ this.version = version;
public void setVersion(String version) { }
this.version = version;
} /**
* opAction
/** * @return opAction
* opAction */
* @return opAction
*/ public int getOpAction() {
return opAction;
public int getOpAction() { }
return opAction;
} /**
* @param opAction the opAction to set
/** */
* @param opAction the opAction to set public void setOpAction(int opAction) {
*/ this.opAction = opAction;
public void setOpAction(int opAction) { }
this.opAction = opAction;
} /**
* opTime
/** * @return opTime
* opTime */
* @return opTime
*/ public Date getOpTime() {
return opTime;
public Date getOpTime() { }
return opTime;
} /**
* @param opTime the opTime to set
/** */
* @param opTime the opTime to set public void setOpTime(Date opTime) {
*/ this.opTime = opTime;
public void setOpTime(Date opTime) { }
this.opTime = opTime;
} /**
* content
/** * @return content
* content */
* @return content
*/ public Object getContent() {
return content;
public Object getContent() { }
return content;
} /**
* @param content the content to set
/** */
* @param content the content to set public void setContent(Object content) {
*/ this.content = content;
public void setContent(Object content) { }
this.content = content;
} /**
* requestTime
/** * @return requestTime
* requestTime */
* @return requestTime
*/ public Date getRequestTime() {
return requestTime;
public Date getRequestTime() { }
return requestTime;
} /**
* @param requestTime the requestTime to set
/** */
* @param requestTime the requestTime to set public void setRequestTime(Date requestTime) {
*/ this.requestTime = requestTime;
public void setRequestTime(Date requestTime) { }
this.requestTime = requestTime;
} /**
* consumerTime
/** * @return consumerTime
* consumerTime */
* @return consumerTime
*/ public long getConsumerTime() {
return consumerTime;
public long getConsumerTime() { }
return consumerTime;
} /**
* @param consumerTime the consumerTime to set
/** */
* @param consumerTime the consumerTime to set public void setConsumerTime(long consumerTime) {
*/ this.consumerTime = consumerTime;
public void setConsumerTime(long consumerTime) { }
this.consumerTime = consumerTime;
} /**
* businessCode
/** * @return businessCode
* businessCode */
* @return businessCode
*/ public int getBusinessCode() {
return businessCode;
public int getBusinessCode() { }
return businessCode;
} /**
* @param businessCode the businessCode to set
/** */
* @param businessCode the businessCode to set public void setBusinessCode(int businessCode) {
*/ this.businessCode = businessCode;
public void setBusinessCode(int businessCode) { }
this.businessCode = businessCode;
} /**
* exceptionInfo
/** * @return exceptionInfo
* exceptionInfo */
* @return exceptionInfo
*/ public String getExceptionInfo() {
return exceptionInfo;
public String getExceptionInfo() { }
return exceptionInfo;
} /**
* @param exceptionInfo the exceptionInfo to set
/** */
* @param exceptionInfo the exceptionInfo to set public void setExceptionInfo(String exceptionInfo) {
*/ this.exceptionInfo = exceptionInfo;
public void setExceptionInfo(String exceptionInfo) { }
this.exceptionInfo = exceptionInfo;
} public String getTraceCode() {
return traceCode;
public String getTraceCode() { }
return traceCode;
} public void setTraceCode(String traceCode) {
this.traceCode = traceCode;
public void setTraceCode(String traceCode) { }
this.traceCode = traceCode;
} }
}

View File

@@ -52,7 +52,7 @@ public abstract class BaseLogService {
* @exception @since * @exception @since
* 1.0.0 * 1.0.0
*/ */
public void checkCloumnIsExist(SaveRequestLogThread thread, long start, Class clazz, Page page) throws Exception { public void checkCloumnIsExist(AuditLogThread thread, long start, Class clazz, Page page) throws Exception {
String[] fieldsColoumn = null; String[] fieldsColoumn = null;
String[] orderByColoumn = null; String[] orderByColoumn = null;
String notExistColumn = ""; String notExistColumn = "";
@@ -136,8 +136,8 @@ public abstract class BaseLogService {
* @param clazz * @param clazz
* @param page * @param page
*/ */
public void queryConditionCheck(SaveRequestLogThread thread, long start, LogEntity<?> entity, Class clazz, public void queryConditionCheck(AuditLogThread thread, long start, LogEntity<?> entity, Class clazz,
Page page) { Page page) {
logger.info("请求参数校验开始----" + System.currentTimeMillis()); logger.info("请求参数校验开始----" + System.currentTimeMillis());
try { try {
if (!StringUtil.isBlank(entity.getSearchCfgId())) { if (!StringUtil.isBlank(entity.getSearchCfgId())) {
@@ -252,8 +252,8 @@ public abstract class BaseLogService {
* @param clazz * @param clazz
* @param page * @param page
*/ */
public void queryReportConditionCheck(SaveRequestLogThread thread, long start, NtcReportEntity<?> entity, Class clazz, public void queryReportConditionCheck(AuditLogThread thread, long start, NtcReportEntity<?> entity, Class clazz,
Page page) { Page page) {
logger.info("实时报表统计查询参数校验开始----" + System.currentTimeMillis()); logger.info("实时报表统计查询参数校验开始----" + System.currentTimeMillis());
if (!StringUtil.isBlank(entity.getSearchBusinessType())&&!StringUtil.isNumeric(entity.getSearchBusinessType())) { if (!StringUtil.isBlank(entity.getSearchBusinessType())&&!StringUtil.isNumeric(entity.getSearchBusinessType())) {
logger.error(RestBusinessCode.param_formate_error.getErrorReason()+",searchBusinessType参数格式错误"); logger.error(RestBusinessCode.param_formate_error.getErrorReason()+",searchBusinessType参数格式错误");
@@ -316,7 +316,7 @@ public abstract class BaseLogService {
* @param condition * @param condition
* @param condName * @param condName
*/ */
public void checkNumericCondition(SaveRequestLogThread thread, long start,String condition,String condName) { public void checkNumericCondition(AuditLogThread thread, long start, String condition, String condName) {
if (!StringUtil.isEmpty(condition)){ if (!StringUtil.isEmpty(condition)){
Boolean flag = false; Boolean flag = false;
if (condition.contains(",")) { if (condition.contains(",")) {
@@ -348,8 +348,8 @@ public abstract class BaseLogService {
* @param page * @param page
* 需要校验的page对象 * 需要校验的page对象
*/ */
public void queryConditionCheck(SaveRequestLogThread thread, long start, StatLogEntity entity, Class clazz, public void queryConditionCheck(AuditLogThread thread, long start, StatLogEntity entity, Class clazz,
Page page) { Page page) {
try { try {
if (!StringUtil.isBlank(entity.getSearchStatStartTime())) { if (!StringUtil.isBlank(entity.getSearchStatStartTime())) {
@@ -413,8 +413,8 @@ public abstract class BaseLogService {
* *
* @param entity * @param entity
*/ */
public void queryConditionCheck(SaveRequestLogThread thread, long start, DfJitLogEntity<?> entity, Class clazz, public void queryConditionCheck(AuditLogThread thread, long start, DfJitLogEntity<?> entity, Class clazz,
Page page) { Page page) {
try { try {
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) { if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {
sdf.parse(entity.getSearchReportEndTime()); sdf.parse(entity.getSearchReportEndTime());
@@ -498,8 +498,8 @@ public abstract class BaseLogService {
* *
* @param entity * @param entity
*/ */
public void queryConditionCheck(SaveRequestLogThread thread, long start, DfReportEntity entity, Class clazz, public void queryConditionCheck(AuditLogThread thread, long start, DfReportEntity entity, Class clazz,
Page page) { Page page) {
try { try {
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) { if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {
sdf.parse(entity.getSearchReportEndTime()); sdf.parse(entity.getSearchReportEndTime());

View File

@@ -19,12 +19,12 @@ import java.util.concurrent.CountDownLatch;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.nis.web.service.AuditLogThread;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -60,7 +60,6 @@ import com.nis.web.dao.IpRegionDao;
import com.nis.web.dao.NumRegionDao; import com.nis.web.dao.NumRegionDao;
import com.nis.web.dao.StrRegionDao; import com.nis.web.dao.StrRegionDao;
import com.nis.web.service.BaseService; import com.nis.web.service.BaseService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.SpringContextHolder; import com.nis.web.service.SpringContextHolder;
/** /**
@@ -118,8 +117,8 @@ public class ConfigSourcesService extends BaseService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public void updateConfigSource(SaveRequestLogThread thread, long start, public void updateConfigSource(AuditLogThread thread, long start,
List<ConfigCompile> configSource, Date opTime, StringBuffer sb) { List<ConfigCompile> configSource, Date opTime, StringBuffer sb) {
SqlSessionFactory sqlSessionFactory = SpringContextHolder SqlSessionFactory sqlSessionFactory = SpringContextHolder
.getBean(SqlSessionFactory.class); .getBean(SqlSessionFactory.class);
SqlSession batchSqlSession = null; SqlSession batchSqlSession = null;
@@ -202,9 +201,9 @@ public class ConfigSourcesService extends BaseService {
* @throws Exception * @throws Exception
*/ */
public void updateConfigCompile(SaveRequestLogThread thread, long start, public void updateConfigCompile(AuditLogThread thread, long start,
ConfigCompile config, SqlSession batchSqlSession, Date opTime, ConfigCompile config, SqlSession batchSqlSession, Date opTime,
StringBuffer sb) throws Exception { StringBuffer sb) throws Exception {
List<IpRegion> ipRegionList = config.getIpRegionList(); List<IpRegion> ipRegionList = config.getIpRegionList();
List<StrRegion> strRegionList = config.getStrRegionList(); List<StrRegion> strRegionList = config.getStrRegionList();
List<NumRegion> numRegionList = config.getNumRegionList(); List<NumRegion> numRegionList = config.getNumRegionList();
@@ -295,10 +294,10 @@ public class ConfigSourcesService extends BaseService {
* 当前编译下所有的配置分组关系 * 当前编译下所有的配置分组关系
* @return * @return
*/ */
public void regionUpdate(SaveRequestLogThread thread, long start, public void regionUpdate(AuditLogThread thread, long start,
ConfigCompile config, ConfigCompile config,
List<ConfigGroupRelation> queryCompileGroupByPID, List<ConfigGroupRelation> queryCompileGroupByPID,
SqlSession batchSqlSession, Date opTime, StringBuffer sb) SqlSession batchSqlSession, Date opTime, StringBuffer sb)
throws Exception { throws Exception {
Map<String, Map<Long, List<Long>>> regionMap = getRegionList(thread, Map<String, Map<Long, List<Long>>> regionMap = getRegionList(thread,
System.currentTimeMillis() - start, config, System.currentTimeMillis() - start, config,
@@ -478,7 +477,7 @@ public class ConfigSourcesService extends BaseService {
} }
public Map<String, Map<Long, List<Long>>> getRegionList( public Map<String, Map<Long, List<Long>>> getRegionList(
SaveRequestLogThread thread, long start, ConfigCompile config, AuditLogThread thread, long start, ConfigCompile config,
List<ConfigGroupRelation> queryCompileGroupByPID, List<ConfigGroupRelation> queryCompileGroupByPID,
SqlSession batchSqlSession, StringBuffer sb) { SqlSession batchSqlSession, StringBuffer sb) {
Map<String, Map<Long, List<Long>>> map = new HashMap<String, Map<Long, List<Long>>>(); Map<String, Map<Long, List<Long>>> map = new HashMap<String, Map<Long, List<Long>>>();
@@ -651,7 +650,7 @@ public class ConfigSourcesService extends BaseService {
* @param configSource * @param configSource
* @throws Exception * @throws Exception
*/ */
public void insertConfigSourceData(SaveRequestLogThread thread, public void insertConfigSourceData(AuditLogThread thread,
long _start, List<ConfigCompile> configSource, StringBuffer sb) { long _start, List<ConfigCompile> configSource, StringBuffer sb) {
SqlSessionFactory sqlSessionFactory = SpringContextHolder SqlSessionFactory sqlSessionFactory = SpringContextHolder
.getBean(SqlSessionFactory.class); .getBean(SqlSessionFactory.class);
@@ -717,7 +716,7 @@ public class ConfigSourcesService extends BaseService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
private String insertConfigComLileData(SaveRequestLogThread thread, private String insertConfigComLileData(AuditLogThread thread,
long start, List<ConfigCompile> configCompileList, StringBuffer sb) long start, List<ConfigCompile> configCompileList, StringBuffer sb)
throws Exception { throws Exception {
@@ -1009,8 +1008,8 @@ public class ConfigSourcesService extends BaseService {
* @param sb * @param sb
* @return * @return
*/ */
public String saveMaatConfig(SaveRequestLogThread thread, long start, public String saveMaatConfig(AuditLogThread thread, long start,
List<ConfigCompile> configCompileList, StringBuffer sb) { List<ConfigCompile> configCompileList, StringBuffer sb) {
// List<MaatConfig> maatConfigList = new ArrayList<MaatConfig>(); // List<MaatConfig> maatConfigList = new ArrayList<MaatConfig>();
// List<Integer> serviceList = new ArrayList<Integer>(); // List<Integer> serviceList = new ArrayList<Integer>();
Map<Integer, List<MaatConfig>> maatMap = new HashMap<Integer, List<MaatConfig>>(); Map<Integer, List<MaatConfig>> maatMap = new HashMap<Integer, List<MaatConfig>>();
@@ -1379,8 +1378,8 @@ public class ConfigSourcesService extends BaseService {
return dstMap; return dstMap;
} }
public String updateConfigSources(SaveRequestLogThread thread, long start, public String updateConfigSources(AuditLogThread thread, long start,
List<ConfigCompile> compileList, Date opTime, StringBuffer sb) { List<ConfigCompile> compileList, Date opTime, StringBuffer sb) {
Map<Integer, List<Long>> compileMap = new HashMap<Integer, List<Long>>(); Map<Integer, List<Long>> compileMap = new HashMap<Integer, List<Long>>();
if (null != compileList && compileList.size() > 0) { if (null != compileList && compileList.size() > 0) {
for (ConfigCompile config : compileList) { for (ConfigCompile config : compileList) {
@@ -1459,8 +1458,8 @@ public class ConfigSourcesService extends BaseService {
return "ok"; return "ok";
} }
public String saveByJDBCThread(SaveRequestLogThread thread, long start, public String saveByJDBCThread(AuditLogThread thread, long start,
List<ConfigCompile> configCompileList, StringBuffer sb) { List<ConfigCompile> configCompileList, StringBuffer sb) {
List<ConfigGroupRelation> groupRelationList = new ArrayList<ConfigGroupRelation>(); List<ConfigGroupRelation> groupRelationList = new ArrayList<ConfigGroupRelation>();
Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>(); Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>();
Map<String, List<StrRegion>> strStongRegionMap = new HashMap<String, List<StrRegion>>(); Map<String, List<StrRegion>> strStongRegionMap = new HashMap<String, List<StrRegion>>();
@@ -1774,8 +1773,8 @@ public class ConfigSourcesService extends BaseService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public String updateByJDBCThread(SaveRequestLogThread thread, long start, public String updateByJDBCThread(AuditLogThread thread, long start,
List<ConfigCompile> compileList, Date opTime, StringBuffer sb) { List<ConfigCompile> compileList, Date opTime, StringBuffer sb) {
List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>(); List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>();
List<ConfigGroupRelation> groupRelationAllList = new ArrayList<ConfigGroupRelation>(); List<ConfigGroupRelation> groupRelationAllList = new ArrayList<ConfigGroupRelation>();
Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>(); Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>();
@@ -2193,8 +2192,8 @@ public class ConfigSourcesService extends BaseService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public String updateByJDBCThread12(SaveRequestLogThread thread, long start, public String updateByJDBCThread12(AuditLogThread thread, long start,
List<ConfigCompile> compileList, Date opTime, StringBuffer sb) { List<ConfigCompile> compileList, Date opTime, StringBuffer sb) {
List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>(); List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>();
List<ConfigGroupRelation> groupRelationAllList = new ArrayList<ConfigGroupRelation>(); List<ConfigGroupRelation> groupRelationAllList = new ArrayList<ConfigGroupRelation>();
Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>(); Map<String, List<StrRegion>> strRegionMap = new HashMap<String, List<StrRegion>>();
@@ -2420,8 +2419,8 @@ public class ConfigSourcesService extends BaseService {
* @param sb * @param sb
* @return * @return
*/ */
public String updateByJDBCThread3(SaveRequestLogThread thread, long start, public String updateByJDBCThread3(AuditLogThread thread, long start,
List<ConfigCompile> compileList, Date opTime, StringBuffer sb) { List<ConfigCompile> compileList, Date opTime, StringBuffer sb) {
List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>(); List<ConfigCompile> compileAllList = new ArrayList<ConfigCompile>();
if (null != compileList && compileList.size() > 0) { if (null != compileList && compileList.size() > 0) {
for (ConfigCompile config : compileList) { for (ConfigCompile config : compileList) {
@@ -2545,7 +2544,7 @@ public class ConfigSourcesService extends BaseService {
* @return * @return
*/ */
public Map<String, Map<Long, List<Long>>> getRegionList( public Map<String, Map<Long, List<Long>>> getRegionList(
SaveRequestLogThread thread, long start, ConfigCompile config, AuditLogThread thread, long start, ConfigCompile config,
List<ConfigGroupRelation> queryCompileGroupByPID, StringBuffer sb) { List<ConfigGroupRelation> queryCompileGroupByPID, StringBuffer sb) {
Map<String, Map<Long, List<Long>>> map = new HashMap<String, Map<Long, List<Long>>>(); Map<String, Map<Long, List<Long>>> map = new HashMap<String, Map<Long, List<Long>>>();
Map<String, String> updateTableMap = new HashMap<String, String>(); Map<String, String> updateTableMap = new HashMap<String, String>();
@@ -2724,8 +2723,8 @@ public class ConfigSourcesService extends BaseService {
return "ok"; return "ok";
} }
public String saveCommonSources(SaveRequestLogThread thread, long start, public String saveCommonSources(AuditLogThread thread, long start,
String jsonString, StringBuffer sb) { String jsonString) {
CompileVal.setBusinessCode(null); CompileVal.setBusinessCode(null);
JsonArray jsonObjectList = new JsonParser().parse(jsonString) JsonArray jsonObjectList = new JsonParser().parse(jsonString)
.getAsJsonArray(); .getAsJsonArray();
@@ -3026,7 +3025,6 @@ public class ConfigSourcesService extends BaseService {
try { try {
configRedisService.saveUnMaatConfig(configMap); configRedisService.saveUnMaatConfig(configMap);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception
logger.error(e.getMessage()); logger.error(e.getMessage());
CompileVal.setBusinessCode(RestBusinessCode.unknow_error.getValue()); CompileVal.setBusinessCode(RestBusinessCode.unknow_error.getValue());
if (e.getMessage().startsWith("后台错误:")) { if (e.getMessage().startsWith("后台错误:")) {
@@ -3039,8 +3037,8 @@ public class ConfigSourcesService extends BaseService {
return "ok"; return "ok";
} }
public String updateCommonSources(SaveRequestLogThread thread, long start, public String updateCommonSources(AuditLogThread thread, long start,
String jsonString, Date opTime, StringBuffer sb) { String jsonString, Date opTime, StringBuffer sb) {
JsonArray jsonObjectList = null; JsonArray jsonObjectList = null;
try { try {
jsonObjectList = new JsonParser().parse(jsonString) jsonObjectList = new JsonParser().parse(jsonString)

View File

@@ -9,15 +9,12 @@ import org.springframework.stereotype.Service;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyConvertUrl; import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.domain.restful.DfKeyMailAdd;
import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestBusinessCode; import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyConvertUrlDao; import com.nis.web.dao.DfKeyConvertUrlDao;
import com.nis.web.dao.IntervalTimeSearchDao;
import com.nis.web.service.BaseLogService; import com.nis.web.service.BaseLogService;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
/** /**
* @ClassName: DfKeyConvertUrlService * @ClassName: DfKeyConvertUrlService
@@ -54,7 +51,7 @@ public class DfKeyConvertUrlService extends BaseLogService {
* wx * wx
* @param entity * @param entity
*/ */
public void queryConditionCheck(SaveRequestLogThread thread,long start,DfKeyConvertUrl entity,Page page) { public void queryConditionCheck(AuditLogThread thread, long start, DfKeyConvertUrl entity, Page page) {
try { try {
if (!StringUtil.isBlank(entity.getSearchId())) { if (!StringUtil.isBlank(entity.getSearchId())) {

View File

@@ -14,7 +14,7 @@ import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyMailAddDao; import com.nis.web.dao.DfKeyMailAddDao;
import com.nis.web.service.BaseLogService; import com.nis.web.service.BaseLogService;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
/** /**
* @ClassName: DfKeyMailAddService * @ClassName: DfKeyMailAddService
@@ -43,7 +43,7 @@ public class DfKeyMailAddService extends BaseLogService {
/** /**
* 查询条件检查 * 查询条件检查
*/ */
public void queryConditionCheck(SaveRequestLogThread thread, long start, DfKeyMailAdd entity, Page page) { public void queryConditionCheck(AuditLogThread thread, long start, DfKeyMailAdd entity, Page page) {
try { try {
if (!StringUtil.isBlank(entity.getSearchId())) { if (!StringUtil.isBlank(entity.getSearchId())) {
Long.parseLong(entity.getSearchId()); Long.parseLong(entity.getSearchId());

View File

@@ -11,6 +11,7 @@ package com.nis.web.service.restful;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -21,7 +22,6 @@ import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.dao.DnsGroupTypeDao; import com.nis.web.dao.DnsGroupTypeDao;
import com.nis.web.service.CrudService; import com.nis.web.service.CrudService;
import com.nis.web.service.SaveRequestLogThread;
/** /**
* @ClassName: DnsGroupTypeService.java * @ClassName: DnsGroupTypeService.java
@@ -41,7 +41,7 @@ public class DnsGroupTypeService extends CrudService<DnsGroupTypeDao, DnsGroupTy
public DnsGroupType findById(long id) { public DnsGroupType findById(long id) {
return get(id); return get(id);
} }
public void saveDnsGroupTypeBatch(SaveRequestLogThread thread,long start,List<DnsGroupType> entity) { public void saveDnsGroupTypeBatch(AuditLogThread thread, long start, List<DnsGroupType> entity) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
List<Integer> idsList=new ArrayList<>(); List<Integer> idsList=new ArrayList<>();
for(DnsGroupType e:entity){ for(DnsGroupType e:entity){
@@ -55,7 +55,7 @@ public class DnsGroupTypeService extends CrudService<DnsGroupTypeDao, DnsGroupTy
} }
super.saveBatch(entity,DnsGroupTypeDao.class); super.saveBatch(entity,DnsGroupTypeDao.class);
} }
public void updateDnsGroupTypeBatch(SaveRequestLogThread thread,long start,List<DnsGroupType> entity) { public void updateDnsGroupTypeBatch(AuditLogThread thread, long start, List<DnsGroupType> entity) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// List<Integer> idsList=new ArrayList<>(); // List<Integer> idsList=new ArrayList<>();
// for(DnsGroupType e:entity){ // for(DnsGroupType e:entity){

View File

@@ -9,7 +9,6 @@
package com.nis.web.service.restful; package com.nis.web.service.restful;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +21,7 @@ import com.nis.restful.RestServiceException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.dao.DnsResponseStrategyDao; import com.nis.web.dao.DnsResponseStrategyDao;
import com.nis.web.service.CrudService; import com.nis.web.service.CrudService;
import com.nis.web.service.SaveRequestLogThread; import com.nis.web.service.AuditLogThread;
/** /**
* @ClassName: DnsResponseStrategy.java * @ClassName: DnsResponseStrategy.java
@@ -64,7 +63,7 @@ public class DnsResponseStrategyService extends CrudService<DnsResponseStrategyD
* @exception * @exception
* @since 1.0.0 * @since 1.0.0
*/ */
public void saveDnsResponseStrategyBatch(SaveRequestLogThread thread,long start,List<DnsResponseStrategy> entity) { public void saveDnsResponseStrategyBatch(AuditLogThread thread, long start, List<DnsResponseStrategy> entity) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
List idsList=new ArrayList<>(); List idsList=new ArrayList<>();
for(DnsResponseStrategy e:entity){ for(DnsResponseStrategy e:entity){
@@ -103,7 +102,7 @@ public class DnsResponseStrategyService extends CrudService<DnsResponseStrategyD
* @exception * @exception
* @since 1.0.0 * @since 1.0.0
*/ */
public void updateDnsResponseStrategyBatch(SaveRequestLogThread thread,long start,List<DnsResponseStrategy> entity) { public void updateDnsResponseStrategyBatch(AuditLogThread thread, long start, List<DnsResponseStrategy> entity) {
// List idsList=new ArrayList<>(); // List idsList=new ArrayList<>();
// for(DnsResponseStrategy e:entity){ // for(DnsResponseStrategy e:entity){
// if(e.getReqStrateId()!=null) // if(e.getReqStrateId()!=null)

View File

@@ -3,19 +3,18 @@ package com.nis.web.service.restful;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.domain.restful.DjFlowControlStop; import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestBusinessCode; import com.nis.restful.RestBusinessCode;
import com.nis.restful.RestServiceException; import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.web.dao.IntervalTimeSearchDao; import com.nis.web.dao.IntervalTimeSearchDao;
import com.nis.web.service.BaseLogService; import com.nis.web.service.BaseLogService;
import com.nis.web.service.SaveRequestLogThread;
/** /**
* @ClassName: IntervalTimeSearchService * @ClassName: IntervalTimeSearchService
@@ -51,7 +50,7 @@ public class IntervalTimeSearchService extends BaseLogService {
* wx * wx
* @param entity * @param entity
*/ */
public void queryConditionCheck(SaveRequestLogThread thread,long start,DjFlowControlStop entity,Page page) { public void queryConditionCheck(AuditLogThread thread, long start, DjFlowControlStop entity, Page page) {
/*try { /*try {
if (!StringUtil.isBlank(entity.getSearchCfgId())) { if (!StringUtil.isBlank(entity.getSearchCfgId())) {
Long.parseLong(entity.getSearchCfgId()); Long.parseLong(entity.getSearchCfgId());