张世豪
17 小时以前 5ae9bbe3583384afab8eb95a134ccb74aee6487a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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;
        }
 
 
    }
}