Skip to content

Commit

Permalink
0816
Browse files Browse the repository at this point in the history
  • Loading branch information
ALI1416 committed Aug 16, 2023
1 parent 5720bf2 commit 4d0112f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Ip2RegionAutoConfiguration(Ip2RegionProperties ip2RegionProperties) {
@PostConstruct
public void init() {
if (ip2RegionProperties.getResourcePath() != null) {
log.info("读取到配置,RESOURCE_PATH为:{}", ip2RegionProperties.getResourcePath());
log.info("IP地址转区域配置:资源路径RESOURCE_PATH {}", ip2RegionProperties.getResourcePath());
InputStream inputStream;
try {
inputStream = new ClassPathResource(ip2RegionProperties.getResourcePath()).getInputStream();
Expand All @@ -59,10 +59,10 @@ public void init() {
}
Ip2Region.init(inputStream);
} else if (ip2RegionProperties.getLocalPath() != null) {
log.info("读取到配置,LOCAL_PATH为:{}", ip2RegionProperties.getLocalPath());
log.info("IP地址转区域配置:本地路径LOCAL_PATH {}", ip2RegionProperties.getLocalPath());
Ip2Region.initByFile(ip2RegionProperties.getLocalPath());
} else if (ip2RegionProperties.getUrlPath() != null) {
log.info("读取到配置,URL_PATH为:{}", ip2RegionProperties.getUrlPath());
log.info("IP地址转区域配置:URL路径URL_PATH {}", ip2RegionProperties.getUrlPath());
Ip2Region.initByUrl(ip2RegionProperties.getUrlPath());
}
}
Expand Down

0 comments on commit 4d0112f

Please sign in to comment.