Authored by qinchao

恶意ip界面完善

@@ -202,14 +202,20 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { @@ -202,14 +202,20 @@ public class MaliciousIpServiceImpl implements MaliciousIpService {
202 for(int i=0;i<ipsObjArray.size();i++){ 202 for(int i=0;i<ipsObjArray.size();i++){
203 JSONObject jo= ipsObjArray.getJSONObject(i); 203 JSONObject jo= ipsObjArray.getJSONObject(i);
204 String ip=jo.getString("ip"); 204 String ip=jo.getString("ip");
205 - String reason=jo.toJSONString(); 205 + String reason=jo.getString("reason");
  206 + //String duration=jo.get("duration")==null?"":""+jo.get("duration");
  207 + if(StringUtils.isNotBlank(ip)){
  208 +
  209 + MaliciousIpsRecordForbid record=new MaliciousIpsRecordForbid();
  210 + record.setIp(ip);
  211 + record.setReason(reason);
  212 + maliciousIpsRecordForbidMapper.insert(record);
  213 +
  214 + logger.info("MaliciousIpServiceImpl writeMipsObjToOpsReids - "+ip);
  215 + }
206 216
207 - //写入mysql  
208 - MaliciousIpsRecordForbid record=new MaliciousIpsRecordForbid();  
209 - record.setIp(ip);  
210 - record.setReason(reason);  
211 - maliciousIpsRecordForbidMapper.insert(record);  
212 } 217 }
  218 +
213 } 219 }
214 220
215 221