张世豪
6 小时以前 8d3989dff1164588d45dbb30506da1a6e1094005
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
package sendMQTT.HTTPUtils;
 
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
 
/**
 * 设备控制指令JSON结构
 * 主题:app/{user_id}/mower/{device_id}/control
 */
 
public class ControlCommand {
    
    @JsonProperty("msg_id")
    private String msgId;
    
    private long timestamp;
    
    @JsonProperty("user_id")
    private String userId;
    
    @JsonProperty("device_id")
    private String deviceId;
    
    private String command; // start, stop, pause, resume, emergency_stop
    
    private ControlParameters parameters;
    
    public ControlCommand() {
    }
 
 
 
    public ControlCommand(String msgId, long timestamp, String userId, String deviceId, 
                         String command, ControlParameters parameters) {
        this.msgId = msgId;
        this.timestamp = timestamp;
        this.userId = userId;
        this.deviceId = deviceId;
        this.command = command;
        this.parameters = parameters;
    }
 
    public String getMsgId() {
        return msgId;
    }
 
    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }
 
    public long getTimestamp() {
        return timestamp;
    }
 
    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }
 
    public String getUserId() {
        return userId;
    }
 
    public void setUserId(String userId) {
        this.userId = userId;
    }
 
    public String getDeviceId() {
        return deviceId;
    }
 
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
 
    public String getCommand() {
        return command;
    }
 
    public void setCommand(String command) {
        this.command = command;
    }
 
    public ControlParameters getParameters() {
        return parameters;
    }
 
    public void setParameters(ControlParameters parameters) {
        this.parameters = parameters;
    }
 
    /**
     * 控制参数内部类
     */
 
    public static class ControlParameters {
        private Double value1;
        private String value2;
        private Integer value3;
        
        public ControlParameters() {
        }
        
        public ControlParameters(Double value1, String value2, Integer value3) {
            this.value1 = value1;
            this.value2 = value2;
            this.value3 = value3;
        }
 
        public Double getValue1() {
            return value1;
        }
 
        public void setValue1(Double value1) {
            this.value1 = value1;
        }
 
        public String getValue2() {
            return value2;
        }
 
        public void setValue2(String value2) {
            this.value2 = value2;
        }
 
        public Integer getValue3() {
            return value3;
        }
 
        public void setValue3(Integer value3) {
            this.value3 = value3;
        }
    }
}