mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 23:57:12 +08:00
清理无用依赖
This commit is contained in:
@@ -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