1.action字典 2.日志列显示规则,配置Id,action,发现时间,isp,私有字段,公有字段(公有字段顺序保持一致) 3.音视频日志:公共字段的Device,Direction,Nested address list,私有字段av_protocol,From To Store IP,From To Store URL,To From Store IP,To From Store URL,在界面注释掉 4.其他日志的公共字段,Nested address list注释掉 5.DNS日志的私有字段,除了Qname,其他注释掉 6.proxy的日志,url放到isp后面 7.日志列表增加详情查看按钮 8.查询条件字段名和列名保持一致 entrance、protocol 9.列表数据entranceId从字典取 10.dns翻译:qtype、qclass、opcode、cname全大写,Recursion Desired -> Recursion Desured;Available Recursion -> Recursion Available 11.错误提示中文
57 lines
1.6 KiB
Java
57 lines
1.6 KiB
Java
package com.nis.web.test;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.util.List;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import org.aspectj.util.FileUtil;
|
|
import org.springframework.stereotype.Controller;
|
|
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.Page;
|
|
import com.nis.domain.log.NtcIpLog;
|
|
import com.nis.domain.maat.LogRecvData;
|
|
|
|
@Controller
|
|
@RequestMapping("test")
|
|
public class LogTest {
|
|
|
|
@ResponseBody
|
|
@RequestMapping("logTest")
|
|
public String testservice(HttpServletRequest request) {
|
|
String recv = "";
|
|
try {
|
|
String path = request.getClass().getClassLoader().getResource("").getPath();
|
|
recv = FileUtil.readAsString(new File(path + "com/nis/web/test/logTest.txt"));
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
try {
|
|
Thread.sleep(61000);
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return "";
|
|
}
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
String readAsString = FileUtil.readAsString(new File("d:/test/logTest.txt"));
|
|
|
|
Gson gson = new GsonBuilder().create();
|
|
//gson泛型支持
|
|
LogRecvData<NtcIpLog> fromJson = gson.fromJson(readAsString, new TypeToken<LogRecvData<NtcIpLog>>(){}.getType());
|
|
|
|
Page<NtcIpLog> data = fromJson.getData();
|
|
System.out.println(data.getPageNo());
|
|
List<NtcIpLog> list = data.getList();
|
|
NtcIpLog object = data.getList().get(0);
|
|
System.out.print(object.getsPort());
|
|
}
|
|
}
|