Merge branch 'uat' into 'master'

阻断代码合并

See merge request eshop/biz_service_ebtp_extend!78
This commit is contained in:
张芹彬
2022-03-22 11:47:44 +08:00
2 changed files with 37 additions and 37 deletions

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.chinaunicom.ebtp</groupId> <groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-parent</artifactId> <artifactId>mall-ebtp-cloud-parent</artifactId>
<version>2.0.1-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
</parent> </parent>
<groupId>com.chinaunicom.mall.ebtp</groupId> <groupId>com.chinaunicom.mall.ebtp</groupId>
@ -20,7 +20,7 @@
<dependency> <dependency>
<groupId>com.chinaunicom.mall.ebtp</groupId> <groupId>com.chinaunicom.mall.ebtp</groupId>
<artifactId>uboot-core</artifactId> <artifactId>uboot-core</artifactId>
<version>2.0.1-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
</dependency> </dependency>

View File

@ -294,31 +294,31 @@ public final class Utils {
} }
} }
public static Properties parseGrpcUrl(String url) { // public static Properties parseGrpcUrl(String url) {
if (isNullOrEmpty(url)) { // if (isNullOrEmpty(url)) {
throw new RuntimeException("URL cannot be null or empty"); // throw new RuntimeException("URL cannot be null or empty");
} // }
//
Properties props = new Properties(); // Properties props = new Properties();
final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)"; // final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)";
final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); // final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(url); // Matcher m = p.matcher(url);
if (m.matches()) { // if (m.matches()) {
props.setProperty("protocol", m.group(1)); // props.setProperty("protocol", m.group(1));
props.setProperty("host", m.group(2)); // props.setProperty("host", m.group(2));
props.setProperty("port", m.group(3)); // props.setProperty("port", m.group(3));
//
String protocol = props.getProperty("protocol"); // String protocol = props.getProperty("protocol");
if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) { // if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) {
throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol)); // throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol));
} // }
} else { // } else {
throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'"); // throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");
} // }
//
// TODO: allow all possible formats of the URL // // TODO: allow all possible formats of the URL
return props; // return props;
} // }
/** /**
* Check if the strings Grpc url is valid * Check if the strings Grpc url is valid
@ -326,16 +326,16 @@ public final class Utils {
* @param url * @param url
* @return Return the io.seata.core.exception that indicates the error or null if ok. * @return Return the io.seata.core.exception that indicates the error or null if ok.
*/ */
public static Exception checkGrpcUrl(String url) { // public static Exception checkGrpcUrl(String url) {
try { // try {
//
parseGrpcUrl(url); // parseGrpcUrl(url);
return null; // return null;
//
} catch (Exception e) { // } catch (Exception e) {
return e; // return e;
} // }
} // }
/** /**
* Check if a string is null or empty. * Check if a string is null or empty.