From 46203ee88249d9a4046f3d453deb41edc562cf6c Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期二, 12 十二月 2023 12:36:53 +0800 Subject: [PATCH] 提交网关心跳和设备状态 --- src/main/java/com/fzzy/gateway/hx2023/ScConstant.java | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 44 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/fzzy/gateway/hx2023/ScConstant.java b/src/main/java/com/fzzy/gateway/hx2023/ScConstant.java index 2786342..dc8a7fe 100644 --- a/src/main/java/com/fzzy/gateway/hx2023/ScConstant.java +++ b/src/main/java/com/fzzy/gateway/hx2023/ScConstant.java @@ -1,6 +1,10 @@ package com.fzzy.gateway.hx2023; +import com.alibaba.fastjson2.util.UUIDUtils; +import com.fzzy.api.utils.MyMD5Util; import org.apache.commons.lang.math.RandomUtils; + +import java.util.UUID; /** * 甯搁噺 @@ -12,11 +16,50 @@ public static String MESSAGE_TYPE_REPORT_PROPERTY = "REPORT_PROPERTY"; + public static String MESSAGE_TYPE_INVOKE_FUNCTION = "INVOKE_FUNCTION"; + + + + /** + * 绮儏閲囨寚浠� + */ + public static String FUNCTION_getTAndRHInfo = "getTAndRHInfo"; + public static String getMessageId() { return System.currentTimeMillis() + RandomUtils.nextInt(1000) + ""; } + public static String getUUID() { + return UUID.randomUUID().toString().replaceAll("-", ""); + } - public static int CODE_200 = 200; + + + + //API_SOURCE-蹇冭烦 + public static String API_SOURCE_TARGET_EQUIPMENT_HEARTBEAT = "TARGET_EQUIPMENT_HEARTBEAT"; + //API_SOURCE-缃戝叧璁惧鐘舵�佹秷鎭殑 + public static String API_SOURCE_TARGET_EQUIPMENT_STATUS = "TARGET_EQUIPMENT_STATUS"; + + /** + * 涓嬪彂鎸囦护鍥炲鎶ユ枃topic + */ + public static String TOPIC_REPORT = "/${productId}/${deviceId}/properties/report"; + + /** + * 璁惧鐩稿叧淇℃伅鎭㈠鎶ユ枃-topic + */ + public static String TOPIC_MESSAGE_REPORT = "/device/${productId}/${deviceId}/message/property/report"; + + + /** + * 缃戝叧璁惧鐘舵�佹秷鎭秷鎭� topic锛歍OPIC_EQUIPMENT_HEARTBEAT_{搴撶偣缂栫爜} + */ + public static String TOPIC_EQUIPMENT_HEARTBEAT = "TOPIC_EQUIPMENT_HEARTBEAT_{kqdm}"; + + /** + * 缃戝叧璁惧鐘舵�佹秷鎭秷鎭� topic锛歍OPIC_EQUIPMENT_STATUS_{搴撶偣缂栫爜} + */ + public static String TOPIC_EQUIPMENT_STATUS = "TOPIC_EQUIPMENT_STATUS_{kqdm}"; } -- Gitblit v1.9.3