清理无用依赖

This commit is contained in:
2023-11-22 18:00:06 +08:00
parent 4baa96155b
commit 8131903678
2 changed files with 6 additions and 8 deletions

View File

@@ -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 "服务器本机地址";