fix:refactor the project and optimize the configuration loading method
This commit is contained in:
@@ -5,8 +5,6 @@ import com.zdjizhi.common.DosDetectionThreshold;
|
||||
import com.zdjizhi.common.DosEventLog;
|
||||
import com.zdjizhi.common.DosSketchLog;
|
||||
|
||||
import com.zdjizhi.utils.IpLookupUtils;
|
||||
import com.zdjizhi.utils.SnowflakeId;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -174,10 +172,10 @@ public class DosDetectionTest {
|
||||
String[] ipArr = sourceIpList.split(",");
|
||||
HashSet<String> countrySet = new HashSet<>();
|
||||
for (String ip : ipArr) {
|
||||
String country = IpLookupUtils.getCountryLookup(ip);
|
||||
if (StringUtil.isNotBlank(country)){
|
||||
countrySet.add(country);
|
||||
}
|
||||
// String country = IpLookupUtils.getCountryLookup(ip);
|
||||
// if (StringUtil.isNotBlank(country)){
|
||||
// countrySet.add(country);
|
||||
// }
|
||||
}
|
||||
countryList = StringUtils.join(countrySet, ", ");
|
||||
return countryList;
|
||||
|
||||
Reference in New Issue
Block a user