diff --git a/src/main/java/com/nis/domain/log/MmVoipLog.java b/src/main/java/com/nis/domain/log/MmVoipLog.java index a9ae82736..f052e1bfd 100644 --- a/src/main/java/com/nis/domain/log/MmVoipLog.java +++ b/src/main/java/com/nis/domain/log/MmVoipLog.java @@ -18,7 +18,7 @@ public class MmVoipLog extends BaseLogEntity { @ApiModelProperty(value="VOIP通话时长(秒)", required=true) private String duation; @ApiModelProperty(value="VOIP协议", required=true) - private String protocol; + private String voipProtocol; @ApiModelProperty(value="主叫VOIP账号", required=false) private String callingAccount; @ApiModelProperty(value="被叫VOIP账号", required=false) @@ -68,11 +68,11 @@ public class MmVoipLog extends BaseLogEntity { public void setFdType(Integer fdType) { this.fdType = fdType; } - public String getProtocol() { - return protocol; + public String getVoipProtocol() { + return voipProtocol; } - public void setProtocol(String protocol) { - this.protocol = protocol; + public void setVoipProtocol(String voipProtocol) { + this.voipProtocol = voipProtocol; } public String getDuation() { return duation; diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 03908cb84..433a09c15 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -380,7 +380,10 @@ public final class Constants { public static final String NTC_DDOS_LOG = Configurations.getStringProperty("ntcDdosLog", ""); public static final String NTC_DKBEHAVIOR_LOG = Configurations.getStringProperty("dkBehaviorLog", ""); public static final String NTC_MMVOIP_LOG = Configurations.getStringProperty("mmVoipLog", ""); + public static final String NTC_MMSAMPLE_VOIP_LOG = Configurations.getStringProperty("mmSampleVoipLog", ""); public static final String NTC_MMAVIP_LOG = Configurations.getStringProperty("mmAvIpLog", ""); + public static final String NTC_MMPORNAUDIOSAMPLE_LOG = Configurations.getStringProperty("mmPornAudioLevelLog", ""); + public static final String NTC_MMPORNVIDEOSAMPLE_LOG = Configurations.getStringProperty("mmPornVideoLevelLog", ""); public static final String NTC_MMAVURL_LOG = Configurations.getStringProperty("mmAvUrlLog", ""); public static final String NTC_MMPICIP_LOG = Configurations.getStringProperty("mmPicIpLog", ""); public static final String NTC_MMPICURL_LOG = Configurations.getStringProperty("mmPicUrlLog", ""); diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 0bb0c843a..3bdc0473f 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -588,7 +588,7 @@ public class BaseController { public void setLogAction(BaseLogEntity log) { List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); for (FunctionServiceDict dict : serviceList) { - if (dict.getServiceId().intValue() == log.getService().intValue()) { + if (dict.getServiceId().intValue() == log.getService()) { log.setAction(dict.getAction()); } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java new file mode 100644 index 000000000..4eac13a5c --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java @@ -0,0 +1,104 @@ +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.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.reflect.TypeToken; +import com.nis.domain.Page; +import com.nis.domain.PageLog; +import com.nis.domain.log.MmAvIpLog; +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(value = "${adminPath}/log/ntc") +public class MmPornAvSampleController extends BaseController { + + @RequestMapping(value = {"mmSampleAudioLevelLogs", "mmSampleAudioLevelLogs/list"}) + public String audioList(Model model, @ModelAttribute("log") MmAvIpLog entry, HttpServletRequest request, HttpServletResponse response) { + + try { + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry, params); + + String url = ""; + url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNAUDIOSAMPLE_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setList(data.getList()); + List list = page.getList(); + for (MmAvIpLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l); + } + model.addAttribute("page", page); + logger.info("查询音频色情样例日志成功"); + } + } catch (Exception e) { + logger.info("查询音频色情样例日志失败", e); + addMessage(model, e.getMessage()); + } + return "/log/ntc/mmPornAudioSampleList"; + } + + @RequestMapping(value = {"mmSampleVideoLevelLogs", "mmSampleVideoLevelLogs/list"}) + public String videoList(Model model, @ModelAttribute("log") MmAvIpLog entry, HttpServletRequest request, HttpServletResponse response) { + + try { + + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry, params); + + String url = ""; + url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNVIDEOSAMPLE_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setList(data.getList()); + List list = page.getList(); + for (MmAvIpLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l); + } + model.addAttribute("page", page); + logger.info("查询视频色情样例日志成功"); + } + } catch (Exception e) { + logger.info("查询视频色情样例日志失败", e); + addMessage(model, e.getMessage()); + } + return "/log/ntc/mmPornVideoSampleList"; + } +} diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java new file mode 100644 index 000000000..ee64d254a --- /dev/null +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java @@ -0,0 +1,71 @@ +package com.nis.web.controller.log.ntc; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.http.client.ClientProtocolException; +import org.aspectj.util.FileUtil; +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.reflect.TypeToken; +import com.nis.domain.Page; +import com.nis.domain.PageLog; +import com.nis.domain.log.MmVoipLog; +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(value = "${adminPath}/log/ntc/mmSampleVoipLogs") +public class MmSampleVoipLogController extends BaseController { + + @RequestMapping(value = {"list", ""}) + public String list(Model model, @ModelAttribute("log") MmVoipLog entry, HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { + try { + + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(entry,params); + + String url = Constants.LOG_BASE_URL+Constants.NTC_MMSAMPLE_VOIP_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + //String path = request.getClass().getClassLoader().getResource("").getPath(); + //String jsonString = FileUtil.readAsString(new File(path + "com/nis/web/test/voipSampleLogTest.txt")); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setList(data.getList()); + List list = page.getList(); + for (MmVoipLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l); + } + model.addAttribute("page", page); + logger.info("查询Voip样例日志成功"); + } + } catch (Exception e) { + logger.info("查询Voip日志失败", e); + addMessage(model, e.getMessage()); + } + return "/log/ntc/mmSampleVoipList"; + } +} diff --git a/src/main/java/com/nis/web/test/voipSampleLogTest.txt b/src/main/java/com/nis/web/test/voipSampleLogTest.txt new file mode 100644 index 000000000..666bfa386 --- /dev/null +++ b/src/main/java/com/nis/web/test/voipSampleLogTest.txt @@ -0,0 +1,81 @@ +{ + "status":200, + "businessCode":2000, + "reason":"Success", + "msg":"success", + "fromuri":"abc", + "logSource":0, + "data":{ + "pageNo":1, + "pageSize":15, + "count":41, + "last":3, + "list":[ + { + "cfgId":21, + "foundTime":"2018-06-10 10:10:10", + "recvTime":"2018-06-11 11:11:11", + "transProto":"L2TP", + "addrType":4, + "dIp":"10.0.6.121", + "sIp":"10.0.6.122", + "dPort":"8080", + "sPort":"8080", + "service":264, + "entranceId":21, + "deviceId":2, + "direction":1, + "streamDir":0, + "capIp":"10.1.1.2", + "addrList":"11111", + "userRegion":"aaa", + "duation":"123", + "voipProtocol":"SIP", + "callingAccount":"yiyiwyf", + "calledAccount":"jingl", + "callingNumber":"13041000000", + "calledNumber":"13113113133", + "fromToStoreIp":"10.1.1.1", + "fromToStoreUrl":"www.baidu.com", + "toFromStoreIp":"10.2.2.2", + "toFromStoreUrl":"beian.baidu.com", + "pid":"5", + "logUri":"aaacc", + "level":2, + "fdType":1 + },{ + "cfgId":22, + "foundTime":"2018-06-10 10:10:10", + "recvTime":"2018-06-11 11:11:11", + "transProto":"L2TP", + "addrType":4, + "dIp":"10.0.6.121", + "sIp":"10.0.6.122", + "dPort":"8080", + "sPort":"8080", + "service":392, + "entranceId":112, + "deviceId":2, + "direction":0, + "streamDir":1, + "capIp":"10.1.1.2", + "addrList":"11111", + "userRegion":"aaa", + "duation":"123", + "voipProtocol":"SIP", + "callingAccount":"yiyiwyf", + "calledAccount":"jingl", + "callingNumber":"13041000000", + "calledNumber":"13113113133", + "fromToStoreIp":"10.1.1.1", + "fromToStoreUrl":"www.baidu.com", + "toFromStoreIp":"10.2.2.2", + "toFromStoreUrl":"beian.baidu.com", + "pid":"5", + "logUri":"aaacc", + "level":2, + "fdType":1 + } + ] + } +} \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp new file mode 100644 index 000000000..e4f2b1251 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp @@ -0,0 +1,259 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+

+ + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + + +
+ + +
+ + +
+
+
+
+ + + + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.entranceId} + + + + + + + ${log.pid}${log.url}${log.logUri}${log.refer}${log.level} + + + + ${log.protocol}${log.foundTime}${log.recvTime}${log.transProto} + + + + ${log.dIp}${log.sIp}${log.dPort}${log.sPort}${log.deviceId} + + + + ${log.capIp}${log.addrList}${log.userRegion}
+
${page}
+
+
+
+
+
+
+ + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp new file mode 100644 index 000000000..ec81dd318 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp @@ -0,0 +1,259 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+

+ + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + + +
+ + +
+ + +
+
+
+
+ + + + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.entranceId} + + + + + + + ${log.pid}${log.url}${log.logUri}${log.refer}${log.level} + + + + ${log.protocol}${log.foundTime}${log.recvTime}${log.transProto} + + + + ${log.dIp}${log.sIp}${log.dPort}${log.sPort}${log.deviceId} + + + + ${log.capIp}${log.addrList}${log.userRegion}
+
${page}
+
+
+
+
+
+
+ + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp new file mode 100644 index 000000000..35bd5247f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp @@ -0,0 +1,273 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+

+ + +

+ + +
+
+
+
+
+ + + + + + + + + + +
+
+ + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+ + + +
+ + +
+ + +
+
+
+
+ + + + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.cfgId}${log.entranceId} + + + + + + + ${log.foundTime}${log.recvTime}${log.transProto}${log.duation}${log.voipProtocol}${log.callingAccount}${log.calledAccount}${log.callingNumber}${log.calledNumber}${log.fromToStoreIp}${log.fromToStoreUrl}${log.toFromStoreIp}${log.toFromStoreUrl}${log.pid}${log.logUri}${log.level} + + + + + + + + ${log.dIp}${log.sIp}${log.dPort}${log.sPort}${log.deviceId} + + + + ${log.capIp}${log.addrList}${log.userRegion}
+
${page}
+
+
+
+
+
+
+ +