(1)文件摘要日志检索功能提交
(2)BGP日志增加字段type,as route
This commit is contained in:
70
src/main/java/com/nis/domain/log/MmFileDigestLog.java
Normal file
70
src/main/java/com/nis/domain/log/MmFileDigestLog.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.nis.domain.log;
|
||||
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @ClassName:MmFileDigestLog
|
||||
* @author (wx)
|
||||
* @date 2018年7月16日 下午2:54:23
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MmFileDigestLog extends BaseLogEntity<MmFileDigestLog> {
|
||||
|
||||
private static final long serialVersionUID = -6177790560553329386L;
|
||||
@ApiModelProperty(value="节目ID", required=true)
|
||||
protected String pid;
|
||||
@ApiModelProperty(value="节目访问地址", required=true)
|
||||
protected String url;
|
||||
@ApiModelProperty(value="封堵现场片段路径", required=true)
|
||||
protected String logUri;
|
||||
@ApiModelProperty(value="入口页面", required=true)
|
||||
protected String referer;
|
||||
@ApiModelProperty(value="有害级别", required=true)
|
||||
protected Integer level;
|
||||
@ApiModelProperty(value="封堵类型", required=true)
|
||||
protected Integer fdType;
|
||||
@ApiModelProperty(value="协议", required=true)
|
||||
protected String protocol;
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getLogUri() {
|
||||
return logUri;
|
||||
}
|
||||
public void setLogUri(String logUri) {
|
||||
this.logUri = logUri;
|
||||
}
|
||||
public String getReferer() {
|
||||
return referer;
|
||||
}
|
||||
public void setReferer(String referer) {
|
||||
this.referer = referer;
|
||||
}
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
public Integer getFdType() {
|
||||
return fdType;
|
||||
}
|
||||
public void setFdType(Integer fdType) {
|
||||
this.fdType = fdType;
|
||||
}
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
}
|
||||
28
src/main/java/com/nis/domain/log/NtcBGPLog.java
Normal file
28
src/main/java/com/nis/domain/log/NtcBGPLog.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.nis.domain.log;
|
||||
|
||||
public class NtcBGPLog extends BaseLogEntity<NtcBGPLog> {
|
||||
|
||||
private static final long serialVersionUID = 4597407682545926823L;
|
||||
private Integer type;
|
||||
private String as;
|
||||
private String route;
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
public String getAs() {
|
||||
return as;
|
||||
}
|
||||
public void setAs(String as) {
|
||||
this.as = as;
|
||||
}
|
||||
public String getRoute() {
|
||||
return route;
|
||||
}
|
||||
public void setRoute(String route) {
|
||||
this.route = route;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,5 +3,4 @@ package com.nis.domain.log;
|
||||
public class NtcIpLog extends BaseLogEntity<NtcIpLog> {
|
||||
|
||||
private static final long serialVersionUID = 4597407682545926823L;
|
||||
|
||||
}
|
||||
|
||||
@@ -415,6 +415,7 @@ public final class Constants {
|
||||
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_MMFILEDIGEST_LOG = Configurations.getStringProperty("mmFileDigestLog", "");
|
||||
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", "");
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
@@ -10,23 +8,18 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.util.FileUtil;
|
||||
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 org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.log.NtcIpLog;
|
||||
import com.nis.domain.log.NtcBGPLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
@@ -37,9 +30,9 @@ import com.nis.web.controller.BaseController;
|
||||
public class BgpLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(@ModelAttribute("log") NtcIpLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
public String list(@ModelAttribute("log") NtcBGPLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
PageLog<NtcIpLog> page = new PageLog<NtcIpLog>(request, response);
|
||||
PageLog<NtcBGPLog> page = new PageLog<NtcBGPLog>(request, response);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
@@ -55,11 +48,11 @@ public class BgpLogController extends BaseController {
|
||||
logger.info("查询结果:" + recv);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcIpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpLog>>(){}.getType());
|
||||
LogRecvData<NtcBGPLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcBGPLog>>(){}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
page.setList(fromJson.getData().getList());
|
||||
List<NtcIpLog> list = page.getList();
|
||||
for (NtcIpLog l : list) {
|
||||
List<NtcBGPLog> list = page.getList();
|
||||
for (NtcBGPLog l : list) {
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
setLogAction(l,serviceList);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
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.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.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.log.MmFileDigestLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/log/ntc/mmFileDigestLogs")
|
||||
public class MmFileDigestLogController extends BaseController{
|
||||
|
||||
/**
|
||||
* 音视频url日志
|
||||
* @param model
|
||||
* @param entry
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws ClientProtocolException
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value={"list",""})
|
||||
public String list(Model model,@ModelAttribute("log")MmFileDigestLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
|
||||
|
||||
try {
|
||||
|
||||
PageLog<MmFileDigestLog> page = new PageLog<MmFileDigestLog>(request, response);
|
||||
Map<String, Object> params=new HashMap<>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
//查询值判断
|
||||
initLogSearchValue(entry,params);
|
||||
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
String url = "";
|
||||
url = Constants.LOG_BASE_URL+Constants.NTC_MMFILEDIGEST_LOG;
|
||||
String jsonString = HttpClientUtil.getMsg(url,params,request);
|
||||
|
||||
Gson gson = new GsonBuilder().create();
|
||||
//gson泛型支持
|
||||
LogRecvData<MmFileDigestLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmFileDigestLog>>(){}.getType());
|
||||
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<MmFileDigestLog> data = fromJson.getData();
|
||||
page.setList(data.getList());
|
||||
List<MmFileDigestLog> list = page.getList();
|
||||
for (MmFileDigestLog l : list) {
|
||||
l.setFunctionId(entry.getFunctionId());
|
||||
setLogAction(l,serviceList);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
logger.info("查询文件摘要日志成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询文件摘要日志失败", e);
|
||||
addMessageLog(model, e.getMessage());
|
||||
}
|
||||
return "/log/ntc/mmFileDigestList";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user