...
|
...
|
@@ -241,6 +241,7 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
|
|
|
//组装数据
|
|
|
List<MaliciousIp> listMaliciousIp = new ArrayList<MaliciousIp>();
|
|
|
long ts=0l;
|
|
|
for(String mipKey : mipKeys){
|
|
|
MaliciousIp mip = new MaliciousIp();
|
|
|
mip.setIp(mipKey);
|
...
|
...
|
@@ -253,6 +254,7 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
try{
|
|
|
MaliciousIpModel model=JSON.parseObject(reason,MaliciousIpModel.class);
|
|
|
reason=model.toHtmlString();
|
|
|
ts=model.getTimestamp();
|
|
|
}catch (Exception e){
|
|
|
//
|
|
|
}
|
...
|
...
|
@@ -271,6 +273,9 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
try{
|
|
|
MaliciousIpModel model=JSON.parseObject(reason,MaliciousIpModel.class);
|
|
|
reason=model.toHtmlString();
|
|
|
if(ts<model.getTimestamp()){
|
|
|
ts=model.getTimestamp();
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
//
|
|
|
}
|
...
|
...
|
@@ -281,8 +286,21 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
//reasonDur += "qcloud: " + qcloudInfo.get("dur")+ " -- "+ qcloudInfo.get("reason") ;
|
|
|
}
|
|
|
mip.setReasonDur(reasonDur);
|
|
|
mip.setTs(ts);
|
|
|
listMaliciousIp.add(mip);
|
|
|
}
|
|
|
//排序
|
|
|
Collections.sort(listMaliciousIp,new Comparator<MaliciousIp>(){
|
|
|
public int compare(MaliciousIp arg0, MaliciousIp arg1) {
|
|
|
long compare= arg0.getTs() - arg1.getTs();
|
|
|
if(compare<0L){
|
|
|
return -1;
|
|
|
}else{
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
response.setData(listMaliciousIp);
|
|
|
return response;
|
|
|
}
|
...
|
...
|
|