fix(log):日志检索模块,增加SSL、IPSEC、FTP、SSH所有服务接口,删除历史无用接口。
This commit is contained in:
@@ -1,226 +0,0 @@
|
||||
/**
|
||||
*@Title: JdjInfoController.java
|
||||
*@Package com.nis.web.controller.restful
|
||||
*@Description TODO
|
||||
*@author wx
|
||||
*@date 2016年9月7日 下午3:58:16
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.web.controller.restful;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.nis.domain.restful.JdjInfo;
|
||||
import com.nis.domain.restful.JdjInfoSource;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.OracleErrorCodeUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.SaveRequestLogThread;
|
||||
import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.JdjInfoService;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @ClassName: JdjInfoController.java
|
||||
* @Description: TODO
|
||||
* @author (wx)
|
||||
* @date 2016年9月7日 下午3:58:16
|
||||
* @version V1.0
|
||||
*/
|
||||
@RestController
|
||||
//@RequestMapping("${servicePath}/cfg/v1")
|
||||
public class JdjInfoController extends BaseRestController {
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
@Autowired
|
||||
protected JdjInfoService jdjInfoService;
|
||||
@Autowired
|
||||
protected ServicesRequestLogService servicesRequestLogService;
|
||||
// @Autowired
|
||||
// protected CommonConfigService commonConfigService;
|
||||
// @Autowired
|
||||
// protected RedisDao redisDao;
|
||||
/**
|
||||
* saveJdjInfoBatch(多条新增)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param JdjInfoSource
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*Map
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping(value = "/jdjInfoSources", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "保存节点机信息", httpMethod = "POST", notes = "save node info")
|
||||
public Map saveJdjInfoBatch(@RequestBody JdjInfoSource jdjInfoSource, HttpServletRequest request, HttpServletResponse response) {
|
||||
long start=System.currentTimeMillis();
|
||||
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_POST,request, jdjInfoSource);
|
||||
super.checkOpAction(thread,System.currentTimeMillis()-start,jdjInfoSource.getOpAction(), Constants.OPACTION_POST);
|
||||
try{
|
||||
this.chekckData(jdjInfoSource,false);
|
||||
jdjInfoService.saveJdjInfoBatch(jdjInfoSource.getJdjInfoList());
|
||||
// commonConfigService.saveOrUpdateConfigState("JDJ_INFO", jdjInfoSource.getOpTime());
|
||||
// redisDao.saveMaps(jdjInfoSource.getJdjInfoList(), "JDJ_INFO", JdjInfo.class, "id");
|
||||
}catch(Exception e){
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存节点机信息失败", RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存节点机信息成功",jdjInfoSource.getJdjInfoList());
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateJdjInfoBatch(多条更新)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param JdjInfoSource
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*Map
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping(value = "/jdjInfoSources", method = RequestMethod.PUT)
|
||||
@ApiOperation(value = "更新节点机信息", httpMethod = "PUT", notes = "update node info")
|
||||
public Map updateJdjInfoBatch(@RequestBody JdjInfoSource jdjInfoSource, HttpServletRequest request, HttpServletResponse response){
|
||||
long start=System.currentTimeMillis();
|
||||
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_PUT,request, jdjInfoSource);
|
||||
super.checkOpAction(thread,System.currentTimeMillis()-start,jdjInfoSource.getOpAction(), Constants.OPACTION_PUT);
|
||||
try{
|
||||
this.chekckData(jdjInfoSource,true);
|
||||
jdjInfoService.updateJdjInfoBatch(jdjInfoSource.getJdjInfoList());
|
||||
// commonConfigService.saveOrUpdateConfigState("JDJ_INFO", jdjInfoSource.getOpTime());
|
||||
// redisDao.updateMaps(jdjInfoSource.getJdjInfoList(), "JDJ_INFO", JdjInfo.class, "id");
|
||||
}catch(Exception e){
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新节点机信息失败", RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新节点机信息成功",jdjInfoSource.getJdjInfoList());
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteJdjInfo(单条删除)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param id
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*Map
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping(value = "/jdjInfoSources/{id}", method = RequestMethod.DELETE)
|
||||
@ApiOperation(value = "删除节点机信息", httpMethod = "DELETE", notes = "delete node info")
|
||||
public Map deleteJdjInfo(@PathVariable("id") long id, HttpServletRequest request, HttpServletResponse response){
|
||||
long start=System.currentTimeMillis();
|
||||
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, id);
|
||||
try{
|
||||
jdjInfoService.removeJdjInfo(id);
|
||||
// commonConfigService.saveOrUpdateConfigState("JDJ_INFO", new Date());
|
||||
}catch(Exception e){
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除节点机信息失败", RestBusinessCode.unknow_error.getValue());
|
||||
|
||||
}
|
||||
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"删除成功",id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteJdjInfo(多条删除)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param JdjInfoSource
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*Map
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping(value = "/jdjInfoSources", method = RequestMethod.DELETE)
|
||||
@ApiOperation(value = "删除节点机信息", httpMethod = "DELETE", notes = "delete node info")
|
||||
public Map deleteJdjInfo(@RequestBody JdjInfoSource jdjInfoSource, HttpServletRequest request, HttpServletResponse response){
|
||||
long start=System.currentTimeMillis();
|
||||
SaveRequestLogThread thread=super.saveRequestLog(servicesRequestLogService,Constants.OPACTION_DELETE,request, jdjInfoSource);
|
||||
super.checkOpAction(thread,System.currentTimeMillis()-start,jdjInfoSource.getOpAction(), Constants.OPACTION_DELETE);
|
||||
try{
|
||||
jdjInfoService.removeJdjInfoBatch(jdjInfoSource.getJdjInfoList());
|
||||
// commonConfigService.saveOrUpdateConfigState("JDJ_INFO", jdjInfoSource.getOpTime());
|
||||
}catch(Exception e){
|
||||
thread.setExceptionInfo(e.getMessage()+" "+e.getCause());
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"删除节点机信息失败", RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"批量删除成功",jdjInfoSource.getJdjInfoList());
|
||||
}
|
||||
/**
|
||||
*
|
||||
* chekckData(操作验证时间)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param entity
|
||||
* @return
|
||||
*boolean
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private void chekckData(JdjInfoSource entity, boolean update){
|
||||
Date now =new Date();
|
||||
for(JdjInfo jdjInfo :entity.getJdjInfoList()){
|
||||
jdjInfo.setLastUpdate(now);
|
||||
if(jdjInfo.getOpTime()==null)
|
||||
jdjInfo.setOpTime(entity.getOpTime());
|
||||
if(!update){//新增时判断默认值
|
||||
if(jdjInfo.getJcIp()==null)jdjInfo.setJcIp("0.0.0.0");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.nis.web.controller.restful;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.restful.NtcIpLog;
|
||||
import com.nis.domain.restful.*;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.SaveRequestLogThread;
|
||||
@@ -49,10 +49,209 @@ public class LogController extends BaseRestController{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "IP地址日志检索成功", ntcIpLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcHttpLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "HTTP日志查询", httpMethod = "GET", notes = "对应配置为“网站管理-HTTP”,存储动作为阻断与监测的命中日志。对日志功能“网站管理-HTTP”提供数据基础查询服务")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcHttpLog> ntcHttpLogPage = new Page<>();
|
||||
try {
|
||||
ntcHttpLogPage = testService.findNtcHttpLogPage(
|
||||
new Page<NtcHttpLog>(request, response, NtcHttpLog.class), ntcHttpLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "Http日志检索成功", ntcHttpLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcDnsLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "DNS日志查询", httpMethod = "GET", notes = "对应配置为“网站管理-DNS”,存储动作为阻断与监测的命中日志。对日志功能“网站管理-DNS”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcDnsLog> ntcDnsLogPage = new Page<>();
|
||||
try {
|
||||
ntcDnsLogPage = testService.findNtcDnsLogPage(
|
||||
new Page<NtcDnsLog>(request, response, NtcDnsLog.class), ntcDnsLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "Dns日志检索成功", ntcDnsLogPage, 0);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ntcMailLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "EMAIL日志查询", httpMethod = "GET", notes = "对应配置为“邮件管理”,存储动作为阻断与监测的命中日志。对日志功能“邮件管理”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcMailLog> ntcMailLogPage = new Page<>();
|
||||
try {
|
||||
ntcMailLogPage = testService.findNtcMailLogPage(
|
||||
new Page<NtcMailLog>(request, response, NtcMailLog.class), ntcMailLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "Mail日志检索成功", ntcMailLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcSSLLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "SSL日志查询", httpMethod = "GET", notes = "对应配置为“网站管理-SSL”,存储动作为阻断与监测的命中日志。对日志功能“网站管理-SSL”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcSslLog> ntcSslLogPage = new Page<>();
|
||||
try {
|
||||
ntcSslLogPage = testService.findNtcSslLogPage(
|
||||
new Page<NtcSslLog>(request, response, NtcSslLog.class), ntcSslLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "SSL日志检索成功", ntcSslLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcPptpLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "PPTP日志查询", httpMethod = "GET", notes = "对应配置为“隧道管理-PPTP”,存储动作为阻断与监测的命中日志。对日志功能“隧道管理-PPTP”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcPptpLog> ntcPptpLogPage = new Page<>();
|
||||
try {
|
||||
ntcPptpLogPage = testService.findNtcPptpLogPage(
|
||||
new Page<NtcPptpLog>(request, response, NtcPptpLog.class), ntcPptpLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "PPTP日志检索成功", ntcPptpLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcL2tpLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "L2TP日志查询", httpMethod = "GET", notes = "对应配置为“隧道管理-L2TP”,存储动作为阻断与监测的命中日志。对日志功能“隧道管理- L2TP”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcL2tpLog> ntcL2tpLogPage = new Page<>();
|
||||
try {
|
||||
ntcL2tpLogPage = testService.findNtcL2tpLogPage(
|
||||
new Page<NtcL2tpLog>(request, response, NtcL2tpLog.class), ntcL2tpLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "L2TP日志检索成功", ntcL2tpLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcOpenvpnLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "OPENVPN日志查询", httpMethod = "GET", notes = "对应配置为“隧道管理-OPENVPN”,存储动作为阻断与监测的命中日志。对日志功能“隧道管理- OPENVPN”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcOpenvpnLog> ntcOpenvpnLogPage = new Page<>();
|
||||
try {
|
||||
ntcOpenvpnLogPage = testService.findNtcOpenvpnLogPage(
|
||||
new Page<NtcOpenvpnLog>(request, response, NtcOpenvpnLog.class), ntcOpenvpnLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "Openvpn日志检索成功", ntcOpenvpnLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcIpsecLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "IPSEC日志查询", httpMethod = "GET", notes = "对应配置为“隧道管理-IPSEC”,存储动作为监测的命中日志。对日志功能“隧道管理- IPSEC”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcIpsecLog> ntcIpsecLogPage = new Page<>();
|
||||
try {
|
||||
ntcIpsecLogPage = testService.findNtcIpsecLogPage(
|
||||
new Page<NtcIpsecLog>(request, response, NtcIpsecLog.class), ntcIpsecLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "IPSEC日志检索成功", ntcIpsecLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcSshLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "SSH日志查询", httpMethod = "GET", notes = "对应配置为“隧道管理-SSH”,存储动作为阻断与监测的命中日志。对日志功能“隧道管理- SSH”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcSshLog> ntcSshLogPage = new Page<>();
|
||||
try {
|
||||
ntcSshLogPage = testService.findNtcSshLogPage(
|
||||
new Page<NtcSshLog>(request, response, NtcSshLog.class), ntcSshLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "SSH日志检索成功", ntcSshLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ntcFtpLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "FTP日志查询", httpMethod = "GET", notes = "对应配置为“文件传输-FTP”,存储动作为阻断与监测的命中日志。对日志功能“文件传输-FTP”提供数据基础查询服务。")
|
||||
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, request, null);
|
||||
|
||||
Page<NtcFtpLog> ntcFtpLogPage = new Page<>();
|
||||
try {
|
||||
ntcFtpLogPage = testService.findNtcFtpLogPage(
|
||||
new Page<NtcFtpLog>(request, response, NtcSshLog.class), ntcFtpLog);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "FTP日志检索成功", ntcFtpLogPage, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -71,12 +71,16 @@ public class SystemFunStatusController extends BaseRestController {
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
if(e instanceof RestServiceException) {throw e;}
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
if(!StringUtil.isEmpty(info)) {
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存文本系统功能类业务配置失败", RestBusinessCode.unknow_error.getValue());
|
||||
} else {
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"保存文本系统功能类业务配置失败", RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"保存文本系统功能类业务配置成功",systemFunStatusSource.getSystemFunStatusList());
|
||||
}
|
||||
@@ -108,21 +112,25 @@ public class SystemFunStatusController extends BaseRestController {
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
logger.error(e.getCause());
|
||||
if(e instanceof RestServiceException) throw e;
|
||||
if(e instanceof RestServiceException) {throw e; }
|
||||
String info=OracleErrorCodeUtil.getOraCode(e);
|
||||
if(!StringUtil.isEmpty(info))
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread,System.currentTimeMillis()-start,info);
|
||||
else
|
||||
throw new RestServiceException(thread,System.currentTimeMillis()-start,"更新文本系统功能类业务配置失败", RestBusinessCode.unknow_error.getValue());
|
||||
if(!StringUtil.isEmpty(info)) {
|
||||
OracleErrorCodeUtil.throwExceptionInfo(thread, System.currentTimeMillis() - start, info);
|
||||
} else {
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "更新文本系统功能类业务配置失败", RestBusinessCode.unknow_error.getValue());
|
||||
}
|
||||
}
|
||||
return serviceResponse(thread,System.currentTimeMillis()-start,request,response,"更新文本系统功能类业务配置成功",systemFunStatusSource.getSystemFunStatusList());
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void chekckData(SystemFunStatusSource entity) {
|
||||
for (SystemFunStatus systemFunStatus : entity.getSystemFunStatusList()) {
|
||||
if (systemFunStatus.getOpTime() == null)
|
||||
systemFunStatus.setOpTime(entity.getOpTime());
|
||||
if (systemFunStatus.getOpTime() == null) {
|
||||
systemFunStatus.setOpTime(entity.getOpTime());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user