1.后端定义嵌套实体类:参数一定要序列化,不然匹配不到。
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class Action {
@JsonProperty("actionActuatorFunc")
private String actionActuatorFunc;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class DroneInfo {
@JsonProperty("droneEnumValue")
private int droneEnumValue;//无人机型号
@JsonProperty("droneSubEnumValue")
private int droneSubEnumValue;//无人机子型号
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
@Data
public class Folder {
@JsonProperty("autoFlightSpeed")
private float autoFlightSpeed;
@JsonProperty("globalHeight")
private float globalHeight;
@JsonProperty("globalWaypointTurnMode")
private String globalWaypointTurnMode;
@JsonProperty("placeMarks")
private List<Placemark> placeMarks;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class MissionConfig {
@JsonProperty("fileName")
private String fileName;//航线名称
@JsonProperty("finishAction")
private String finishAction;//完成航线动作
@JsonProperty("takeOffSecurityHeight")
private float takeOffSecurityHeight;//安全起飞高度
@JsonProperty("globalTransitionalSpeed")
private float globalTransitionalSpeed;//起飞速度,飞向首航点速度
@JsonProperty("droneInfo")
private DroneInfo droneInfo;//
@JsonProperty("payloadInfo")
private PayloadInfo payloadInfo;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class PayloadInfo {
@JsonProperty("payloadEnumValue")
private int payloadEnumValue;//负载型号
@JsonProperty("payloadSubEnumValue")
private int payloadSubEnumValue;//负载子型号
@JsonProperty("payloadPositionIndex")
private int payloadPositionIndex;//挂载位置
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
@Data
public class Placemark {
@JsonProperty("coordinates")
private String coordinates;
@JsonProperty("height")
private float height;
@JsonProperty("waypointHeadingAngle")
private int waypointHeadingAngle;
@JsonProperty("gimbalPitchAngle")
private int gimbalPitchAngle;
@JsonProperty("waypointSpeed")
private float waypointSpeed;
@JsonProperty("actionGroup")
private List<Action> actionGroup;
}
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
@Data
public class Wayline {
@JsonProperty("missionConfig")
private MissionConfig missionConfig;
@JsonProperty("folder")
private Folder folder;
}