Ssl,Pptp,L2tp 日志查询
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.log.NtcL2tpLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/log/ntc/l2tpLogs")
|
||||
public class L2tpLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute("log")NtcL2tpLog ntcL2tpLog) {
|
||||
|
||||
Page<NtcL2tpLog> page = new Page<NtcL2tpLog>(request,response);
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 请求参数判断
|
||||
initLogSearchValue(ntcL2tpLog, params);
|
||||
|
||||
try {
|
||||
// 请求接口
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_L2TP_LOG;
|
||||
String resJson = HttpClientUtil.getMsg(url, params);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcL2tpLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<NtcL2tpLog>>() {}.getType());
|
||||
if(fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcL2tpLog> fromPage = fromJson.getData();
|
||||
BeanUtils.copyProperties(fromPage, page);
|
||||
List<NtcL2tpLog> list = fromPage.getList();
|
||||
for (NtcL2tpLog log : list) {
|
||||
log.setFunctionId(ntcL2tpLog.getFunctionId());
|
||||
setLogAction(log);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
logger.info("L2TP日志查询失败");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "/log/ntc/l2tpLogList";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.log.NtcPptpLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/log/ntc/pptpLogs")
|
||||
public class PptpLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute("log")NtcPptpLog ntcPptpLog) {
|
||||
|
||||
Page<NtcPptpLog> page = new Page<NtcPptpLog>(request,response);
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 请求参数判断
|
||||
initLogSearchValue(ntcPptpLog, params);
|
||||
|
||||
try {
|
||||
// 请求接口
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_PPTP_LOG;
|
||||
String resJson = HttpClientUtil.getMsg(url, params);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcPptpLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<NtcPptpLog>>() {}.getType());
|
||||
if(fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcPptpLog> fromPage = fromJson.getData();
|
||||
BeanUtils.copyProperties(fromPage, page);
|
||||
List<NtcPptpLog> list = fromPage.getList();
|
||||
for (NtcPptpLog log : list) {
|
||||
log.setFunctionId(ntcPptpLog.getFunctionId());
|
||||
setLogAction(log);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
logger.info("PPTP日志查询失败");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "/log/ntc/pptpLogList";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.log.NtcSslLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/log/ntc/sslLogs")
|
||||
public class SslLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute("log")NtcSslLog ntcSslLog) {
|
||||
|
||||
Page<NtcSslLog> page = new Page<NtcSslLog>(request,response);
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 请求参数判断
|
||||
initLogSearchValue(ntcSslLog, params);
|
||||
if(StringUtils.isNotBlank(ntcSslLog.getSni())) {
|
||||
params.put("SearchSni", ntcSslLog.getSni());
|
||||
}
|
||||
try {
|
||||
// 请求接口
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG;
|
||||
String resJson = HttpClientUtil.getMsg(url, params);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcSslLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<NtcSslLog>>() {}.getType());
|
||||
if(fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcSslLog> fromPage = fromJson.getData();
|
||||
BeanUtils.copyProperties(fromPage, page);
|
||||
List<NtcSslLog> list = fromPage.getList();
|
||||
for (NtcSslLog log : list) {
|
||||
log.setFunctionId(ntcSslLog.getFunctionId());
|
||||
setLogAction(log);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
logger.info("SSL日志查询失败");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "/log/ntc/sslLogList";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user