From 56c8c901ded62f592464776cf727b0a33430c97a Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Fri, 14 Jan 2022 12:05:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crypconfigure/service/impl/CrypConfigureServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java index bd794c0..de6ab0a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java @@ -24,6 +24,7 @@ import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.stereotype.Service; import java.io.InputStream; @@ -39,6 +40,7 @@ import static com.chinaunicom.mall.ebtp.common.uniBss.service.UniBssServiceImpl. * */ @Slf4j +@EnableAsync @Service public class CrypConfigureServiceImpl extends BaseServiceImpl implements ICrypConfigureService { From 15f1eb1903fca1303f9d4c17e1582c5a8576badd Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Tue, 22 Mar 2022 11:39:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=98=BB=E6=96=AD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crypconfigure/crypto/helper/Utils.java | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java index 3db4dd4..9dd156d 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java @@ -294,31 +294,31 @@ public final class Utils { } } - public static Properties parseGrpcUrl(String url) { - if (isNullOrEmpty(url)) { - throw new RuntimeException("URL cannot be null or empty"); - } - - Properties props = new Properties(); - final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)"; - final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); - Matcher m = p.matcher(url); - if (m.matches()) { - props.setProperty("protocol", m.group(1)); - props.setProperty("host", m.group(2)); - props.setProperty("port", m.group(3)); - - String protocol = props.getProperty("protocol"); - if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) { - throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol)); - } - } else { - throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'"); - } - - // TODO: allow all possible formats of the URL - return props; - } +// public static Properties parseGrpcUrl(String url) { +// if (isNullOrEmpty(url)) { +// throw new RuntimeException("URL cannot be null or empty"); +// } +// +// Properties props = new Properties(); +// final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)"; +// final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); +// Matcher m = p.matcher(url); +// if (m.matches()) { +// props.setProperty("protocol", m.group(1)); +// props.setProperty("host", m.group(2)); +// props.setProperty("port", m.group(3)); +// +// String protocol = props.getProperty("protocol"); +// if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) { +// throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol)); +// } +// } else { +// throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'"); +// } +// +// // TODO: allow all possible formats of the URL +// return props; +// } /** * Check if the strings Grpc url is valid @@ -326,16 +326,16 @@ public final class Utils { * @param url * @return Return the io.seata.core.exception that indicates the error or null if ok. */ - public static Exception checkGrpcUrl(String url) { - try { - - parseGrpcUrl(url); - return null; - - } catch (Exception e) { - return e; - } - } +// public static Exception checkGrpcUrl(String url) { +// try { +// +// parseGrpcUrl(url); +// return null; +// +// } catch (Exception e) { +// return e; +// } +// } /** * Check if a string is null or empty. From 468e9d14bbfd3bab631edf21d99ad9fbe9545be6 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Tue, 17 Jan 2023 14:49:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=BA=E5=9D=97?= =?UTF-8?q?=E9=93=BE=E5=A4=A9=E6=93=8E=E6=8B=BC=E6=8E=A5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20getUniBss=20=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crypconfigure/service/impl/CrypConfigureServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java index 91f751b..bb3634d 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java @@ -117,7 +117,7 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl Date: Tue, 17 Jan 2023 15:24:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8C=BA=E5=9D=97?= =?UTF-8?q?=E9=93=BE=E5=A4=A9=E6=93=8E=E6=8B=BC=E6=8E=A5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=20getUniBss=20=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crypconfigure/entity/CrypUniBss.java | 28 +++++++++++++++++++ .../impl/CrypConfigureServiceImpl.java | 5 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/entity/CrypUniBss.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/entity/CrypUniBss.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/entity/CrypUniBss.java new file mode 100644 index 0000000..e53c21c --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/entity/CrypUniBss.java @@ -0,0 +1,28 @@ +package com.chinaunicom.mall.ebtp.extend.crypconfigure.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBss; +import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssAttached; +import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssBody; +import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssHead; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** +* 实体类 CrypConfigure-区块链参数配置表 +* +* @author yss +*/ +@Data +public class CrypUniBss { + @JSONField(name = "UNI_BSS_ATTACHED") + private UniBssAttached uniBssAttached; + @JSONField(name = "UNI_BSS_BODY") + private Map uniBssBodyMap; + @JSONField(name = "UNI_BSS_HEAD") + private UniBssHead uniBssHead; + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java index bb3634d..2d05cab 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/service/impl/CrypConfigureServiceImpl.java @@ -27,6 +27,7 @@ import com.chinaunicom.mall.ebtp.extend.crypconfigure.crypto.service.CrypService import com.chinaunicom.mall.ebtp.extend.crypconfigure.dao.CrypConfigureMapper; import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypBean; import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypConfigure; +import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypUniBss; import com.chinaunicom.mall.ebtp.extend.crypconfigure.service.ICrypConfigureService; import com.chinaunicom.mall.ebtp.extend.crypconfigure.util.SslUtil; import com.chinaunicom.mall.ebtp.extend.uniBss.UniBssUtil; @@ -123,7 +124,7 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl map) { - UniBss uniBss = new UniBss(); + CrypUniBss uniBss = new CrypUniBss(); uniBss.setUniBssAttached(new UniBssAttached().setMediaInf("")); //天擎部分head UniBssUtil util = new UniBssUtil(app_id, app_secret);