diff --git a/src/main/java/com/yj/earth/business/controller/PbfInfoController.java b/src/main/java/com/yj/earth/business/controller/PbfInfoController.java index a1ff62b..6079216 100644 --- a/src/main/java/com/yj/earth/business/controller/PbfInfoController.java +++ b/src/main/java/com/yj/earth/business/controller/PbfInfoController.java @@ -43,6 +43,16 @@ public class PbfInfoController { return ApiResponse.success(null); } + @Operation(summary = "获取所有地图文件") + @GetMapping("/list") + public ApiResponse list() { + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda(); + // 把启用的排在最前面 + queryWrapper.orderByDesc(PbfInfo::getIsEnable); + queryWrapper.orderByAsc(PbfInfo::getCreatedAt); + return ApiResponse.success(pbfInfoService.list(queryWrapper)); + } + @Operation(summary = "启用地图文件") @PostMapping("/enable") public ApiResponse enable(@Parameter(description = "地图文件ID") @RequestParam(required = true) String id) { @@ -74,13 +84,5 @@ public class PbfInfoController { return ApiResponse.success(null); } - @Operation(summary = "获取所有地图文件") - @GetMapping("/list") - public ApiResponse list() { - LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda(); - // 把启用的排在最前面 - queryWrapper.orderByDesc(PbfInfo::getIsEnable); - queryWrapper.orderByAsc(PbfInfo::getCreatedAt); - return ApiResponse.success(pbfInfoService.list(queryWrapper)); - } + } diff --git a/src/main/java/com/yj/earth/business/controller/PoiController.java b/src/main/java/com/yj/earth/business/controller/PoiController.java index 7900e47..436cb65 100644 --- a/src/main/java/com/yj/earth/business/controller/PoiController.java +++ b/src/main/java/com/yj/earth/business/controller/PoiController.java @@ -1,6 +1,7 @@ package com.yj.earth.business.controller; import com.yj.earth.common.util.ApiResponse; +import com.yj.earth.vo.PoiVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -36,7 +37,6 @@ public class PoiController { @Operation(summary = "查看数据") public ApiResponse data(@Parameter(description = "分页页码") Integer pageNum, @Parameter(description = "分页大小") Integer pageSize, @Parameter(description = "名称搜索") String name) { int offset = (pageNum - 1) * pageSize; - // 构建查询SQL StringBuilder dataSql = new StringBuilder("SELECT id, name, address, lng, lat FROM tbl_pois WHERE 1=1"); List params = new ArrayList<>(); // 添加名称搜索条件 @@ -48,7 +48,7 @@ public class PoiController { dataSql.append(" LIMIT ? OFFSET ?"); try { // 执行数据查询、获取List - List poiList = new ArrayList<>(); + List poiList = new ArrayList<>(); long dataStartTime = System.currentTimeMillis(); try (PreparedStatement dataPs = connection.prepareStatement(dataSql.toString())) { // 设置参数(搜索条件 + 分页参数) @@ -61,7 +61,7 @@ public class PoiController { // 处理结果集、填充List try (ResultSet dataRs = dataPs.executeQuery()) { while (dataRs.next()) { - Poi poi = new Poi(); + PoiVo poi = new PoiVo(); poi.setId(dataRs.getLong("id")); poi.setName(dataRs.getString("name")); poi.setAddress(dataRs.getString("address")); @@ -76,13 +76,4 @@ public class PoiController { return ApiResponse.failure("POI数据查询失败:" + e.getMessage()); } } - - @Data - private static class Poi { - private Long id; - private String name; - private String address; - private String lng; - private String lat; - } } diff --git a/src/main/java/com/yj/earth/business/controller/PoiInfoController.java b/src/main/java/com/yj/earth/business/controller/PoiInfoController.java new file mode 100644 index 0000000..15e701c --- /dev/null +++ b/src/main/java/com/yj/earth/business/controller/PoiInfoController.java @@ -0,0 +1,137 @@ +package com.yj.earth.business.controller; + +import cn.hutool.core.io.FileUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yj.earth.business.domain.PoiInfo; +import com.yj.earth.business.service.PoiInfoService; +import com.yj.earth.common.util.ApiResponse; +import com.yj.earth.common.util.SQLiteUtil; +import com.yj.earth.vo.PoiVo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +@RestController +@Tag(name = "POI文件管理") +@RequestMapping("/poiInfo") +public class PoiInfoController { + @Resource + private PoiInfoService poiInfoService; + + @Operation(summary = "添加POI文件") + @PostMapping("/add") + public ApiResponse add(@Parameter(description = "POI文件路径") @RequestParam(required = true) String path) { + PoiInfo poiInfo = new PoiInfo(); + poiInfo.setPath(path); + poiInfo.setName(FileUtil.mainName(path)); + poiInfo.setIsEnable(0); + poiInfoService.save(poiInfo); + return ApiResponse.success(null); + } + + @Operation(summary = "删除POI文件") + @PostMapping("/delete") + public ApiResponse delete(@Parameter(description = "POI文件ID") @RequestParam(required = true) String id) { + poiInfoService.removeById(id); + return ApiResponse.success(null); + } + + @Operation(summary = "获取所有POI文件") + @GetMapping("/list") + public ApiResponse list() { + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda(); + // 把启用的排在最前面 + queryWrapper.orderByDesc(PoiInfo::getIsEnable); + queryWrapper.orderByAsc(PoiInfo::getCreatedAt); + return ApiResponse.success(poiInfoService.list(queryWrapper)); + } + + @Operation(summary = "启用POI文件") + @PostMapping("/enable") + public ApiResponse enable(@Parameter(description = "地图文件ID") @RequestParam(required = true) String id) { + PoiInfo poiInfo = poiInfoService.getById(id); + poiInfo.setIsEnable(1); + poiInfoService.updateById(poiInfo); + // 除这条数据以外的全部为禁用 + List list = poiInfoService.list(); + for (PoiInfo info : list) { + if (!info.getId().equals(id)) { + info.setIsEnable(0); + poiInfoService.updateById(info); + } + } + return ApiResponse.success(null); + } + + @Operation(summary = "禁用POI文件") + @PostMapping("/disable") + public ApiResponse disable(@Parameter(description = "地图文件ID") @RequestParam(required = true) String id) { + PoiInfo poiInfo = new PoiInfo(); + poiInfo.setId(id); + poiInfo.setIsEnable(0); + poiInfoService.updateById(poiInfo); + return ApiResponse.success(null); + } + + @Operation(summary = "POI搜索") + @GetMapping("/search") + public ApiResponse search( + @Parameter(description = "分页页码") Integer pageNum, + @Parameter(description = "分页大小") Integer pageSize, + @Parameter(description = "名称搜索") String name) { + int offset = (pageNum - 1) * pageSize; + // 查询启用的POI文件 + PoiInfo poiInfo = poiInfoService.getOne(new QueryWrapper().lambda().eq(PoiInfo::getIsEnable, 1)); + if (poiInfo == null) { + return ApiResponse.failure("未找到启用的POI数据文件"); + } + String path = poiInfo.getPath(); + // 构建查询SQL + StringBuilder dataSql = new StringBuilder("SELECT id, name, address, lng, lat FROM tbl_pois WHERE 1=1"); + List params = new ArrayList<>(); + // 名称搜索条件 + if (name != null && !name.trim().isEmpty()) { + dataSql.append(" AND name LIKE ?"); + params.add("%" + name.trim() + "%"); + } + // 分页条件 + dataSql.append(" LIMIT ? OFFSET ?"); + // 执行查询 + try (Connection connection = SQLiteUtil.getConnection(path); + PreparedStatement dataPs = connection.prepareStatement(dataSql.toString())) { + // 设置参数 + int paramIndex = 1; + for (Object param : params) { + dataPs.setObject(paramIndex++, param); + } + dataPs.setInt(paramIndex++, pageSize); + dataPs.setInt(paramIndex++, offset); + // 处理结果集 + List poiList = new ArrayList<>(); + try (ResultSet dataRs = dataPs.executeQuery()) { + while (dataRs.next()) { + PoiVo poi = new PoiVo(); + poi.setId(dataRs.getLong("id")); + poi.setName(dataRs.getString("name")); + poi.setAddress(dataRs.getString("address")); + poi.setLng(dataRs.getString("lng")); + poi.setLat(dataRs.getString("lat")); + poiList.add(poi); + } + } + + return ApiResponse.success(poiList); + } catch (Exception e) { + return ApiResponse.failure("POI数据查询失败:" + e.getMessage()); + } + } +} 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 0387a41..12894f4 100644 --- a/src/main/java/com/yj/earth/business/controller/SourceController.java +++ b/src/main/java/com/yj/earth/business/controller/SourceController.java @@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -132,11 +134,21 @@ public class SourceController { public ApiResponse list(@Parameter(description = "资源类型") String sourceType, @Parameter(description = "资源名称") String name, @Parameter(description = "分页数量") Integer pageNum, - @Parameter(description = "分页大小") Integer pageSize) { + @Parameter(description = "分页大小") Integer pageSize, + @Parameter(description = "开始时间") String startTime, + @Parameter(description = "结束时间") String endTime) { // 获取当前登录用户的ID String userId = StpUtil.getLoginIdAsString(); - List sourceList = sourceService.getSourceListByUserId(userId, sourceType, name, pageNum, pageSize); - return ApiResponse.success(sourceList); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + LocalDateTime startTimeDate = null; + LocalDateTime endTimeDate = null; + if (startTime != null && endTime != null) { + // 把字符串的 时间字符串 转换成 LocalDateTime + startTimeDate = LocalDateTime.parse(startTime, formatter); + endTimeDate = LocalDateTime.parse(endTime, formatter); + } + return ApiResponse.success(sourceService.getSourceListByUserId(userId, sourceType, name, pageNum, pageSize, startTimeDate, endTimeDate)); } @Operation(summary = "获取资源类型列表") diff --git a/src/main/java/com/yj/earth/business/controller/UserController.java b/src/main/java/com/yj/earth/business/controller/UserController.java index 88bb85c..aff3ed4 100644 --- a/src/main/java/com/yj/earth/business/controller/UserController.java +++ b/src/main/java/com/yj/earth/business/controller/UserController.java @@ -84,11 +84,7 @@ public class UserController { @Operation(summary = "用户列表") @GetMapping("/list") @RoleAccess(roleNames = "管理员") - public ApiResponse list(@Parameter(description = "分页数量") Integer pageNum, - @Parameter(description = "分页大小") Integer pageSize, - @Parameter(description = "搜索字段") String searchKey, - @Parameter(description = "角色ID") String roleId, - @Parameter(description = "用户状态") Integer status) { + public ApiResponse list(@Parameter(description = "分页数量") Integer pageNum, @Parameter(description = "分页大小") Integer pageSize, @Parameter(description = "搜索字段") String searchKey, @Parameter(description = "角色ID") String roleId, @Parameter(description = "用户状态") Integer status) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); // 根据用户名或者昵称进行模糊搜索 if (StringUtils.isNotBlank(searchKey)) { diff --git a/src/main/java/com/yj/earth/business/domain/PoiInfo.java b/src/main/java/com/yj/earth/business/domain/PoiInfo.java new file mode 100644 index 0000000..d35cea3 --- /dev/null +++ b/src/main/java/com/yj/earth/business/domain/PoiInfo.java @@ -0,0 +1,29 @@ +package com.yj.earth.business.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +public class PoiInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @Schema(description = "主键") + private String id; + @Schema(description = "文件路径") + private String path; + @Schema(description = "文件名称") + private String name; + @Schema(description = "是否启用") + private Integer isEnable; + @Schema(description = "创建时间") + private LocalDateTime createdAt; + @Schema(description = "更新时间") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/yj/earth/business/mapper/PoiInfoMapper.java b/src/main/java/com/yj/earth/business/mapper/PoiInfoMapper.java new file mode 100644 index 0000000..1d8731c --- /dev/null +++ b/src/main/java/com/yj/earth/business/mapper/PoiInfoMapper.java @@ -0,0 +1,18 @@ +package com.yj.earth.business.mapper; + +import com.yj.earth.business.domain.PoiInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author 周志雄 + * @since 2025-10-27 + */ +@Mapper +public interface PoiInfoMapper extends BaseMapper { + +} diff --git a/src/main/java/com/yj/earth/business/service/PoiInfoService.java b/src/main/java/com/yj/earth/business/service/PoiInfoService.java new file mode 100644 index 0000000..8b43b63 --- /dev/null +++ b/src/main/java/com/yj/earth/business/service/PoiInfoService.java @@ -0,0 +1,16 @@ +package com.yj.earth.business.service; + +import com.yj.earth.business.domain.PoiInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author 周志雄 + * @since 2025-10-27 + */ +public interface PoiInfoService extends IService { + +} diff --git a/src/main/java/com/yj/earth/business/service/SourceService.java b/src/main/java/com/yj/earth/business/service/SourceService.java index 2b4836e..05ac447 100644 --- a/src/main/java/com/yj/earth/business/service/SourceService.java +++ b/src/main/java/com/yj/earth/business/service/SourceService.java @@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.yj.earth.common.util.ApiResponse; import com.yj.earth.dto.source.AddModelSourceDto; +import java.time.LocalDateTime; import java.util.List; +import java.util.Map; public interface SourceService extends IService { String addAndGetSourceId(String sourcePath); @@ -21,7 +23,7 @@ public interface SourceService extends IService { String fetchPakDetail(String sourceId); - List getSourceListByUserId(String userId, String type,String name,Integer pageNum, Integer pageSize); + Map getSourceListByUserId(String userId, String type, String name, Integer pageNum, Integer pageSize, LocalDateTime startTime, LocalDateTime endTime); String checkIsPass(String parentId, String sourceName); diff --git a/src/main/java/com/yj/earth/business/service/impl/PoiInfoServiceImpl.java b/src/main/java/com/yj/earth/business/service/impl/PoiInfoServiceImpl.java new file mode 100644 index 0000000..cee948f --- /dev/null +++ b/src/main/java/com/yj/earth/business/service/impl/PoiInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.yj.earth.business.service.impl; + +import com.yj.earth.business.domain.PoiInfo; +import com.yj.earth.business.mapper.PoiInfoMapper; +import com.yj.earth.business.service.PoiInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author 周志雄 + * @since 2025-10-27 + */ +@Service +public class PoiInfoServiceImpl extends ServiceImpl implements PoiInfoService { + +} diff --git a/src/main/java/com/yj/earth/business/service/impl/SourceServiceImpl.java b/src/main/java/com/yj/earth/business/service/impl/SourceServiceImpl.java index 47e22b6..e6d5dfc 100644 --- a/src/main/java/com/yj/earth/business/service/impl/SourceServiceImpl.java +++ b/src/main/java/com/yj/earth/business/service/impl/SourceServiceImpl.java @@ -4,6 +4,7 @@ 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.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -26,6 +27,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -173,38 +175,64 @@ public class SourceServiceImpl extends ServiceImpl impleme return HttpUtil.doGet(url); } - /** - * 获取用户资源列表 - */ + @Override - public List getSourceListByUserId(String userId, String sourceType, String sourceName, Integer pageNum, Integer pageSize) { + public Map getSourceListByUserId(String userId, String sourceType, String sourceName, Integer pageNum, Integer pageSize, LocalDateTime startTime, LocalDateTime endTime) { + // 结果封装Map + Map resultMap = new HashMap<>(2); // 查询该用户信息 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(User::getId, userId); User user = userService.getOne(queryWrapper); if (user == null) { - return Collections.emptyList(); + resultMap.put("list", Collections.emptyList()); + resultMap.put("total", 0); + return resultMap; } - // 查询角色信息 String roleId = user.getRoleId(); LambdaQueryWrapper roleQueryWrapper = new LambdaQueryWrapper<>(); roleQueryWrapper.eq(Role::getId, roleId); Role role = roleService.getOne(roleQueryWrapper); if (role == null) { - return Collections.emptyList(); + resultMap.put("list", Collections.emptyList()); + resultMap.put("total", 0); + return resultMap; } + // 创建用于计算总数的查询条件(始终排除directory类型) + LambdaQueryWrapper countQueryWrapper = new LambdaQueryWrapper<>(); + countQueryWrapper.ne(Source::getSourceType, "directory"); + // 构建资源查询条件 LambdaQueryWrapper sourceQueryWrapper = new LambdaQueryWrapper<>(); + + // 公共查询条件 if (sourceType != null) { sourceQueryWrapper.eq(Source::getSourceType, sourceType); + countQueryWrapper.eq(Source::getSourceType, sourceType); } if (StringUtils.isNotBlank(sourceName)) { sourceQueryWrapper.like(Source::getSourceName, sourceName); + countQueryWrapper.like(Source::getSourceName, sourceName); } - // 增加资源ID的范围限制 + // 添加createdAt时间范围过滤(如果时间不为空) + if (startTime != null && endTime != null) { + // 同时存在开始和结束时间:查询范围内的数据 + sourceQueryWrapper.between(Source::getCreatedAt, startTime, endTime); + countQueryWrapper.between(Source::getCreatedAt, startTime, endTime); + } else if (startTime != null) { + // 仅存在开始时间:查询大于等于开始时间的数据 + sourceQueryWrapper.ge(Source::getCreatedAt, startTime); + countQueryWrapper.ge(Source::getCreatedAt, startTime); + } else if (endTime != null) { + // 仅存在结束时间:查询小于等于结束时间的数据 + sourceQueryWrapper.le(Source::getCreatedAt, endTime); + countQueryWrapper.le(Source::getCreatedAt, endTime); + } + + // 增加资源ID的范围限制(非超级管理员) if (role.getIsSuper() != 1) { LambdaQueryWrapper roleSourceQueryWrapper = new LambdaQueryWrapper<>(); roleSourceQueryWrapper.eq(RoleSource::getRoleId, roleId); @@ -213,19 +241,33 @@ public class SourceServiceImpl extends ServiceImpl impleme .map(RoleSource::getSourceId) .toList(); if (sourceIdList.isEmpty()) { - return Collections.emptyList(); + resultMap.put("list", Collections.emptyList()); + resultMap.put("total", 0); + return resultMap; } sourceQueryWrapper.in(Source::getId, sourceIdList); + countQueryWrapper.in(Source::getId, sourceIdList); } - // 判断是否需要分页 + // 处理分页和总数 if (pageNum != null && pageSize != null) { - // 执行分页查询,返回分页结果中的记录列表 + // 分页时,查询条件排除directory类型 + sourceQueryWrapper.ne(Source::getSourceType, "directory"); + // 分页查询:获取分页数据 Page page = new Page<>(pageNum, pageSize); - Page resultPage = sourceService.page(page, sourceQueryWrapper); - return resultPage.getRecords(); + IPage resultPage = sourceService.page(page, sourceQueryWrapper); + // 使用单独的count查询条件计算总数(已排除directory) + long total = sourceService.count(countQueryWrapper); + resultMap.put("list", resultPage.getRecords()); + resultMap.put("total", total); } else { - return sourceService.list(sourceQueryWrapper); + // 不分页:获取全部数据(包含所有类型)和总数(排除directory) + List sourceList = sourceService.list(sourceQueryWrapper); + long total = sourceService.count(countQueryWrapper); + + resultMap.put("list", sourceList); + resultMap.put("total", total); } + return resultMap; } } diff --git a/src/main/java/com/yj/earth/common/util/CodeUtil.java b/src/main/java/com/yj/earth/common/util/CodeUtil.java index 67e2198..5ae1c93 100644 --- a/src/main/java/com/yj/earth/common/util/CodeUtil.java +++ b/src/main/java/com/yj/earth/common/util/CodeUtil.java @@ -34,7 +34,7 @@ public class CodeUtil { } // 传入需要生成代码的表名 - Generation("device"); + Generation("poi_info"); } public static void Generation(String... tableName) { diff --git a/src/main/java/com/yj/earth/datasource/DatabaseManager.java b/src/main/java/com/yj/earth/datasource/DatabaseManager.java index e694826..3c6321c 100644 --- a/src/main/java/com/yj/earth/datasource/DatabaseManager.java +++ b/src/main/java/com/yj/earth/datasource/DatabaseManager.java @@ -54,6 +54,7 @@ public class DatabaseManager { classes.add(WebSource.class); classes.add(PbfInfo.class); classes.add(Device.class); + classes.add(PoiInfo.class); ENTITY_CLASSES = Collections.unmodifiableList(classes); } diff --git a/src/main/java/com/yj/earth/design/PoiInfo.java b/src/main/java/com/yj/earth/design/PoiInfo.java new file mode 100644 index 0000000..c10ad76 --- /dev/null +++ b/src/main/java/com/yj/earth/design/PoiInfo.java @@ -0,0 +1,22 @@ +package com.yj.earth.design; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class PoiInfo { + @Schema(description = "主键") + private String id; + @Schema(description = "文件路径") + private String path; + @Schema(description = "文件名称") + private String name; + @Schema(description = "是否启用") + private Integer isEnable; + @Schema(description = "创建时间") + private LocalDateTime createdAt; + @Schema(description = "更新时间") + private LocalDateTime updatedAt; +} diff --git a/src/main/java/com/yj/earth/params/Ellipse.java b/src/main/java/com/yj/earth/params/Ellipse.java new file mode 100644 index 0000000..7476835 --- /dev/null +++ b/src/main/java/com/yj/earth/params/Ellipse.java @@ -0,0 +1,66 @@ +package com.yj.earth.params; + +import com.yj.earth.annotation.SourceType; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +@SourceType("ellipse") +public class Ellipse { + private String id; + private String name; + private Position center; + private double bearing; + private double semiMinorAxis; + private double semiMajorAxis; + private boolean show; + private String color; + private int heightMode; + private Line line; + private Label label; + private Attribute attribute; + private String richTextContent; + private Map customView; + + @Data + public static class Position { + private double lng; + private double lat; + private double alt; + } + + @Data + public static class Line { + private int width; + private String color; + } + + @Data + public static class Label { + private String text; + private boolean show; + private Position position; + 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/vo/PoiVo.java b/src/main/java/com/yj/earth/vo/PoiVo.java new file mode 100644 index 0000000..aee8b94 --- /dev/null +++ b/src/main/java/com/yj/earth/vo/PoiVo.java @@ -0,0 +1,12 @@ +package com.yj.earth.vo; + +import lombok.Data; + +@Data +public class PoiVo { + private Long id; + private String name; + private String address; + private String lng; + private String lat; +} diff --git a/src/main/resources/mapper/PoiInfoMapper.xml b/src/main/resources/mapper/PoiInfoMapper.xml new file mode 100644 index 0000000..b39540b --- /dev/null +++ b/src/main/resources/mapper/PoiInfoMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + id, path, name, is_enable, created_at, updated_at + + +