From 627900ac8df4b387b24f8069081e2a264fd57a81 Mon Sep 17 00:00:00 2001 From: ZZX9599 <536509593@qq.com> Date: Thu, 11 Sep 2025 19:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/SourceController.java | 83 +++++-- .../business/service/RoleSourceService.java | 4 + .../service/impl/RoleSourceServiceImpl.java | 13 +- .../common/service/SourceParamsValidator.java | 7 + .../com/yj/earth/params/BillboardObject.java | 222 ------------------ .../com/yj/earth/params/CurvelineObject.java | 192 --------------- .../params/PolygonAttackArrowObject.java | 187 --------------- .../yj/earth/params/PolygonPanelObject.java | 178 -------------- .../params/PolygonPincerArrowObject.java | 187 --------------- .../earth/params/PolygonRectangleObject.java | 178 -------------- .../earth/params/PolygonRendezvousObject.java | 178 -------------- .../com/yj/earth/params/PolylineObject.java | 194 --------------- .../com/yj/earth/params/WallStereoscopic.java | 50 ++++ .../java/com/yj/earth/sdk/CltController.java | 33 +++ .../java/com/yj/earth/sdk/DirectService.java | 32 +++ .../com/yj/earth/sdk/MbtilesController.java | 29 +++ .../java/com/yj/earth/sdk/PakController.java | 35 +++ 17 files changed, 265 insertions(+), 1537 deletions(-) delete mode 100644 src/main/java/com/yj/earth/params/BillboardObject.java delete mode 100644 src/main/java/com/yj/earth/params/CurvelineObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolygonAttackArrowObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolygonPanelObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolygonPincerArrowObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolygonRectangleObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolygonRendezvousObject.java delete mode 100644 src/main/java/com/yj/earth/params/PolylineObject.java create mode 100644 src/main/java/com/yj/earth/sdk/CltController.java create mode 100644 src/main/java/com/yj/earth/sdk/DirectService.java create mode 100644 src/main/java/com/yj/earth/sdk/MbtilesController.java create mode 100644 src/main/java/com/yj/earth/sdk/PakController.java diff --git a/src/main/java/com/yj/earth/business/controller/SourceController.java b/src/main/java/com/yj/earth/business/controller/SourceController.java index 689d3f4..25eeb92 100644 --- a/src/main/java/com/yj/earth/business/controller/SourceController.java +++ b/src/main/java/com/yj/earth/business/controller/SourceController.java @@ -2,19 +2,19 @@ package com.yj.earth.business.controller; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.io.FileUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.yj.earth.business.domain.Source; import com.yj.earth.business.service.RoleSourceService; import com.yj.earth.business.service.SourceService; import com.yj.earth.business.service.UserService; +import com.yj.earth.common.service.SourceDataGenerator; import com.yj.earth.common.service.SourceParamsValidator; import com.yj.earth.common.util.ApiResponse; import com.yj.earth.common.util.MapUtil; -import com.yj.earth.dto.source.AddDirectoryDto; -import com.yj.earth.dto.source.AddModelSourceDto; -import com.yj.earth.dto.source.AddOtherSourceDto; -import com.yj.earth.dto.source.UpdateSourceDto; +import com.yj.earth.dto.source.*; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; @@ -22,8 +22,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.Map; -import java.util.Set; +import java.util.*; import static com.yj.earth.common.constant.GlobalConstant.DIRECTORY; import static com.yj.earth.common.constant.GlobalConstant.SHOW; @@ -42,6 +41,9 @@ public class SourceController { @Resource private SourceParamsValidator sourceParamsValidator; + @Resource + private SourceDataGenerator sourceDataGenerator; + @PostMapping("/addDirectory") @Operation(summary = "新增目录资源") public ApiResponse addDirectory(@RequestBody AddDirectoryDto addDirectoryDto) { @@ -79,6 +81,7 @@ public class SourceController { String detail = sourceService.getDetail(sourcePath, sourceId); // 构建并保存资源对象 Source source = new Source(); + source.setId(addModelSourceDto.getId()); source.setSourcePath(sourcePath); source.setSourceName(sourceName); source.setParentId(addModelSourceDto.getParentId()); @@ -107,7 +110,6 @@ public class SourceController { addOtherSourceDto.getSourceType(), addOtherSourceDto.getParams() ); - System.out.println(validatedParams); Source source = new Source(); BeanUtils.copyProperties(addOtherSourceDto, source); source.setIsShow(SHOW); @@ -119,7 +121,7 @@ public class SourceController { } - @Operation(summary = "更新资源信息及参数") + @Operation(summary = "更新资源信息") @PostMapping("/update") public ApiResponse updateSource(@RequestBody UpdateSourceDto updateSourceDto) { // 查询资源 @@ -127,10 +129,8 @@ public class SourceController { if (source == null) { return ApiResponse.failure("资源不存在"); } - // 更新基本信息 BeanUtils.copyProperties(updateSourceDto, source); - // 处理参数更新 if (updateSourceDto.getParams() != null && !updateSourceDto.getParams().isEmpty()) { // 获取类型 @@ -140,29 +140,72 @@ public class SourceController { sourceType, updateSourceDto.getParams() ); - // 获取原始数据的 Map 并合并新参数 Map dataMap = MapUtil.jsonToMap(source.getParams()); MapUtil.mergeMaps(dataMap, updateSourceDto.getParams()); source.setParams(MapUtil.mapToString(dataMap)); } - // 保存更新 sourceService.updateById(source); return ApiResponse.success(source); } - @GetMapping("/type") - @Operation(summary = "获取支持的资源类型") - public ApiResponse getSupportedSourceTypes() { - Set supportedTypes = sourceParamsValidator.getSupportedSourceTypes(); - return ApiResponse.success(supportedTypes); - } - - @Operation(summary = "获取资源列表") @GetMapping("/list") public ApiResponse list() { return ApiResponse.success(sourceService.getSourceListByUserId(StpUtil.getLoginIdAsString())); } + + @Operation(summary = "删除资源数据") + @PostMapping("/delete") + public ApiResponse delete(@RequestBody DeleteSourceDto deleteSourceDto) { + if (deleteSourceDto.getIds() == null || deleteSourceDto.getIds().isEmpty()) { + return ApiResponse.failure("资源ID列表不能为空"); + } + + // 收集所有需要删除的资源ID(包括子资源) + Set allIds = new HashSet<>(); + + for (String id : deleteSourceDto.getIds()) { + // 获取资源 + Source source = sourceService.getById(id); + if (source == null) { + return ApiResponse.failure("资源ID为" + id + "的资源不存在"); + } + + // 查询ID等于自身或者父级ID等于自身的资源 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Source::getId, source.getId()) + .or() + .eq(Source::getParentId, source.getId()); + List list = sourceService.list(queryWrapper); + + // 筛选ID列表并添加到总集合中 + list.stream().map(Source::getId).forEach(allIds::add); + } + + // 删除这些资源 + sourceService.removeByIds(allIds); + + // 删除这些资源下的所有角色资源关系 + roleSourceService.deleteRoleSource( + userService.getById(StpUtil.getLoginIdAsString()).getRoleId(), + new ArrayList<>(allIds) + ); + + return ApiResponse.success(null); + } + + @GetMapping("/type") + @Operation(summary = "获取已有类型") + public ApiResponse getSupportedSourceTypes() { + Set supportedTypes = sourceParamsValidator.getSupportedSourceTypes(); + return ApiResponse.success(supportedTypes); + } + + @Operation(summary = "获取示例数据") + @GetMapping("/paramsExample") + public String getExampleData(String sourceType) throws JsonProcessingException { + return sourceDataGenerator.generateDefaultJson(sourceType); + } } diff --git a/src/main/java/com/yj/earth/business/service/RoleSourceService.java b/src/main/java/com/yj/earth/business/service/RoleSourceService.java index 82be8b3..aa1ce5a 100644 --- a/src/main/java/com/yj/earth/business/service/RoleSourceService.java +++ b/src/main/java/com/yj/earth/business/service/RoleSourceService.java @@ -3,7 +3,11 @@ package com.yj.earth.business.service; import com.yj.earth.business.domain.RoleSource; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + public interface RoleSourceService extends IService { void addRoleSource(String roleId, String sourceId); + + void deleteRoleSource(String roleId, List sourceIds); } diff --git a/src/main/java/com/yj/earth/business/service/impl/RoleSourceServiceImpl.java b/src/main/java/com/yj/earth/business/service/impl/RoleSourceServiceImpl.java index c263d77..eb918f8 100644 --- a/src/main/java/com/yj/earth/business/service/impl/RoleSourceServiceImpl.java +++ b/src/main/java/com/yj/earth/business/service/impl/RoleSourceServiceImpl.java @@ -1,11 +1,14 @@ package com.yj.earth.business.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yj.earth.business.domain.RoleSource; import com.yj.earth.business.mapper.RoleSourceMapper; import com.yj.earth.business.service.RoleSourceService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class RoleSourceServiceImpl extends ServiceImpl implements RoleSourceService { @@ -17,4 +20,12 @@ public class RoleSourceServiceImpl extends ServiceImpl sourceIds) { + LambdaQueryWrapper roleSourceLambdaQueryWrapper = new LambdaQueryWrapper<>(); + roleSourceLambdaQueryWrapper.eq(RoleSource::getRoleId, roleId); + roleSourceLambdaQueryWrapper.in(RoleSource::getSourceId, sourceIds); + remove(roleSourceLambdaQueryWrapper); + } } diff --git a/src/main/java/com/yj/earth/common/service/SourceParamsValidator.java b/src/main/java/com/yj/earth/common/service/SourceParamsValidator.java index 5d226c4..70da77a 100644 --- a/src/main/java/com/yj/earth/common/service/SourceParamsValidator.java +++ b/src/main/java/com/yj/earth/common/service/SourceParamsValidator.java @@ -54,4 +54,11 @@ public class SourceParamsValidator { public Set getSupportedSourceTypes() { return sourceTypeMap.keySet(); } + + /** + * 获取sourceType与类的映射关系 + */ + public Map> getSourceTypeMap() { + return sourceTypeMap; + } } diff --git a/src/main/java/com/yj/earth/params/BillboardObject.java b/src/main/java/com/yj/earth/params/BillboardObject.java deleted file mode 100644 index 57493f2..0000000 --- a/src/main/java/com/yj/earth/params/BillboardObject.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "点标注对象") -@SourceType("point") -public class BillboardObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "标注整体的显隐", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "位置(必填)") - private Position position = new Position(); - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附地表; 3:依附模型)", defaultValue = "3") - private int heightMode = 3; - - @Schema(description = "是否开启跟随视野缩放", defaultValue = "true") - private boolean scaleByDistance = true; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - - @Schema(description = "图标参数") - private Billboard billboard = new Billboard(); - - @Schema(description = "文字参数") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "图标参数") - public static class Billboard { - @Schema(description = "图标显隐", defaultValue = "true") - private boolean show = true; - - @Schema(description = "图标路径") - private String image; - - @Schema(description = "默认图标的唯一标识") - private String defaultImage; - - @Schema(description = "图标放大倍数", defaultValue = "3") - private int scale = 3; - } - - @Data - @Schema(description = "文字参数") - public static class Label { - @Schema(description = "文字内容") - private String text; - - @Schema(description = "文字显隐", defaultValue = "true") - private boolean show = true; - - @Schema(description = "文字字体项(0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体)", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "文字大小、单位px", defaultValue = "39") - private int fontSize = 39; - - @Schema(description = "文字颜色", defaultValue = "#00ffff") - private String color = "#00ffff"; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接") - private Link link = new Link(); - - @Schema(description = "全景图") - private Vr vr = new Vr(); - - @Schema(description = "摄像头") - private Camera camera = new Camera(); - - @Schema(description = "ISC") - private Isc isc = new Isc(); - - @Schema(description = "物资") - private Goods goods = new Goods(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - - @Data - @Schema(description = "全景图属性") - public static class Vr { - @Schema(description = "全景图内容列表") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "全景图内容") - public static class VrContent { - @Schema(description = "名称") - private String name; - - @Schema(description = "地址") - private String url; - } - } - - @Data - @Schema(description = "摄像头属性") - public static class Camera { - @Schema(description = "摄像头内容列表") - private List content = new ArrayList<>(); - } - - @Data - @Schema(description = "ISC属性") - public static class Isc { - @Schema(description = "ISC内容列表") - private List content = new ArrayList<>(); - } - - @Data - @Schema(description = "物资属性") - public static class Goods { - @Schema(description = "物资内容列表") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "物资内容") - public static class GoodsContent { - @Schema(description = "id") - private String id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "数量") - private String cnt; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} diff --git a/src/main/java/com/yj/earth/params/CurvelineObject.java b/src/main/java/com/yj/earth/params/CurvelineObject.java deleted file mode 100644 index d43e1cf..0000000 --- a/src/main/java/com/yj/earth/params/CurvelineObject.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "曲线对象") -@SourceType("curve") -public class CurvelineObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "首尾相反", defaultValue = "false") - private boolean rotate = false; - - @Schema(description = "间距", defaultValue = "1") - - private int space = 1; - @Schema(description = "速度", defaultValue = "10") - - private String speed = "10"; - @Schema(description = "空间单位名称", defaultValue = "0") - private String wordsName; - - @Schema(description = "长度单位", defaultValue = "0") - private String lengthUnit; - - @Schema(description = "线宽", defaultValue = "3") - private double width = 3; - - @Schema(description = "颜色", defaultValue = "#ff0000") - private String color = "#ff0000"; - - @Schema(description = "材质类型 0-实线 1-虚线 2-泛光...", defaultValue = "0") - private int type = 0; - - @Schema(description = "高度模式(0:海拔高度;1:相对高度;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "首尾相连", defaultValue = "false") - private boolean noseToTail = false; - - @Schema(description = "线缓冲", defaultValue = "false") - private boolean extend = false; - - @Schema(description = "线缓冲宽度", defaultValue = "10") - private double extendWidth = 10; - - @Schema(description = "线缓冲颜色", defaultValue = "rgba(255,255,80,0.3)") - private String extendColor = "rgba(255,255,80,0.3)"; - - @Schema(description = "显隐", defaultValue = "true") - private boolean show = true; - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放") - private Boolean scaleByDistance; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} diff --git a/src/main/java/com/yj/earth/params/PolygonAttackArrowObject.java b/src/main/java/com/yj/earth/params/PolygonAttackArrowObject.java deleted file mode 100644 index 3cf4a83..0000000 --- a/src/main/java/com/yj/earth/params/PolygonAttackArrowObject.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "箭头对象") -@SourceType("attackArrow") -public class PolygonAttackArrowObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "显示/隐藏", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "颜色", defaultValue = "rgba(255, 0, 0, 0.5)") - private String color = "rgba(255, 0, 0, 0.5)"; - - @Schema(description = "高度") - private double height; - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "面积单位", defaultValue = "平方米") - private String areaUnit = "平方米"; - - @Schema(description = "边框") - private Line line = new Line(); - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "动画", defaultValue = "false") - private boolean spreadState = false; - - @Schema(description = "动画重复", defaultValue = "false") - private boolean loop = false; - - @Schema(description = "动画持续时长(毫秒)", defaultValue = "3000") - private int spreadTime = 3000; - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "边框属性") - public static class Line { - @Schema(description = "边框宽", defaultValue = "2") - private double width = 2; - - @Schema(description = "边框颜色", defaultValue = "rgba(155, 155, 124, 0.89)") - private String color = "rgba(155, 155, 124, 0.89)"; - } - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放", defaultValue = "false") - private boolean scaleByDistance = false; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接", defaultValue = "{}") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} - \ No newline at end of file diff --git a/src/main/java/com/yj/earth/params/PolygonPanelObject.java b/src/main/java/com/yj/earth/params/PolygonPanelObject.java deleted file mode 100644 index 0963234..0000000 --- a/src/main/java/com/yj/earth/params/PolygonPanelObject.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "多边形对象") -@SourceType("panel") -public class PolygonPanelObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "显示/隐藏", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "颜色", defaultValue = "rgba(255, 0, 0, 0.5)") - private String color = "rgba(255, 0, 0, 0.5)"; - - @Schema(description = "高度") - private double height; - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "面积单位", defaultValue = "平方米") - private String areaUnit = "平方米"; - - @Schema(description = "边框") - private Line line = new Line(); - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "边框属性") - public static class Line { - @Schema(description = "边框宽", defaultValue = "2") - private double width = 2; - - @Schema(description = "边框颜色", defaultValue = "rgba(155, 155, 124, 0.89)") - private String color = "rgba(155, 155, 124, 0.89)"; - } - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放", defaultValue = "false") - private boolean scaleByDistance = false; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接", defaultValue = "{}") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} - \ No newline at end of file diff --git a/src/main/java/com/yj/earth/params/PolygonPincerArrowObject.java b/src/main/java/com/yj/earth/params/PolygonPincerArrowObject.java deleted file mode 100644 index 2a43800..0000000 --- a/src/main/java/com/yj/earth/params/PolygonPincerArrowObject.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "钳形箭头对象") -@SourceType("pincerArrow") -public class PolygonPincerArrowObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "显示/隐藏", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "颜色", defaultValue = "rgba(255, 0, 0, 0.5)") - private String color = "rgba(255, 0, 0, 0.5)"; - - @Schema(description = "高度") - private double height; - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "面积单位", defaultValue = "平方米") - private String areaUnit = "平方米"; - - @Schema(description = "边框") - private Line line = new Line(); - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "动画", defaultValue = "false") - private boolean spreadState = false; - - @Schema(description = "动画重复", defaultValue = "false") - private boolean loop = false; - - @Schema(description = "动画持续时长(毫秒)", defaultValue = "3000") - private int spreadTime = 3000; - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "边框属性") - public static class Line { - @Schema(description = "边框宽", defaultValue = "2") - private double width = 2; - - @Schema(description = "边框颜色", defaultValue = "rgba(155, 155, 124, 0.89)") - private String color = "rgba(155, 155, 124, 0.89)"; - } - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放", defaultValue = "false") - private boolean scaleByDistance = false; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接", defaultValue = "{}") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} - \ No newline at end of file diff --git a/src/main/java/com/yj/earth/params/PolygonRectangleObject.java b/src/main/java/com/yj/earth/params/PolygonRectangleObject.java deleted file mode 100644 index 607ff51..0000000 --- a/src/main/java/com/yj/earth/params/PolygonRectangleObject.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "矩形对象") -@SourceType("rectangle") -public class PolygonRectangleObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "显示/隐藏", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "颜色", defaultValue = "rgba(255, 0, 0, 0.5)") - private String color = "rgba(255, 0, 0, 0.5)"; - - @Schema(description = "高度") - private double height; - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "面积单位", defaultValue = "平方米") - private String areaUnit = "平方米"; - - @Schema(description = "边框") - private Line line = new Line(); - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "边框属性") - public static class Line { - @Schema(description = "边框宽", defaultValue = "2") - private double width = 2; - - @Schema(description = "边框颜色", defaultValue = "rgba(155, 155, 124, 0.89)") - private String color = "rgba(155, 155, 124, 0.89)"; - } - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放", defaultValue = "false") - private boolean scaleByDistance = false; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接", defaultValue = "{}") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} - \ No newline at end of file diff --git a/src/main/java/com/yj/earth/params/PolygonRendezvousObject.java b/src/main/java/com/yj/earth/params/PolygonRendezvousObject.java deleted file mode 100644 index f4aa1d4..0000000 --- a/src/main/java/com/yj/earth/params/PolygonRendezvousObject.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "集结地对象") -@SourceType("rendezvous") -public class PolygonRendezvousObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "显示/隐藏", defaultValue = "true") - private boolean show = true; - - @Schema(description = "名称") - private String name; - - @Schema(description = "颜色", defaultValue = "rgba(255, 0, 0, 0.5)") - private String color = "rgba(255, 0, 0, 0.5)"; - - @Schema(description = "高度") - private double height; - - @Schema(description = "高度模式(0:海拔高度;1:相对地表;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "面积单位", defaultValue = "平方米") - private String areaUnit = "平方米"; - - @Schema(description = "边框") - private Line line = new Line(); - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "边框属性") - public static class Line { - @Schema(description = "边框宽", defaultValue = "2") - private double width = 2; - - @Schema(description = "边框颜色", defaultValue = "rgba(155, 155, 124, 0.89)") - private String color = "rgba(155, 155, 124, 0.89)"; - } - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放", defaultValue = "false") - private boolean scaleByDistance = false; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接", defaultValue = "{}") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} - \ No newline at end of file diff --git a/src/main/java/com/yj/earth/params/PolylineObject.java b/src/main/java/com/yj/earth/params/PolylineObject.java deleted file mode 100644 index 3dd329c..0000000 --- a/src/main/java/com/yj/earth/params/PolylineObject.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.yj.earth.params; - -import com.yj.earth.annotation.SourceType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data -@Schema(description = "线对象") -@SourceType("line") -public class PolylineObject { - @Schema(description = "唯一标识") - private String id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "首尾相反", defaultValue = "false") - private boolean rotate = false; - - @Schema(description = "间距", defaultValue = "1") - private int space = 1; - @Schema(description = "速度", defaultValue = "10") - - private String speed = "10"; - @Schema(description = "空间单位名称", defaultValue = "0") - private String wordsName; - - @Schema(description = "长度单位", defaultValue = "0") - private String lengthUnit; - - @Schema(description = "线宽", defaultValue = "3") - private double width = 3; - - @Schema(description = "颜色", defaultValue = "#ff0000") - private String color = "#ff0000"; - - @Schema(description = "材质类型 0-实线 1-虚线 2-泛光...", defaultValue = "0") - private int type = 0; - - @Schema(description = "高度模式(0:海拔高度;1:相对高度;2:依附模式)", defaultValue = "2") - private int heightMode = 2; - - @Schema(description = "首尾相连", defaultValue = "false") - private boolean noseToTail = false; - - @Schema(description = "线段圆滑", defaultValue = "false") - private boolean smooth = false; - - @Schema(description = "线缓冲", defaultValue = "false") - private boolean extend = false; - - @Schema(description = "线缓冲宽度", defaultValue = "10") - private double extendWidth = 10; - - @Schema(description = "线缓冲颜色", defaultValue = "rgba(255,255,80,0.3)") - private String extendColor = "rgba(255,255,80,0.3)"; - - @Schema(description = "显隐", defaultValue = "true") - private boolean show = true; - - @Schema(description = "经纬度和高度的列表(必填)") - private List positions = new ArrayList<>(); - - @Schema(description = "标签对象") - private Label label = new Label(); - - @Schema(description = "属性内容") - private Attribute attribute = new Attribute(); - - @Schema(description = "富文本内容") - private String richTextContent; - - @Schema(description = "默认视角") - private CustomView customView = new CustomView(); - - @Data - @Schema(description = "位置属性") - public static class Position { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - - @Data - @Schema(description = "标签参数") - public static class Label { - @Schema(description = "标签文本") - private String text; - - @Schema(description = "标签显隐") - private Boolean show; - - @Schema(description = "标签位置") - private Position position = new Position(); - - @Schema(description = "字体大小", defaultValue = "20") - private int fontSize = 20; - - @Schema(description = "字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体", defaultValue = "0") - private int fontFamily = 0; - - @Schema(description = "字体颜色", defaultValue = "#ffffff") - private String color = "#ffffff"; - - @Schema(description = "引线宽", defaultValue = "4") - private double lineWidth = 4; - - @Schema(description = "引线颜色", defaultValue = "#00ffff80") - private String lineColor = "#00ffff80"; - - @Schema(description = "字体偏移(引线长度)", defaultValue = "20") - private double pixelOffset = 20; - - @Schema(description = "背景颜色", defaultValue = "['#00ffff80', '#00ffff80']") - private String[] backgroundColor = {"#00ffff80", "#00ffff80"}; - - @Schema(description = "距离缩放") - private Boolean scaleByDistance; - - @Schema(description = "视野缩放最近距离", defaultValue = "2000") - private int near = 2000; - - @Schema(description = "视野缩放最远距离", defaultValue = "100000") - private int far = 100000; - } - - @Data - @Schema(description = "属性内容") - public static class Attribute { - @Schema(description = "链接") - private Link link = new Link(); - - @Data - @Schema(description = "链接属性") - public static class Link { - @Schema(description = "链接内容列表", defaultValue = "[]") - private List content = new ArrayList<>(); - - @Data - @Schema(description = "链接内容") - public static class LinkContent { - @Schema(description = "链接名称") - private String name; - - @Schema(description = "链接地址") - private String url; - } - } - } - - @Data - @Schema(description = "默认视角属性") - public static class CustomView { - @Schema(description = "默认视角方位") - private Orientation orientation = new Orientation(); - - @Schema(description = "视角相对位置") - private RelativePosition relativePosition = new RelativePosition(); - - @Data - @Schema(description = "视角方位属性") - public static class Orientation { - @Schema(description = "航向角") - private double heading; - - @Schema(description = "俯仰角") - private double pitch; - - @Schema(description = "翻滚角") - private double roll; - } - - @Data - @Schema(description = "视角相对位置属性") - public static class RelativePosition { - @Schema(description = "经度") - private double lng; - - @Schema(description = "纬度") - private double lat; - - @Schema(description = "高度") - private double alt; - } - } -} diff --git a/src/main/java/com/yj/earth/params/WallStereoscopic.java b/src/main/java/com/yj/earth/params/WallStereoscopic.java index 44f1640..b8e1c94 100644 --- a/src/main/java/com/yj/earth/params/WallStereoscopic.java +++ b/src/main/java/com/yj/earth/params/WallStereoscopic.java @@ -1,7 +1,57 @@ package com.yj.earth.params; import com.yj.earth.annotation.SourceType; +import lombok.Data; + +import java.util.List; @SourceType("wallStereoscopic") +@Data public class WallStereoscopic { + private String id; + private String name; + private List positions; + private boolean show; + private String color; + private double extrudedHeight; + private int material; + private int duration; + private boolean noseToTail; + private Label label; + private String instruct; + private String operatingPoint; + private Attribute attribute; + + @Data + public static class Position { + private double lng; + private double lat; + private double alt; + } + + @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 backgroundColor; + private String lineColor; + private boolean scaleByDistance; + private int near; + private int far; + } + + @Data + public static class Attribute { + private Link link; + } + + @Data + public static class Link { + private List content; + } } + diff --git a/src/main/java/com/yj/earth/sdk/CltController.java b/src/main/java/com/yj/earth/sdk/CltController.java new file mode 100644 index 0000000..81b78fb --- /dev/null +++ b/src/main/java/com/yj/earth/sdk/CltController.java @@ -0,0 +1,33 @@ +package com.yj.earth.sdk; + +import com.yj.earth.common.config.ServerConfig; +import com.yj.earth.common.util.HttpUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.net.MalformedURLException; +import java.net.URL; + +@Slf4j +@RestController +@Tag(name = "模型数据相关") +@RequestMapping("/data/clt") +public class CltController { + + @Resource + private DirectService directService; + + @Operation(summary = "获取倾斜模型数据") + @GetMapping("/{sourceId}/**") + public Object getData(HttpServletRequest request) { + return HttpUtil.doGetForByteArrayResponse(directService.getDirectUrl(request)); + } +} diff --git a/src/main/java/com/yj/earth/sdk/DirectService.java b/src/main/java/com/yj/earth/sdk/DirectService.java new file mode 100644 index 0000000..11d1ad9 --- /dev/null +++ b/src/main/java/com/yj/earth/sdk/DirectService.java @@ -0,0 +1,32 @@ +package com.yj.earth.sdk; + +import com.yj.earth.common.config.ServerConfig; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.net.MalformedURLException; +import java.net.URL; + +@Service +public class DirectService { + + @Resource + private ServerConfig serverConfig; + + /** + * 获取转发的SDK地址 + */ + public String getDirectUrl(HttpServletRequest request) { + try { + // 获取原始请求的完整URL + String originalUrl = request.getRequestURL().toString(); + // 解析原始URL + URL url = new URL(originalUrl); + // 构建新URL、保持协议、主机、路径不变、只替换端口 + return new URL(url.getProtocol(), serverConfig.getHost(), serverConfig.getSdkPort(), url.getPath()).toString(); + } catch (MalformedURLException e) { + throw new RuntimeException("转发到SDK错误"); + } + } +} diff --git a/src/main/java/com/yj/earth/sdk/MbtilesController.java b/src/main/java/com/yj/earth/sdk/MbtilesController.java new file mode 100644 index 0000000..00beb19 --- /dev/null +++ b/src/main/java/com/yj/earth/sdk/MbtilesController.java @@ -0,0 +1,29 @@ +package com.yj.earth.sdk; + +import com.yj.earth.common.util.HttpUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Slf4j +@RestController +@Tag(name = "模型数据相关") +@RequestMapping("/data/mbtiles") +public class MbtilesController { + @Resource + private DirectService directService; + + @Operation(summary = "获取二维影像数据") + @GetMapping("{sourceId}/{z}/{x}/{y}.{format}") + public Object getData(HttpServletRequest request) { + return HttpUtil.doGetForByteArrayResponse(directService.getDirectUrl(request)); + } +} diff --git a/src/main/java/com/yj/earth/sdk/PakController.java b/src/main/java/com/yj/earth/sdk/PakController.java new file mode 100644 index 0000000..6903935 --- /dev/null +++ b/src/main/java/com/yj/earth/sdk/PakController.java @@ -0,0 +1,35 @@ +package com.yj.earth.sdk; + +import com.yj.earth.common.util.HttpUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Slf4j +@RestController +@Tag(name = "模型数据相关") +@RequestMapping("/data/pak") +public class PakController { + @Resource + private DirectService directService; + @Operation(summary = "获取地形描述文件") + @GetMapping("/{mark}/layer.json") + public Object jsonBySourceIdAndParam(HttpServletRequest request) { + return HttpUtil.doGetForByteArrayResponse(directService.getDirectUrl(request)); + } + + @Operation(summary = "获取地形相关的数据") + @GetMapping("/{mark}/{z}/{x}/{y}.{suffix}") + public Object data(HttpServletRequest request){ + return HttpUtil.doGetForByteArrayResponse(directService.getDirectUrl(request)); + } +}