判断mqtt客户端是否在线
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.njcn.access.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/7/14 15:16
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@Order(10)
|
||||
public class MqttInfo {
|
||||
|
||||
@Value("${mqtt.clientUrl}")
|
||||
private String url;
|
||||
|
||||
@Value("${mqtt.secretKeyUserName}")
|
||||
private String userName;
|
||||
|
||||
@Value("${mqtt.secretKeyPassword}")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public enum AccessResponseEnum {
|
||||
*/
|
||||
NDID_NO_FIND("A0301", "nDid在平台端未找到或者已注册"),
|
||||
|
||||
MISSING_CLIENT("A0302","设备客户端不在线!"),
|
||||
MODEL_REPEAT("A0302", "模板重复,请勿重复录入!"),
|
||||
MODEL_NO_FIND("A0302", "模板不存在,请先录入模板数据!"),
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.access.pojo.dto.mqtt;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/7/17 9:09
|
||||
*/
|
||||
@Data
|
||||
public class MqttClientDto implements Serializable {
|
||||
|
||||
@SerializedName("clientid")
|
||||
private String clientId;
|
||||
|
||||
@SerializedName("username")
|
||||
private String userName;
|
||||
|
||||
private boolean connected;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user