mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
清理无用依赖
This commit is contained in:
10
pom.xml
10
pom.xml
@@ -310,13 +310,13 @@
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- <dependency>-->
|
||||
|
||||
<groupId>com.maxmind.geoip2</groupId>
|
||||
<artifactId>geoip2</artifactId>
|
||||
<version>2.15.0</version>
|
||||
<!-- <groupId>com.maxmind.geoip2</groupId>-->
|
||||
<!-- <artifactId>geoip2</artifactId>-->
|
||||
<!-- <version>2.15.0</version>-->
|
||||
|
||||
</dependency>
|
||||
<!-- </dependency>-->
|
||||
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package cn.lihongjie.coal.ip;
|
||||
|
||||
import com.maxmind.geoip2.DatabaseReader;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
||||
@@ -29,7 +28,6 @@ class IpQueryService {
|
||||
@Value("${geolite2.url}")
|
||||
private String geolite2DownloadUrl;
|
||||
|
||||
private DatabaseReader reader;
|
||||
@Value("classpath:ip/ip2region.xdb")
|
||||
Resource dbFile;
|
||||
private Searcher searcher;
|
||||
@@ -67,7 +65,7 @@ class IpQueryService {
|
||||
@SneakyThrows
|
||||
public String query(String ipaddr) {
|
||||
|
||||
if (reader != null) {
|
||||
if (searcher != null) {
|
||||
InetAddress ipAddress = InetAddress.getByName(ipaddr);
|
||||
if (ipAddress.isAnyLocalAddress()) {
|
||||
return "服务器本机地址";
|
||||
|
||||
Reference in New Issue
Block a user