From 90a1c1b81c40a9199d15f9e4f65828400f801b64 Mon Sep 17 00:00:00 2001 From: Yohann0617 <852221040@qq.com> Date: Wed, 3 Apr 2024 22:47:24 +0800 Subject: [PATCH] update --- .../select/business/impl/ProxyIpBusinessImpl.java | 7 +++---- .../src/main/resources/static/proxyIp.html | 12 +++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) 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 @@