package Mqttmessage.Entity;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
import lombok.Data;
|
|
import java.util.Map;
|
|
/**
|
* 设备响应消息实体类
|
*/
|
@Data
|
public class ResponseData {
|
|
@JsonProperty("msg_id")
|
private String msgId;
|
|
private long timestamp;
|
|
@JsonProperty("device_id")
|
private String deviceId;
|
|
@JsonProperty("original_msg_id")
|
private String originalMsgId;
|
|
private ResponseInfo response;
|
|
// 构造函数
|
public ResponseData() {
|
}
|
|
public ResponseData(String msgId, long timestamp, String deviceId, String originalMsgId, ResponseInfo response) {
|
this.msgId = msgId;
|
this.timestamp = timestamp;
|
this.deviceId = deviceId;
|
this.originalMsgId = originalMsgId;
|
this.response = response;
|
}
|
|
/**
|
* 响应信息内部类
|
*/
|
@Data
|
public static class ResponseInfo {
|
private String status;
|
private String command;
|
|
@JsonProperty("error_code")
|
private int errorCode;
|
|
@JsonProperty("error_message")
|
private String errorMessage;
|
|
@JsonProperty("additional_info")
|
private Map<String, Object> additionalInfo;
|
|
public ResponseInfo() {
|
}
|
|
public ResponseInfo(String status, String command, int errorCode, String errorMessage,
|
Map<String, Object> additionalInfo) {
|
this.status = status;
|
this.command = command;
|
this.errorCode = errorCode;
|
this.errorMessage = errorMessage;
|
this.additionalInfo = additionalInfo;
|
}
|
|
|
}
|
}
|