jiazx0107@163.com
2023-11-10 eba0a973f03126d085abe02bef5c912be4047420
src/main/java/com/fzzy/gateway/hx2023/ScConstant.java
@@ -1,5 +1,11 @@
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;
/**
 * 常量
 */
@@ -8,5 +14,37 @@
    public static String API_URL_AUTH = "${auth}/authorize/login";
    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 String getMd5MessageId() {
//        return MyMD5Util.getMD5(getUUID());
//    }
    /**
     * 下发指令回复报文topic
     */
    public static String TOPIC_REPORT = "/${productId}/${deviceId}/properties/report";
    /**
     * 设备相关信息恢复报文-topic
     */
    public static String TOPIC_MESSAGE_REPORT = "/device/${productId}/${deviceId}/message/property/report";
}