diff --git a/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java b/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java index b3021ca..72ee87f 100644 --- a/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java +++ b/foreign-server/src/main/java/com/proxyip/select/business/impl/ProxyIpBusinessImpl.java @@ -22,6 +22,7 @@ import java.time.LocalDateTime; import java.util.Collections; import java.util.List; +import java.util.Locale; import java.util.Optional; import java.util.stream.Collectors; @@ -82,8 +83,7 @@ public void rmSingleDnsRecord(RmSingleDnsRecordParams params) { @Override public void addSingleDnsRecord(AddSingleDnsRecordParams params) { Optional.ofNullable(proxyIpService.getById(params.getId())).ifPresent(proxyIp -> { - String prefix = EnumUtils.getEnumByCode(CountryEnum.class, proxyIp.getCountry()).getLowCode() + "." - + cloudflareCfg.getProxyDomainPrefix(); + String prefix = proxyIp.getCountry().toLowerCase(Locale.ROOT) + "." + cloudflareCfg.getProxyDomainPrefix(); apiService.addCfDnsRecords( prefix, proxyIp.getIp(), @@ -102,8 +102,7 @@ public void addDnsRecordsBatch(AddDnsRecordsBatchParams params) { Optional.ofNullable(proxyIpService.listByIds(params.getIds())) .filter(CommonUtils::isNotEmpty).ifPresent(list -> { list.parallelStream().forEach(proxyIp -> { - String prefix = EnumUtils.getEnumByCode(CountryEnum.class, proxyIp.getCountry()).getLowCode() + "." - + cloudflareCfg.getProxyDomainPrefix(); + String prefix = proxyIp.getCountry().toLowerCase(Locale.ROOT) + "." + cloudflareCfg.getProxyDomainPrefix(); apiService.addCfDnsRecords( prefix, proxyIp.getIp(), diff --git a/foreign-server/src/main/resources/static/proxyIp.html b/foreign-server/src/main/resources/static/proxyIp.html index 5046a64..39001f4 100644 --- a/foreign-server/src/main/resources/static/proxyIp.html +++ b/foreign-server/src/main/resources/static/proxyIp.html @@ -198,7 +198,7 @@