Authored by qinchao

接口转换更改

@@ -10,20 +10,28 @@ public class MaliciousIpModel { @@ -10,20 +10,28 @@ public class MaliciousIpModel {
10 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 10 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
11 private String deviceTypeCount; //设备类型总数 11 private String deviceTypeCount; //设备类型总数
12 private String difMethodCount; //访问不同接口数量 12 private String difMethodCount; //访问不同接口数量
  13 + private String difmethodcount;
13 private String impApiPrecent; //敏感接口占比 14 private String impApiPrecent; //敏感接口占比
14 private String impCount; //敏感接口访问次数 15 private String impCount; //敏感接口访问次数
  16 + private String impcount;
15 private String ip; //恶意ip 17 private String ip; //恶意ip
16 private String ipPrecent; //ip百分比 18 private String ipPrecent; //ip百分比
17 private String loginApiCount; //登录接口访问次数 19 private String loginApiCount; //登录接口访问次数
18 20
19 private String notExistUdidPercent;//不存在的udid占比 21 private String notExistUdidPercent;//不存在的udid占比
20 private String notExsitUdidCount; //不存在的udid个数 22 private String notExsitUdidCount; //不存在的udid个数
  23 + private String notexsitudidcount;
21 private String qps; //qps 24 private String qps; //qps
22 private String uidCount; //uid个数 25 private String uidCount; //uid个数
  26 + private String uidcount;
23 private String udidCount; //udid个数 27 private String udidCount; //udid个数
  28 + private String udidcount;
24 private boolean whiteIpFlag; //白名单标志 29 private boolean whiteIpFlag; //白名单标志
25 private long timestamp; //时间戳 30 private long timestamp; //时间戳
26 31
  32 + private String uidcount_udidcount;//udid上登录uid数
  33 + private String allcountpercent;//接口访问密集程度
  34 +
27 private String duration; //统计时间:多少秒一个批次,暂时不显示 35 private String duration; //统计时间:多少秒一个批次,暂时不显示
28 36
29 private String prob; 37 private String prob;
@@ -59,23 +67,13 @@ public class MaliciousIpModel { @@ -59,23 +67,13 @@ public class MaliciousIpModel {
59 String str=""; 67 String str="";
60 str += "<p style='font-size:14px'>"; 68 str += "<p style='font-size:14px'>";
61 str += ("QPS: "+this.qps+"<br>"); 69 str += ("QPS: "+this.qps+"<br>");
62 - str += ("访问不同接口数量: "+this.difMethodCount+"<br>");  
63 - // str += ("登录接口访问次数: "+this.loginApiCount+"<br>");  
64 -  
65 -  
66 - str += ("敏感接口访问次数: "+this.impCount+"<br>");  
67 - // str += ("敏感接口占比: "+this.impApiPrecent+"<br>");  
68 - str += ("ip百分比: "+this.ipPrecent+"<br>");  
69 -  
70 - str += ("uid个数: "+this.uidCount+"<br>");  
71 - str += ("udid个数: "+this.udidCount+"<br>");  
72 - // str += ("不存在的udid占比: "+this.notExistUdidPercent+"<br>");  
73 - str += ("不存在的udid个数: "+this.notExsitUdidCount+"<br>");  
74 -  
75 - str += ("设备类型总数: "+this.deviceTypeCount+"<br>");  
76 - // str += ("白名单标志: "+this.whiteIpFlag+"<br>");  
77 - // str += ("时间戳: "+sdf.format(new Date(this.timestamp)));  
78 - str += ("prob: "+this.prob+"<br>"); 70 + str += ("不存在udid个数: "+this.notexsitudidcount+"<br>");
  71 + str += ("udid上登录uid数: "+this.uidcount_udidcount+"<br>");
  72 + str += ("uid个数: "+this.uidcount+"<br>");
  73 + str += ("udid个数: "+this.udidcount+"<br>");
  74 + str += ("访问不同接口数: "+this.difmethodcount+"<br>");
  75 + str += ("访问敏感接口数: "+this.impcount+"<br>");
  76 + str += ("接口访问密集程度: "+this.allcountpercent+"<br>");
79 str += "</p>"; 77 str += "</p>";
80 return str; 78 return str;
81 } 79 }
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; @@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
5 import com.alibaba.fastjson.JSONObject; 5 import com.alibaba.fastjson.JSONObject;
6 import com.model.HostInfo; 6 import com.model.HostInfo;
7 import com.model.MalIpRule; 7 import com.model.MalIpRule;
8 -import com.model.MaliciousIpsRecord;  
9 import com.model.MaliciousIpsRecordForbid; 8 import com.model.MaliciousIpsRecordForbid;
10 import com.monitor.cmdb.service.IHostInfoService; 9 import com.monitor.cmdb.service.IHostInfoService;
11 import com.monitor.common.service.HttpRestClientService; 10 import com.monitor.common.service.HttpRestClientService;
@@ -22,7 +21,6 @@ import org.apache.commons.lang3.StringUtils; @@ -22,7 +21,6 @@ import org.apache.commons.lang3.StringUtils;
22 import org.slf4j.Logger; 21 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
24 import org.springframework.beans.factory.annotation.Autowired; 23 import org.springframework.beans.factory.annotation.Autowired;
25 -import org.springframework.beans.factory.annotation.Value;  
26 import org.springframework.stereotype.Controller; 24 import org.springframework.stereotype.Controller;
27 import org.springframework.util.CollectionUtils; 25 import org.springframework.util.CollectionUtils;
28 import org.springframework.web.bind.annotation.RequestBody; 26 import org.springframework.web.bind.annotation.RequestBody;
@@ -30,9 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping; @@ -30,9 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
30 import org.springframework.web.bind.annotation.ResponseBody; 28 import org.springframework.web.bind.annotation.ResponseBody;
31 29
32 import java.util.ArrayList; 30 import java.util.ArrayList;
33 -import java.util.HashSet;  
34 import java.util.List; 31 import java.util.List;
35 -import java.util.Set;  
36 32
37 /** 33 /**
38 * 恶意ip 34 * 恶意ip