资源相关
This commit is contained in:
@ -0,0 +1,256 @@
|
||||
package com.yj.earth.common.service;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class SourceDataGenerator {
|
||||
|
||||
@Resource
|
||||
private SourceParamsValidator sourceParamsValidator;
|
||||
|
||||
private static final ObjectMapper objectMapper;
|
||||
|
||||
static {
|
||||
// 初始化ObjectMapper并配置
|
||||
objectMapper = new ObjectMapper();
|
||||
// 允许序列化空对象
|
||||
objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
||||
// 格式化输出
|
||||
objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成包含完整层级结构的默认JSON
|
||||
*/
|
||||
public String generateDefaultJson(String sourceType) throws JsonProcessingException {
|
||||
// 获取目标类
|
||||
Class<?> targetClass = sourceParamsValidator.getSourceTypeMap().get(sourceType);
|
||||
if (targetClass == null) {
|
||||
throw new IllegalArgumentException("不支持的资源类型: " + sourceType);
|
||||
}
|
||||
return generateJsonStructure(targetClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类生成JSON结构字符串
|
||||
* @param clazz 目标类
|
||||
* @return 完整结构的JSON字符串
|
||||
*/
|
||||
public static String generateJsonStructure(Class<?> clazz) throws JsonProcessingException {
|
||||
Object instance = initializeObject(clazz);
|
||||
return objectMapper.writeValueAsString(instance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归初始化对象(包括嵌套类、集合、数组)
|
||||
*/
|
||||
private static Object initializeObject(Class<?> clazz) {
|
||||
try {
|
||||
// 处理数组类型
|
||||
if (clazz.isArray()) {
|
||||
return initializeArray(clazz);
|
||||
}
|
||||
|
||||
// 处理基本类型包装类或字符串(直接返回默认值)
|
||||
if (isPrimitiveOrWrapper(clazz) || clazz.equals(String.class)) {
|
||||
return getDefaultValue(clazz);
|
||||
}
|
||||
|
||||
// 处理集合接口(直接实例化为ArrayList/HashSet等)
|
||||
if (clazz.isInterface()) {
|
||||
if (List.class.isAssignableFrom(clazz)) {
|
||||
clazz = ArrayList.class;
|
||||
} else if (Set.class.isAssignableFrom(clazz)) {
|
||||
clazz = HashSet.class;
|
||||
} else if (Map.class.isAssignableFrom(clazz)) {
|
||||
clazz = HashMap.class;
|
||||
} else {
|
||||
// 其他接口默认返回null(避免无法实例化)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// 创建类实例(支持static内部类)
|
||||
Constructor<?> constructor = clazz.getDeclaredConstructor();
|
||||
constructor.setAccessible(true); // 允许访问私有构造函数
|
||||
Object instance = constructor.newInstance();
|
||||
|
||||
// 初始化所有字段
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
field.setAccessible(true);
|
||||
Class<?> fieldType = field.getType();
|
||||
|
||||
// 跳过静态字段(通常不需要序列化静态成员)
|
||||
if (Modifier.isStatic(field.getModifiers())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 基本类型、包装类、字符串:直接设默认值
|
||||
if (isPrimitiveOrWrapper(fieldType) || fieldType.equals(String.class)) {
|
||||
field.set(instance, getDefaultValue(fieldType));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理数组
|
||||
if (fieldType.isArray()) {
|
||||
field.set(instance, initializeArray(fieldType));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理集合
|
||||
if (Collection.class.isAssignableFrom(fieldType)) {
|
||||
field.set(instance, initializeCollection(field));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理Map
|
||||
if (Map.class.isAssignableFrom(fieldType)) {
|
||||
field.set(instance, initializeMap(field));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理嵌套对象(包括static内部类)
|
||||
field.set(instance, initializeObject(fieldType));
|
||||
}
|
||||
|
||||
return instance;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("初始化对象失败: " + clazz.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数组
|
||||
*/
|
||||
private static Object initializeArray(Class<?> arrayType) {
|
||||
Class<?> componentType = arrayType.getComponentType();
|
||||
// 创建长度为1的数组
|
||||
Object array = Array.newInstance(componentType, 1);
|
||||
|
||||
// 初始化数组元素(字符串类型会返回空字符串)
|
||||
try {
|
||||
Object element = initializeObject(componentType);
|
||||
Array.set(array, 0, element);
|
||||
} catch (Exception e) {
|
||||
// 初始化失败时设置为对应类型的默认值(字符串为"")
|
||||
Array.set(array, 0, getDefaultValue(componentType));
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化集合
|
||||
*/
|
||||
private static Collection<?> initializeCollection(Field field) {
|
||||
Class<?> fieldType = field.getType();
|
||||
Type genericType = field.getGenericType();
|
||||
Collection<Object> collection;
|
||||
|
||||
// 创建具体集合实例
|
||||
try {
|
||||
if (fieldType.isInterface()) {
|
||||
collection = new ArrayList<>();
|
||||
} else {
|
||||
collection = (Collection<Object>) fieldType.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
collection = new ArrayList<>();
|
||||
}
|
||||
|
||||
// 处理泛型元素(字符串类型会添加空字符串)
|
||||
if (genericType instanceof ParameterizedType) {
|
||||
Type[] actualTypeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
|
||||
if (actualTypeArguments.length > 0 && actualTypeArguments[0] instanceof Class) {
|
||||
Class<?> elementType = (Class<?>) actualTypeArguments[0];
|
||||
try {
|
||||
Object element = initializeObject(elementType);
|
||||
collection.add(element);
|
||||
} catch (Exception e) {
|
||||
// 元素初始化失败时添加默认值(字符串为"")
|
||||
collection.add(getDefaultValue(elementType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化Map
|
||||
*/
|
||||
private static Map<?, ?> initializeMap(Field field) {
|
||||
Class<?> fieldType = field.getType();
|
||||
Type genericType = field.getGenericType();
|
||||
Map<Object, Object> map;
|
||||
|
||||
// 创建具体Map实例
|
||||
try {
|
||||
if (fieldType.isInterface()) {
|
||||
map = new HashMap<>();
|
||||
} else {
|
||||
map = (Map<Object, Object>) fieldType.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
map = new HashMap<>();
|
||||
}
|
||||
|
||||
// 处理泛型键值对(value为字符串时设为空字符串)
|
||||
if (genericType instanceof ParameterizedType) {
|
||||
Type[] actualTypeArguments = ((ParameterizedType) genericType).getActualTypeArguments();
|
||||
if (actualTypeArguments.length == 2) {
|
||||
try {
|
||||
// key默认用字符串"key",value按泛型类型设默认值(字符串为"")
|
||||
Object key = "key";
|
||||
Object value = actualTypeArguments[1] instanceof Class
|
||||
? initializeObject((Class<?>) actualTypeArguments[1])
|
||||
: getDefaultValue(String.class); // 非Class类型默认空字符串
|
||||
map.put(key, value);
|
||||
} catch (Exception e) {
|
||||
// 初始化失败时value设为对应类型默认值(字符串为"")
|
||||
map.put("key", getDefaultValue(actualTypeArguments[1] instanceof Class ? (Class<?>) actualTypeArguments[1] : String.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为基本类型或包装类
|
||||
*/
|
||||
private static boolean isPrimitiveOrWrapper(Class<?> type) {
|
||||
return type.isPrimitive()
|
||||
|| type.equals(Boolean.class)
|
||||
|| type.equals(Byte.class)
|
||||
|| type.equals(Short.class)
|
||||
|| type.equals(Integer.class)
|
||||
|| type.equals(Long.class)
|
||||
|| type.equals(Float.class)
|
||||
|| type.equals(Double.class)
|
||||
|| type.equals(Character.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型默认值:字符串返回空字符串,其他类型按原有逻辑
|
||||
*/
|
||||
private static Object getDefaultValue(Class<?> type) {
|
||||
if (type.equals(String.class)) {
|
||||
return "";
|
||||
}
|
||||
// 原有逻辑:基本类型返回对应默认值(boolean=false/数值=0/char='\0')
|
||||
if (type.isPrimitive()) {
|
||||
if (type == boolean.class) return false;
|
||||
if (type == char.class) return '\0';
|
||||
return 0; // 所有数值类型(byte/short/int/long/float/double)默认0
|
||||
}
|
||||
// 包装类(如Integer/Boolean)默认返回null(保持原有逻辑)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
12
src/main/java/com/yj/earth/dto/source/DeleteSourceDto.java
Normal file
12
src/main/java/com/yj/earth/dto/source/DeleteSourceDto.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.yj.earth.dto.source;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeleteSourceDto {
|
||||
@Schema(description = "资源ID列表")
|
||||
private List<String> ids;
|
||||
}
|
||||
92
src/main/java/com/yj/earth/params/AttackArrow.java
Normal file
92
src/main/java/com/yj/earth/params/AttackArrow.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("attackArrow")
|
||||
public class AttackArrow {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private String color;
|
||||
private double height;
|
||||
private int heightMode;
|
||||
private String areaUnit;
|
||||
private Line line;
|
||||
private List<Position> positions;
|
||||
private boolean spreadState;
|
||||
private boolean loop;
|
||||
private int spreadTime;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private double width;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
91
src/main/java/com/yj/earth/params/Curve.java
Normal file
91
src/main/java/com/yj/earth/params/Curve.java
Normal file
@ -0,0 +1,91 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("curve")
|
||||
public class Curve {
|
||||
private String id;
|
||||
private String name;
|
||||
private boolean rotate;
|
||||
private int space;
|
||||
private String speed;
|
||||
private String wordsName;
|
||||
private String lengthUnit;
|
||||
private double width;
|
||||
private String color;
|
||||
private int type;
|
||||
private int heightMode;
|
||||
private boolean noseToTail;
|
||||
private boolean extend;
|
||||
private double extendWidth;
|
||||
private String extendColor;
|
||||
private boolean show;
|
||||
private List<Position> positions;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private Boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
69
src/main/java/com/yj/earth/params/DiffuseScan.java
Normal file
69
src/main/java/com/yj/earth/params/DiffuseScan.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("diffuseScan")
|
||||
public class DiffuseScan {
|
||||
private String id;
|
||||
private String name;
|
||||
private double lng;
|
||||
private double lat;
|
||||
private List<Circle> circle;
|
||||
private boolean show;
|
||||
private String color;
|
||||
private double transparency;
|
||||
private int speed;
|
||||
private int count;
|
||||
private boolean positionEditin;
|
||||
private CustomView customView;
|
||||
private String richTextContent;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
|
||||
@Data
|
||||
public static class Circle {
|
||||
private double radius;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
// 空对象,暂无需字段
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private int lineWidth;
|
||||
private int pixelOffset;
|
||||
private List<String> backgroundColor;
|
||||
private String lineColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<Object> content;
|
||||
}
|
||||
}
|
||||
92
src/main/java/com/yj/earth/params/Line.java
Normal file
92
src/main/java/com/yj/earth/params/Line.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("line")
|
||||
public class Line {
|
||||
private String id;
|
||||
private String name;
|
||||
private boolean rotate;
|
||||
private int space;
|
||||
private String speed;
|
||||
private String wordsName;
|
||||
private String lengthUnit;
|
||||
private double width;
|
||||
private String color;
|
||||
private int type;
|
||||
private int heightMode;
|
||||
private boolean noseToTail;
|
||||
private boolean smooth;
|
||||
private boolean extend;
|
||||
private double extendWidth;
|
||||
private String extendColor;
|
||||
private boolean show;
|
||||
private List<Position> positions;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private Boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
89
src/main/java/com/yj/earth/params/Panel.java
Normal file
89
src/main/java/com/yj/earth/params/Panel.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("panel")
|
||||
public class Panel {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private String color;
|
||||
private double height;
|
||||
private int heightMode;
|
||||
private String areaUnit;
|
||||
private Line line;
|
||||
private List<Position> positions;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private double width;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
src/main/java/com/yj/earth/params/Path.java
Normal file
73
src/main/java/com/yj/earth/params/Path.java
Normal file
@ -0,0 +1,73 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("path")
|
||||
public class Path {
|
||||
private String id;
|
||||
private String name;
|
||||
private Model model;
|
||||
private Line line;
|
||||
private CustomView customView;
|
||||
private boolean show;
|
||||
private int speed;
|
||||
private int delay;
|
||||
private boolean loop;
|
||||
private int height;
|
||||
private boolean ground;
|
||||
private boolean state;
|
||||
private boolean routeDirection;
|
||||
private Label label;
|
||||
private boolean viewFollow;
|
||||
private boolean firstPersonView;
|
||||
private boolean realTimeRoute;
|
||||
|
||||
@Data
|
||||
public static class Model {
|
||||
private boolean show;
|
||||
private String url;
|
||||
private int pixelSize;
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
private int scale;
|
||||
private String animate;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private boolean show;
|
||||
private List<Position> positions;
|
||||
private boolean smooth;
|
||||
private boolean noseToTail;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private boolean show;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private int lineWidth;
|
||||
private int pixelOffset;
|
||||
private List<String> backgroundColor;
|
||||
private String lineColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
}
|
||||
92
src/main/java/com/yj/earth/params/PincerArrow.java
Normal file
92
src/main/java/com/yj/earth/params/PincerArrow.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("pincerArrow")
|
||||
public class PincerArrow {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private String color;
|
||||
private double height;
|
||||
private int heightMode;
|
||||
private String areaUnit;
|
||||
private Line line;
|
||||
private List<Position> positions;
|
||||
private boolean spreadState;
|
||||
private boolean loop;
|
||||
private int spreadTime;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private double width;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
116
src/main/java/com/yj/earth/params/Point.java
Normal file
116
src/main/java/com/yj/earth/params/Point.java
Normal file
@ -0,0 +1,116 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("point")
|
||||
public class Point {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private Position position;
|
||||
private int heightMode;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
private Billboard billboard;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Billboard {
|
||||
private boolean show;
|
||||
private String image;
|
||||
private String defaultImage;
|
||||
private int scale;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private boolean show;
|
||||
private int fontFamily;
|
||||
private int fontSize;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
private Vr vr;
|
||||
private Camera camera;
|
||||
private Isc isc;
|
||||
private Goods goods;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Vr {
|
||||
private List<VrContent> content;
|
||||
@Data
|
||||
public static class VrContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Camera {
|
||||
private List<Object> content;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Isc {
|
||||
private List<Object> content;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Goods {
|
||||
private List<GoodsContent> content;
|
||||
@Data
|
||||
public static class GoodsContent {
|
||||
private String id;
|
||||
private String name;
|
||||
private String cnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/main/java/com/yj/earth/params/PressModel.java
Normal file
21
src/main/java/com/yj/earth/params/PressModel.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("pressModel")
|
||||
public class PressModel {
|
||||
private String modelId;
|
||||
private double height;
|
||||
private List<Position> positions;
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
60
src/main/java/com/yj/earth/params/RadarScan.java
Normal file
60
src/main/java/com/yj/earth/params/RadarScan.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("radarScan")
|
||||
public class RadarScan {
|
||||
private String id;
|
||||
private String name;
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double radius;
|
||||
private boolean show;
|
||||
private String color;
|
||||
private int speed;
|
||||
private CustomView customView;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
// 空对象,暂无需字段
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private int lineWidth;
|
||||
private int pixelOffset;
|
||||
private List<String> backgroundColor;
|
||||
private String lineColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<Object> content;
|
||||
}
|
||||
}
|
||||
89
src/main/java/com/yj/earth/params/Rectangle.java
Normal file
89
src/main/java/com/yj/earth/params/Rectangle.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("rectangle")
|
||||
public class Rectangle {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private String color;
|
||||
private double height;
|
||||
private int heightMode;
|
||||
private String areaUnit;
|
||||
private Line line;
|
||||
private List<Position> positions;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private double width;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
89
src/main/java/com/yj/earth/params/Rendezvous.java
Normal file
89
src/main/java/com/yj/earth/params/Rendezvous.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.yj.earth.params;
|
||||
|
||||
import com.yj.earth.annotation.SourceType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SourceType("rendezvous")
|
||||
public class Rendezvous {
|
||||
private String id;
|
||||
private boolean show;
|
||||
private String name;
|
||||
private String color;
|
||||
private double height;
|
||||
private int heightMode;
|
||||
private String areaUnit;
|
||||
private Line line;
|
||||
private List<Position> positions;
|
||||
private Label label;
|
||||
private Attribute attribute;
|
||||
private String richTextContent;
|
||||
private CustomView customView;
|
||||
|
||||
@Data
|
||||
public static class Line {
|
||||
private double width;
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Position {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Label {
|
||||
private String text;
|
||||
private Boolean show;
|
||||
private Position position;
|
||||
private int fontSize;
|
||||
private int fontFamily;
|
||||
private String color;
|
||||
private double lineWidth;
|
||||
private String lineColor;
|
||||
private double pixelOffset;
|
||||
private String[] backgroundColor;
|
||||
private boolean scaleByDistance;
|
||||
private int near;
|
||||
private int far;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Attribute {
|
||||
private Link link;
|
||||
|
||||
@Data
|
||||
public static class Link {
|
||||
private List<LinkContent> content;
|
||||
|
||||
@Data
|
||||
public static class LinkContent {
|
||||
private String name;
|
||||
private String url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CustomView {
|
||||
private Orientation orientation;
|
||||
private RelativePosition relativePosition;
|
||||
|
||||
@Data
|
||||
public static class Orientation {
|
||||
private double heading;
|
||||
private double pitch;
|
||||
private double roll;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RelativePosition {
|
||||
private double lng;
|
||||
private double lat;
|
||||
private double alt;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user