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:
* @Description: TODO
* @param 入参
* @param
*/
public ConfigSource() {
this.version = DEFAULT_VERSION;

View File

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

View File

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

View File

@@ -17,6 +17,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.log4j.Logger;
import org.springframework.http.HttpStatus;
@@ -31,7 +32,6 @@ import com.nis.restful.RestResult;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.util.DateUtils;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
/**
@@ -63,7 +63,7 @@ public class BaseRestController {
* @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) {
RestResult restResult = new RestResult();
String requestMethod = request.getMethod();
@@ -109,7 +109,7 @@ public class BaseRestController {
* 2016年8月24日 下午8:40:44
* @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) {
RestResult restResult = new RestResult();
String requestMethod = request.getMethod();
@@ -191,7 +191,7 @@ public class BaseRestController {
* 2016年8月24日 下午8:40:44
* @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) {
RestResult restResult = new RestResult();
String requestMethod = request.getMethod();
@@ -229,7 +229,7 @@ public class BaseRestController {
* @param logSource
* @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) {
RestResult restResult = new RestResult();
String requestMethod = request.getMethod();
@@ -314,7 +314,7 @@ public class BaseRestController {
* @exception @since
* 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) {
switch (need) {
case Constants.OPACTION_POST:
@@ -338,7 +338,7 @@ public class BaseRestController {
+ ",对应的请求方式为" + convertOpAction(opAction) + "!",
RestBusinessCode.op_action_error.getValue());
default:
throw new RestServiceException(thread, time, "操作行为错误,未找到对应的服务!",
throw new RestServiceException(thread, time, "操作行为错误,未找到属性opAction对应业务!",
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) {
logger.debug("SaveRequestLogThread初始化开始----" + System.currentTimeMillis());
SaveRequestLogThread thread = SaveRequestLogThread.getNewSaveRequestLogThread(request);
AuditLogThread thread = AuditLogThread.getNewSaveRequestLogThread(request);
thread.setService(service);
thread.setOpAction(opAction);
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) {
SaveRequestLogThread thread = SaveRequestLogThread.getNewSaveRequestLogThread(request);
AuditLogThread thread = AuditLogThread.getNewSaveRequestLogThread(request);
thread.setService(service);
// thread.setContent(fileInfo);
thread.setOpAction(opAction);

View File

@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
@@ -63,7 +63,7 @@ public class ConfigFileController extends BaseRestController {
"opTime:"+configFile.getOpTime()
);
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");
try {
MultipartFile[] files=configFile.getFiles();
@@ -116,7 +116,7 @@ public class ConfigFileController extends BaseRestController {
HttpServletResponse response){
long start=System.currentTimeMillis();
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;
BufferedOutputStream bos = null;
String downLoadPath=null;

View File

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

View File

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

View File

@@ -11,6 +11,7 @@ import com.nis.util.Constants;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
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 com.nis.util.JsonMapper;
import com.nis.web.controller.BaseController;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DashboardService;
import com.wordnik.swagger.annotations.Api;
@@ -43,7 +42,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "协议统计", httpMethod = "GET", notes = "对应协议统计实时统计查询服务。")
public Map<String,?> trafficProtocol(Model model, HttpServletRequest request, HttpServletResponse response){
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>();
try {
List<Map> ipActiveChart = dashboardService.protocolChart();
@@ -74,7 +73,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String,?> trafficIpActive(Model model, HttpServletRequest request, HttpServletResponse response) {
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>();
try {
List<LinkedHashMap> ipActiveChart = dashboardService.ipActiveChart();
@@ -100,7 +99,7 @@ public class DashboardServiceController extends BaseRestController {
public Map<String, ?> trafficApp(Model model, HttpServletRequest request, HttpServletResponse response) {
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>();
try {
List<Map> appChart = dashboardService.appChart();
@@ -122,7 +121,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "操作系统流量分析统计", httpMethod = "GET", notes = "对应终端用户的操作系统列表显示")
public Map<String,?> trafficOsList(Model model, HttpServletRequest request, HttpServletResponse response) {
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>();
try {
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) {
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>();
try {
List<Map> osChart = dashboardService.getBrowserBySystem(osType);
@@ -167,7 +166,7 @@ public class DashboardServiceController extends BaseRestController {
@ApiOperation(value = "浏览器流量分析统计", httpMethod = "GET", notes = "对应终端用户的浏览器列表显示")
public Map<String, ?> trafficBsList(Model model, HttpServletRequest request, HttpServletResponse response) {
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>();
try {
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) {
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>();
try {
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) {
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>();
try {
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) {
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>();
try {
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.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
@@ -19,7 +20,6 @@ import com.nis.listener.SystemConfigListener;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DataDictionaryService;
@@ -36,7 +36,7 @@ public class DataDictionaryController extends BaseRestController {
public Map findAllDataDict(DataDictionaryValue dataDictionaryValue, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
dataDictionaryValue);
Page page = new Page();
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)
public Map getAllDictName(HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request,
null);
try {
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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
String option = "";
@@ -98,7 +98,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/delDictVal", method = RequestMethod.POST)
public Map delDictVal(String dictValId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
String saveDataDict = dataDictionaryService.delDictVal(dictValId);
@@ -116,7 +116,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/delDictName", method = RequestMethod.POST)
public Map delDictName(String dictNameId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
String saveDataDict = dataDictionaryService.delDictName(dictNameId);
@@ -133,7 +133,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/getDict", method = RequestMethod.POST)
public Map getDict(String dictValId, ModelMap map, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
DataDictionaryValue dict = dataDictionaryService.getDict(dictValId);
@@ -156,7 +156,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/updateDictName", method = RequestMethod.POST)
public Map updateDictName(String dictVal, String dictId, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
String option = "updateVal";
@@ -175,7 +175,7 @@ public class DataDictionaryController extends BaseRestController {
@RequestMapping(value = "/cfg/v1/setDataDictEffective", method = RequestMethod.POST)
public Map setDataDictEffective(HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
null);
try {
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.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfIpPortUdpService;
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")
public Map saveDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response) {
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);
try{
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")
public Map updateDfIpPortUdpBatch(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
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")
public Map deleteDfIpPortUdp(@PathVariable("cfgId") long id, HttpServletRequest request, HttpServletResponse response){
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{
dfIpPortUdpService.removeDfIpPortUdp(id);
@@ -185,7 +185,7 @@ public class DfIpPortUdpController extends BaseRestController {
@ApiOperation(value = "删除IP+端口Udp协议G设备封堵配置", httpMethod = "DELETE", notes = "delete ip port udp")
public Map deleteDfIpPortUdp(@RequestBody DfIpPortUdpSource dfIpPortUdpSource, HttpServletRequest request, HttpServletResponse response){
long start=System.currentTimeMillis();
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);
try{
dfIpPortUdpService.removeDfIpPortUdpBatch(dfIpPortUdpSource.getDfIpPortUdpList());

View File

@@ -26,7 +26,7 @@ import com.nis.domain.restful.DfKeyConvertUrl;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyConvertUrlService;
import com.wordnik.swagger.annotations.ApiOperation;
@@ -66,7 +66,7 @@ public class DfKeyConvertUrlController extends BaseRestController{
}
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);

View File

@@ -13,6 +13,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
@@ -26,7 +27,6 @@ import com.nis.domain.restful.DfKeyMailAdd;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DfKeyMailAddService;
import com.wordnik.swagger.annotations.ApiOperation;
@@ -66,7 +66,7 @@ public class DfKeyMailAddController extends BaseRestController {
}
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);

View File

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

View File

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

View File

@@ -14,6 +14,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
@@ -30,7 +31,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsFakeInfoService;
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")
public Map saveDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response) {
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);
try{
if(chekckData(dnsFakeInfoSource,false)){
@@ -111,7 +111,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "更新DNS欺骗信息", httpMethod = "PUT", notes = "update dns fake info")
public Map updateDnsFakeInfoBatch(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
if(chekckData(dnsFakeInfoSource,true)){
@@ -152,7 +152,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
public Map deleteDnsFakeInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
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{
boolean isValid=dnsFakeInfoService.isValid(id);
if(!isValid){
@@ -196,7 +196,7 @@ public class DnsFakeInfoController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗信息", httpMethod = "DELETE", notes = "delete dns fake info")
public Map deleteDnsFakeInfo(@RequestBody DnsFakeInfoSource dnsFakeInfoSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
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.StringUtil;
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.restful.DnsFakeIpService;
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")
public Map saveDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response) {
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);
try{
if(chekckData(dnsFakeIpSource,false)){
@@ -107,7 +107,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "更新DNS欺骗IP地址", httpMethod = "PUT", notes = "update dns fake ip")
public Map updateDnsFakeIpBatch(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
if(chekckData(dnsFakeIpSource,true)){
@@ -147,7 +147,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
public Map deleteDnsFakeIp(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
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{
boolean isValid=dnsFakeIpService.isValid(id);
if(!isValid){
@@ -191,7 +191,7 @@ public class DnsFakeIpController extends BaseRestController {
@ApiOperation(value = "删除DNS欺骗IP地址", httpMethod = "DELETE", notes = "delete dns fake ip")
public Map deleteDnsFakeIp(@RequestBody DnsFakeIpSource dnsFakeIpSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
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.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
@@ -29,7 +30,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsGroupTypeService;
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")
public Map saveDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response) {
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);
try{
// if(chekckData(dnsGroupTypeSource/*,false*/))
@@ -112,7 +112,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "更新DNS分组类型", httpMethod = "PUT", notes = "update dns group type")
public Map updateDnsGroupTypeBatch(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
// if(chekckData(dnsGroupTypeSource/*,true*/))
@@ -154,7 +154,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
public Map deleteDnsGroupType(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
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{
boolean isValid=dnsGroupTypeService.isValid(id);
if(!isValid){
@@ -198,7 +198,7 @@ public class DnsGroupTypeController extends BaseRestController {
@ApiOperation(value = "删除DNS分组类型", httpMethod = "DELETE", notes = "delete dns group type")
public Map deleteDnsGroupType(@RequestBody DnsGroupTypeSource dnsGroupTypeSource, HttpServletRequest request, HttpServletResponse response){
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);
try{
boolean isValid=dnsGroupTypeService.isValid(dnsGroupTypeSource.getDnsGroupTypeList());
@@ -234,7 +234,7 @@ public class DnsGroupTypeController extends BaseRestController {
* @exception
* @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()){
if(dnsGroupType.getOpTime()==null)
dnsGroupType.setOpTime(entity.getOpTime());

View File

@@ -30,7 +30,7 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.DnsResponseStrategyService;
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")
public Map saveDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response) {
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);
try{
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")
public Map updateDnsResponseStrategyBatch(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
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);
try{
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")
public Map deleteDnsResponseStrategy(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
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{
boolean isValid=dnsResponseStrategyService.isValid(id);
if(!isValid){
@@ -192,7 +192,7 @@ public class DnsResponseStrategyController extends BaseRestController {
@ApiOperation(value = "删除DNS响应策略", httpMethod = "DELETE", notes = "delete dns response strategy")
public Map deleteDnsResponseStrategy(@RequestBody DnsResponseStrategySource dnsResponseStrategySource, HttpServletRequest request, HttpServletResponse response){
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);
try{
boolean isValid=dnsResponseStrategyService.isValid(dnsResponseStrategySource.getDnsResponseStrategyList());
@@ -225,7 +225,7 @@ public class DnsResponseStrategyController extends BaseRestController {
* @exception
* @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();
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时可以为空
if(opAction==Constants.OPACTION_PUT&&dnsResponseStrategy.getReqStrateId()==null)return;
if(dnsResponseStrategy.getReqStrateId()==null){

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ import com.nis.domain.restful.DjFlowControlStop;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.IntervalTimeSearchService;
import com.wordnik.swagger.annotations.ApiOperation;
@@ -67,7 +67,7 @@ public class IntervalTimeSearchController extends BaseRestController{
}
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);

View File

@@ -10,6 +10,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -54,7 +55,6 @@ import com.nis.util.HiveJDBC;
import com.nis.util.JsonMapper;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.HiveSqlService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.LogTestService;
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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<NtcIpLog> ntcIpLogPage = null;
try {
@@ -152,7 +152,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcHttpLogs(Page page, NtcHttpLog ntcHttpLog, Model model, HttpServletRequest request,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<NtcL2tpLog> ntcL2tpLogPage = null;
@@ -511,7 +511,7 @@ public class LogController extends BaseRestController {
public Map<String, ?> ntcOpenvpnLogs(Page page, NtcOpenvpnLog ntcOpenvpnLog, Model model,
HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, 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,
HttpServletResponse response) {
long start = System.currentTimeMillis();
SaveRequestLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
AuditLogThread saveLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
request, null);
Page<?> reportPage = null;

View File

@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.UUID;
import com.nis.domain.restful.*;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
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.ServiceAndRDBIndexReal;
import com.nis.util.StringUtil;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.ConfigRedisService;
import com.nis.web.service.restful.ConfigSourcesService;
@@ -381,7 +381,7 @@ public class MaatTestController {
List<String> list = new ArrayList<String>();
for (int a = 0; a < forCount; a++) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = new SaveRequestLogThread();
AuditLogThread thread = new AuditLogThread();
StringBuffer sb = new StringBuffer();
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
for (int i = 0; i < saveCount; i++) {
@@ -413,7 +413,7 @@ public class MaatTestController {
public String testSaveMaat(@RequestParam(required = true) Integer service,
@RequestParam(required = true) Integer saveCount) {
long start = System.currentTimeMillis();
SaveRequestLogThread thread = new SaveRequestLogThread();
AuditLogThread thread = new AuditLogThread();
StringBuffer sb = new StringBuffer();
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
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 com.nis.domain.Page;
import com.nis.domain.ServicesRequestLog;
import com.nis.domain.restful.ServicesRequestLogBean;
import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
import com.nis.web.service.ServicesRequestLogService;
@RestController
@@ -31,7 +30,7 @@ public class ServicesRequestLogController extends BaseRestController {
Page<ServicesRequestLogBean> queryAllCompile = null;
long start = System.currentTimeMillis();
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
log);
try {
queryAllCompile = servicesRequestLogService

View File

@@ -5,6 +5,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.nis.web.service.AuditLogThread;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
@@ -20,7 +21,6 @@ import com.nis.util.Constants;
import com.nis.util.OracleErrorCodeUtil;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseRestController;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.ServicesRequestLogService;
import com.nis.web.service.restful.SystemFunStatusService;
import com.wordnik.swagger.annotations.ApiOperation;
@@ -59,7 +59,7 @@ public class SystemFunStatusController extends BaseRestController {
HttpServletRequest request, HttpServletResponse response) {
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);
try{
@@ -100,7 +100,7 @@ public class SystemFunStatusController extends BaseRestController {
HttpServletRequest request, HttpServletResponse response){
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);
try{

View File

@@ -33,8 +33,8 @@ import com.nis.datasource.CustomerContextHolder;
* @date 2016年10月14日 下午6:26:41
* @version V1.0
*/
public class SaveRequestLogThread implements Runnable {
private Logger logger = Logger.getLogger(SaveRequestLogThread.class);
public class AuditLogThread implements Runnable {
private Logger logger = Logger.getLogger(AuditLogThread.class);
private ServicesRequestLogService service;
private String remoteAddr;
private String requestURI;
@@ -58,10 +58,8 @@ public class SaveRequestLogThread implements Runnable {
@Override
public void run() {
logger.info("线程开始执行!");
// 新开线程切换数据源不影响action中的数据源
CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_B);// 开启数据源B
// TODO Auto-generated method stub
CustomerContextHolder.setCustomerType(CustomerContextHolder.DATA_SOURCE_A);// 开启数据源B
if (service != null) {
service.saveRequestLog(remoteAddr, requestURI, queryString, contextPath, operator, version, opAction,
opTime, content, requestTime, consumerTime, businessCode, exceptionInfo, traceCode);
@@ -71,12 +69,12 @@ public class SaveRequestLogThread implements Runnable {
CustomerContextHolder.clearCustomerType();
}
public SaveRequestLogThread() {
public AuditLogThread() {
super();
}
/**
* 创建一个新的实例 SaveRequestLogThread.
* 创建一个新的实例 AuditLogThread.
*
* @param service
* @param requestURI
@@ -90,7 +88,7 @@ public class SaveRequestLogThread implements Runnable {
* @param requestTime
* @param consumerTime
*/
public SaveRequestLogThread(ServicesRequestLogService service, String remoteAddr, String requestURI,
public AuditLogThread(ServicesRequestLogService service, String remoteAddr, String requestURI,
String queryString, String contextPath, String operator, String version, int opAction, Date opTime,
Object content, Date requestTime, long consumerTime, String exceptionInfo) {
super();
@@ -109,7 +107,7 @@ public class SaveRequestLogThread implements Runnable {
this.exceptionInfo = exceptionInfo;
}
public SaveRequestLogThread(ServicesRequestLogService service, String operator, String version, int opAction,
public AuditLogThread(ServicesRequestLogService service, String operator, String version, int opAction,
Date opTime, Object content, Date requestTime, long consumerTime, String exceptionInfo) {
super();
this.service = service;
@@ -176,8 +174,8 @@ public class SaveRequestLogThread implements Runnable {
return sb.toString();
}
public static SaveRequestLogThread getNewSaveRequestLogThread(HttpServletRequest request) {
SaveRequestLogThread thread = new SaveRequestLogThread();
public static AuditLogThread getNewSaveRequestLogThread(HttpServletRequest request) {
AuditLogThread thread = new AuditLogThread();
thread.setRemoteAddr(request.getRemoteAddr());
thread.setRequestURI(request.getRequestURI());
if (request.getMethod().toLowerCase().equals("get")) {

View File

@@ -52,7 +52,7 @@ public abstract class BaseLogService {
* @exception @since
* 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[] orderByColoumn = null;
String notExistColumn = "";
@@ -136,7 +136,7 @@ public abstract class BaseLogService {
* @param clazz
* @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) {
logger.info("请求参数校验开始----" + System.currentTimeMillis());
try {
@@ -252,7 +252,7 @@ public abstract class BaseLogService {
* @param clazz
* @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) {
logger.info("实时报表统计查询参数校验开始----" + System.currentTimeMillis());
if (!StringUtil.isBlank(entity.getSearchBusinessType())&&!StringUtil.isNumeric(entity.getSearchBusinessType())) {
@@ -316,7 +316,7 @@ public abstract class BaseLogService {
* @param condition
* @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)){
Boolean flag = false;
if (condition.contains(",")) {
@@ -348,7 +348,7 @@ public abstract class BaseLogService {
* @param 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) {
try {
@@ -413,7 +413,7 @@ public abstract class BaseLogService {
*
* @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) {
try {
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {
@@ -498,7 +498,7 @@ public abstract class BaseLogService {
*
* @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) {
try {
if (!StringUtil.isBlank(entity.getSearchReportEndTime())) {

View File

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

View File

@@ -9,15 +9,12 @@ import org.springframework.stereotype.Service;
import com.nis.domain.Page;
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.RestServiceException;
import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyConvertUrlDao;
import com.nis.web.dao.IntervalTimeSearchDao;
import com.nis.web.service.BaseLogService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
/**
* @ClassName: DfKeyConvertUrlService
@@ -54,7 +51,7 @@ public class DfKeyConvertUrlService extends BaseLogService {
* wx
* @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 {
if (!StringUtil.isBlank(entity.getSearchId())) {

View File

@@ -14,7 +14,7 @@ import com.nis.restful.RestServiceException;
import com.nis.util.StringUtil;
import com.nis.web.dao.DfKeyMailAddDao;
import com.nis.web.service.BaseLogService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
/**
* @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 {
if (!StringUtil.isBlank(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.List;
import com.nis.web.service.AuditLogThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -21,7 +22,6 @@ import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.dao.DnsGroupTypeDao;
import com.nis.web.service.CrudService;
import com.nis.web.service.SaveRequestLogThread;
/**
* @ClassName: DnsGroupTypeService.java
@@ -41,7 +41,7 @@ public class DnsGroupTypeService extends CrudService<DnsGroupTypeDao, DnsGroupTy
public DnsGroupType findById(long 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
List<Integer> idsList=new ArrayList<>();
for(DnsGroupType e:entity){
@@ -55,7 +55,7 @@ public class DnsGroupTypeService extends CrudService<DnsGroupTypeDao, DnsGroupTy
}
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
// List<Integer> idsList=new ArrayList<>();
// for(DnsGroupType e:entity){

View File

@@ -9,7 +9,6 @@
package com.nis.web.service.restful;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,7 +21,7 @@ import com.nis.restful.RestServiceException;
import com.nis.util.Constants;
import com.nis.web.dao.DnsResponseStrategyDao;
import com.nis.web.service.CrudService;
import com.nis.web.service.SaveRequestLogThread;
import com.nis.web.service.AuditLogThread;
/**
* @ClassName: DnsResponseStrategy.java
@@ -64,7 +63,7 @@ public class DnsResponseStrategyService extends CrudService<DnsResponseStrategyD
* @exception
* @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
List idsList=new ArrayList<>();
for(DnsResponseStrategy e:entity){
@@ -103,7 +102,7 @@ public class DnsResponseStrategyService extends CrudService<DnsResponseStrategyD
* @exception
* @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<>();
// for(DnsResponseStrategy e:entity){
// if(e.getReqStrateId()!=null)

View File

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