summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoufenghu <[email protected]>2023-08-25 09:41:06 +0800
committerdoufenghu <[email protected]>2023-08-25 09:41:06 +0800
commit4154862dbcee45d28ca4116228ab60eb848cc2be (patch)
treeded8f16a7b0583c3f9a4e5d4512d8e5676ebe07f
parenta6ce86f13e65ce9db0697604cd5ed7456cc273c1 (diff)
[Improve][IPLookupV2] 修复部分遗留问题V1.2
-rw-r--r--README.md2
-rw-r--r--help/IPGEO.md15
-rw-r--r--src/main/java/com/geedgenetworks/utils/IpLookupV2.java1
3 files changed, 9 insertions, 9 deletions
diff --git a/README.md b/README.md
index 60da566..230ca9e 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Galaxy 的 Maven group ID 是 `com.geedgenetworks` 并且 artifactId 是 `galaxy
<dependency>
<groupId>com.geedgenetworks</groupId>
<artifactId>galaxy</artifactId>
- <version>1.1.1/version>
+ <version>1.2/version>
</dependency>
```
diff --git a/help/IPGEO.md b/help/IPGEO.md
index 6cf1f68..79acdb5 100644
--- a/help/IPGEO.md
+++ b/help/IPGEO.md
@@ -88,13 +88,14 @@ Galaxy IPGEO 即数据平台下的galaxy-tool支持的IP定位功能。最终的
## 实现举例
```java
-IpLookup ipLookup = new IpLookup.Builder(false)
- .loadDataFile("dat/ip.mmdb")
- .loadDataFilePrivateV4("dat/ip_private_v4.mmdb")
- .loadDataFilePrivateV6("dat/ip_v6.mmdb")
- .loadAsnDataFile("dat/asn_v4.mmdb")
- .loadAsnDataFileV6("dat/asn_v6.mmdb")
- .build();
+ IpLookupV2 ipLookup = new IpLookupV2.Builder(false)
+ .loadDataFileV4(new FileInputStream(new File("dat/ip_v4_built_in.mmdb")))
+ .loadDataFilePrivateV4(new FileInputStream(new File("dat/ip_v4_user_defined.mmdb")))
+ .loadDataFileV6(new FileInputStream(new File("dat/ip_v6_built_in.mmdb")))
+ .loadDataFilePrivateV6(new FileInputStream(new File("dat/ip_v6_user_defined.mmdb")))
+ .loadAsnDataFile(new FileInputStream(new File("dat/asn_v4.mmdb")))
+ .loadAsnDataFileV6(new FileInputStream(new File("dat/asn_v6.mmdb")))
+ .build();
logger.info(ipLookup.countryLookup("192.168.50.21"));
logger.info(ipLookup.cityLookupDetail("192.168.50.21"));
diff --git a/src/main/java/com/geedgenetworks/utils/IpLookupV2.java b/src/main/java/com/geedgenetworks/utils/IpLookupV2.java
index b8eacb5..5830473 100644
--- a/src/main/java/com/geedgenetworks/utils/IpLookupV2.java
+++ b/src/main/java/com/geedgenetworks/utils/IpLookupV2.java
@@ -293,7 +293,6 @@ public final class IpLookupV2 extends AbstractDatabaseReader implements IPLocato
}
-
/**
*
* @param asnDatabaseFile 加载ASN database文件,不区分IPv4/6