From ac4bd27ca6cdf04ed5eee1e346b9b2a487fe72ce Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Fri, 16 Apr 2021 14:30:01 +0800 Subject: [PATCH] =?UTF-8?q?IOT=E8=B0=83=E7=94=A8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iotgateway/IotGatewayApplication.java | 3 +- .../iotgateway/server/IotCommunication.java | 30 ------------------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/telpo/iotgateway/IotGatewayApplication.java b/src/main/java/com/telpo/iotgateway/IotGatewayApplication.java index 248d0d3..163ffe0 100644 --- a/src/main/java/com/telpo/iotgateway/IotGatewayApplication.java +++ b/src/main/java/com/telpo/iotgateway/IotGatewayApplication.java @@ -26,11 +26,12 @@ import org.springframework.scheduling.annotation.EnableScheduling; public class IotGatewayApplication { public static void main(String[] args) { + log.info("推送服务开始启动!"); ConfigurableApplicationContext applicationContext = SpringApplication.run(IotGatewayApplication.class, args); ConfigurableEnvironment environment = applicationContext.getEnvironment(); IotCommunication iotCommunication = new IotCommunication(environment); iotCommunication.start(); - log.info("推送服务启动!"); + log.info("推送服务启动成功!"); } } diff --git a/src/main/java/com/telpo/iotgateway/server/IotCommunication.java b/src/main/java/com/telpo/iotgateway/server/IotCommunication.java index 55ee98b..9f4ebcf 100644 --- a/src/main/java/com/telpo/iotgateway/server/IotCommunication.java +++ b/src/main/java/com/telpo/iotgateway/server/IotCommunication.java @@ -118,34 +118,4 @@ public class IotCommunication { log.error("InterruptedException:{}", e.getMessage()); } } - - - /* - * userInfo组装 - */ - private String getUserInfo() { - //userInfo组装 - String userInfo = clientId + "|authMode=aksign" - + ",signMethod=" + signMethod - + ",timestamp=" + timeStamp - + ",authId=" + accessKey - + ",iotInstanceId=" + iotInstanceId - + ",consumerGroupId=" + consumerGroupId - + "|"; - //计算签名,password组装方法,请参见AMQP客户端接入说明文档。 - return userInfo; - } - - /** - * 计算签名,password组装方法,请参见AMQP客户端接入说明文档。 - */ - private static String doSign(String toSignString, String secret, String signMethod) throws Exception { - SecretKeySpec signingKey = new SecretKeySpec(secret.getBytes(), signMethod); - Mac mac = Mac.getInstance(signMethod); - mac.init(signingKey); - byte[] rawHmac = mac.doFinal(toSignString.getBytes()); - return Base64.encodeBase64String(rawHmac); - } - - }