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;
|
}
|
}
|
}
|