From e17a99d158bb13d845c589fd0ec18c05a3d5a9e7 Mon Sep 17 00:00:00 2001
From: Klein <12348672+du-junming@user.noreply.gitee.com>
Date: Thu, 30 May 2024 10:44:30 +0800
Subject: [PATCH] first commit
---
.gitignore | 33 ++++++++
.mvn/wrapper/maven-wrapper.properties | 18 ++++
land-api/.gitignore | 33 ++++++++
land-api/pom.xml | 35 ++++++++
.../main/java/com/hy/api/FileController.java | 46 ++++++++++
.../java/com/hy/api/GeoDataController.java | 83 +++++++++++++++++++
.../java/com/hy/apiresponse/ApiResponse.java | 40 +++++++++
land-common/.gitignore | 33 ++++++++
land-common/pom.xml | 46 ++++++++++
.../java/com/hy/common/FileUploadUtils.java | 30 +++++++
.../main/java/com/hy/common/JsonUtils.java | 22 +++++
.../src/main/java/com/hy/common/ShpUtils.java | 70 ++++++++++++++++
.../src/main/resources/CommonConfig.yaml | 2 +
land-dao/.gitignore | 33 ++++++++
land-dao/pom.xml | 32 +++++++
.../main/java/com/hy/dao/entity/GeoData.java | 14 ++++
.../java/com/hy/dao/mapper/GeoDataMapper.java | 17 ++++
.../main/resources/mapper/GeoDataMapper.xml | 30 +++++++
land-service/.gitignore | 0
land-service/pom.xml | 35 ++++++++
.../java/com/hy/service/GeoDataService.java | 13 +++
.../hy/serviceImpl/GeoDataServiceImpl.java | 40 +++++++++
land-web/.gitignore | 33 ++++++++
land-web/pom.xml | 60 ++++++++++++++
.../src/main/java/com/hy/WebApplication.java | 21 +++++
land-web/src/main/resources/application.yaml | 14 ++++
pom.xml | 75 +++++++++++++++++
27 files changed, 908 insertions(+)
create mode 100644 .gitignore
create mode 100644 .mvn/wrapper/maven-wrapper.properties
create mode 100644 land-api/.gitignore
create mode 100644 land-api/pom.xml
create mode 100644 land-api/src/main/java/com/hy/api/FileController.java
create mode 100644 land-api/src/main/java/com/hy/api/GeoDataController.java
create mode 100644 land-api/src/main/java/com/hy/apiresponse/ApiResponse.java
create mode 100644 land-common/.gitignore
create mode 100644 land-common/pom.xml
create mode 100644 land-common/src/main/java/com/hy/common/FileUploadUtils.java
create mode 100644 land-common/src/main/java/com/hy/common/JsonUtils.java
create mode 100644 land-common/src/main/java/com/hy/common/ShpUtils.java
create mode 100644 land-common/src/main/resources/CommonConfig.yaml
create mode 100644 land-dao/.gitignore
create mode 100644 land-dao/pom.xml
create mode 100644 land-dao/src/main/java/com/hy/dao/entity/GeoData.java
create mode 100644 land-dao/src/main/java/com/hy/dao/mapper/GeoDataMapper.java
create mode 100644 land-dao/src/main/resources/mapper/GeoDataMapper.xml
create mode 100644 land-service/.gitignore
create mode 100644 land-service/pom.xml
create mode 100644 land-service/src/main/java/com/hy/service/GeoDataService.java
create mode 100644 land-service/src/main/java/com/hy/serviceImpl/GeoDataServiceImpl.java
create mode 100644 land-web/.gitignore
create mode 100644 land-web/pom.xml
create mode 100644 land-web/src/main/java/com/hy/WebApplication.java
create mode 100644 land-web/src/main/resources/application.yaml
create mode 100644 pom.xml
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..aeccdfd
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+wrapperVersion=3.3.1
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
diff --git a/land-api/.gitignore b/land-api/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/land-api/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/land-api/pom.xml b/land-api/pom.xml
new file mode 100644
index 0000000..d5eed49
--- /dev/null
+++ b/land-api/pom.xml
@@ -0,0 +1,35 @@
+
+
+ 4.0.0
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+
+ land-api
+ 0.0.1-SNAPSHOT
+ api
+ api
+
+ 17
+
+
+
+ com.hy
+ land-common
+
+
+ com.hy
+ land-service
+
+
+ org.springframework
+ spring-web
+
+
+
+
+
+
+
diff --git a/land-api/src/main/java/com/hy/api/FileController.java b/land-api/src/main/java/com/hy/api/FileController.java
new file mode 100644
index 0000000..8bc4f4d
--- /dev/null
+++ b/land-api/src/main/java/com/hy/api/FileController.java
@@ -0,0 +1,46 @@
+package com.hy.api;
+
+import com.hy.apiresponse.ApiResponse;
+import com.hy.common.FileUploadUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@RestController
+@RequestMapping("/file")
+public class FileController {
+ @PostMapping("/uploadfile")
+ public ApiResponse upLoadFile(@RequestParam("file") MultipartFile file) throws IOException {
+ if (FileUploadUtils.upLoadFile(file)){
+ return ApiResponse.success(null,"上传成功");
+ } else {
+ return ApiResponse.error(HttpStatus.BAD_REQUEST.value(), "上传失败");
+ }
+ }
+ @PostMapping("/uploadfiles")
+ public ApiResponse uploadFiles(@RequestParam("files") MultipartFile[] files)throws IOException{
+ List filelist = new ArrayList<>();
+ for (var file:files){
+ if (!FileUploadUtils.upLoadFile(file)){
+ filelist.add(file.getOriginalFilename());
+ }
+ }
+ if (filelist.isEmpty()){
+ return ApiResponse.success(null,"上传成功");
+ }else {
+ StringBuilder failedFiles = new StringBuilder();
+ for(var name :filelist){
+ failedFiles.append(name);
+ }
+ return ApiResponse.error(HttpStatus.BAD_REQUEST.value(), "上传失败的文件:" + failedFiles.toString());
+ }
+ }
+}
diff --git a/land-api/src/main/java/com/hy/api/GeoDataController.java b/land-api/src/main/java/com/hy/api/GeoDataController.java
new file mode 100644
index 0000000..a181f30
--- /dev/null
+++ b/land-api/src/main/java/com/hy/api/GeoDataController.java
@@ -0,0 +1,83 @@
+package com.hy.api;
+
+import com.hy.apiresponse.ApiResponse;
+import com.hy.common.JsonUtils;
+import com.hy.dao.entity.GeoData;
+import com.hy.service.GeoDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/geodata")
+public class GeoDataController {
+
+ @Autowired
+ private GeoDataService geoDataService;
+
+ @GetMapping("/{name}")
+ public ApiResponse getGeoDataByName(@PathVariable String name) {
+ GeoData geoData = geoDataService.getGeoDataByName(name);
+ if (geoData != null) {
+ return ApiResponse.success(geoData);
+ } else {
+ return ApiResponse.error(HttpStatus.NOT_FOUND.value(), "GeoData not found");
+ }
+ }
+
+ @GetMapping
+ public ApiResponse> getAllGeoData() {
+ List geoDataList = geoDataService.getAllGeoData();
+ return ApiResponse.success(geoDataList);
+ }
+
+ @PostMapping
+ public ApiResponse insertGeoData(@RequestBody GeoData geoData) {
+ try {
+ geoDataService.insertGeoData(geoData);
+ return ApiResponse.success(null, "GeoData inserted successfully");
+ } catch (Exception e) {
+ return ApiResponse.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Failed to insert GeoData");
+ }
+ }
+ @PostMapping("/insertbypath")
+ public ApiResponse insertByPath(@RequestParam String geoPath) {
+ try {
+ var map = JsonUtils.json2Map(geoPath);
+ for (Map.Entry entry : map.entrySet()) {
+ GeoData geoData = new GeoData(); // 创建新的 GeoData 实例
+ geoData.setName(entry.getKey());
+ geoData.setGeojson(entry.getValue());
+ geoDataService.insertGeoData(geoData); // 插入到数据库
+ }
+ return ApiResponse.success(null, "Successfully inserted GeoData");
+ } catch (Exception e) {
+ return ApiResponse.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Failed to insert GeoData");
+ }
+ }
+
+
+ @PutMapping
+ public ApiResponse updateGeoData(@RequestBody GeoData geoData) {
+ try {
+ geoDataService.updateGeoData(geoData);
+ return ApiResponse.success(null, "GeoData updated successfully");
+ } catch (Exception e) {
+ return ApiResponse.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Failed to update GeoData");
+ }
+ }
+
+ @DeleteMapping("/{name}")
+ public ApiResponse deleteGeoData(@PathVariable String name) {
+ try {
+ geoDataService.deleteGeoData(name);
+ return ApiResponse.success(null, "GeoData deleted successfully");
+ } catch (Exception e) {
+ return ApiResponse.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Failed to delete GeoData");
+ }
+ }
+}
\ No newline at end of file
diff --git a/land-api/src/main/java/com/hy/apiresponse/ApiResponse.java b/land-api/src/main/java/com/hy/apiresponse/ApiResponse.java
new file mode 100644
index 0000000..9170219
--- /dev/null
+++ b/land-api/src/main/java/com/hy/apiresponse/ApiResponse.java
@@ -0,0 +1,40 @@
+package com.hy.apiresponse;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class ApiResponse {
+ private int code;
+ private String message;
+ private T data;
+
+ public ApiResponse() {}
+
+ public ApiResponse(int code, String message, T data) {
+ this.code = code;
+ this.message = message;
+ this.data = data;
+ }
+
+ public static ApiResponse success(T data) {
+ return new ApiResponse<>(200, "Success", data);
+ }
+
+ public static ApiResponse success(T data, String message) {
+ return new ApiResponse<>(200, message, data);
+ }
+
+ public static ApiResponse error(int code, String message) {
+ return new ApiResponse<>(code, message, null);
+ }
+
+ public static ApiResponse warning(int code, String message, T data) {
+ return new ApiResponse<>(code, message, data);
+ }
+
+ public static ApiResponse info(int code, String message, T data) {
+ return new ApiResponse<>(code, message, data);
+ }
+}
diff --git a/land-common/.gitignore b/land-common/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/land-common/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/land-common/pom.xml b/land-common/pom.xml
new file mode 100644
index 0000000..a933056
--- /dev/null
+++ b/land-common/pom.xml
@@ -0,0 +1,46 @@
+
+
+ 4.0.0
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+
+ land-common
+ 0.0.1-SNAPSHOT
+ common
+ common
+
+ 17
+
+
+
+ org.gdal
+ gdal
+ 3.8.0
+
+
+ org.projectlombok
+ lombok
+ 1.18.32
+
+
+ org.springframework
+ spring-web
+
+
+ org.springframework.boot
+ spring-boot-test
+ test
+
+
+ junit
+ junit
+ test
+
+
+
+
+
+
diff --git a/land-common/src/main/java/com/hy/common/FileUploadUtils.java b/land-common/src/main/java/com/hy/common/FileUploadUtils.java
new file mode 100644
index 0000000..4b37c25
--- /dev/null
+++ b/land-common/src/main/java/com/hy/common/FileUploadUtils.java
@@ -0,0 +1,30 @@
+package com.hy.common;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+
+public class FileUploadUtils {
+ @Value("${file.upload-dir}")
+ private static String uploadDir="D:\\testlearn\\";
+ public static boolean upLoadFile(MultipartFile multipartFile) throws IOException {
+ if (multipartFile.isEmpty()) {
+ return false;
+ }
+ String originalFilename = multipartFile.getOriginalFilename();
+ String subFolderName = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+ String uploadFilePath = uploadDir + subFolderName + File.separator + originalFilename;
+ File file = new File(uploadFilePath);
+ File parentDir = file.getParentFile();
+ if (parentDir.exists() || parentDir.mkdirs()) {
+ multipartFile.transferTo(file);
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/land-common/src/main/java/com/hy/common/JsonUtils.java b/land-common/src/main/java/com/hy/common/JsonUtils.java
new file mode 100644
index 0000000..51d4c57
--- /dev/null
+++ b/land-common/src/main/java/com/hy/common/JsonUtils.java
@@ -0,0 +1,22 @@
+package com.hy.common;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+
+public class JsonUtils {
+ public static Map json2Map(String path) throws IOException {
+ Map geoJsonMap = new HashMap<>();
+ String content = new String(Files.readAllBytes(Paths.get(path)));
+ geoJsonMap.put(Path.of(path).getFileName().toString().split("\\.")[0],content);
+ geoJsonMap.forEach((key,value)->{
+ System.out.println(key);
+ System.out.println(value);
+ });
+ return geoJsonMap;
+ }
+
+}
diff --git a/land-common/src/main/java/com/hy/common/ShpUtils.java b/land-common/src/main/java/com/hy/common/ShpUtils.java
new file mode 100644
index 0000000..bc49438
--- /dev/null
+++ b/land-common/src/main/java/com/hy/common/ShpUtils.java
@@ -0,0 +1,70 @@
+package com.hy.common;
+
+import org.gdal.gdal.gdal;
+import org.gdal.ogr.*;
+
+import java.io.File;
+/*
+* shp文件操作工具类
+* */
+public class ShpUtils {
+ /*
+ * gdal配置
+ * */
+ public static void setConfig() {
+ gdal.AllRegister();
+ ogr.RegisterAll();
+ gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
+ }
+ /*
+ * shp文件转换为geojson,输入参数为shp文件绝对路径和输出文件的绝对路径
+ * 结果生成一个geojson文件
+ * */
+ public static void shp2Json(String shpfilepath,String outfilepath) {
+ try {
+ File file = new File(shpfilepath);
+ if (!file.exists()) {
+ throw new IllegalArgumentException("File does not exist: " + shpfilepath);
+ }
+ DataSource dataSource = ogr.Open(shpfilepath, 1);
+ if (dataSource == null) {
+ throw new RuntimeException("Failed to open data source: " + shpfilepath);
+ }
+ Layer layer = dataSource.GetLayer(0);
+ if (layer == null) {
+ throw new RuntimeException("Layer is null");
+ }
+
+ Driver jsondr = ogr.GetDriverByName("GeoJSON");
+ if (jsondr == null) {
+ throw new RuntimeException("Failed to get GeoJSON driver");
+ }
+ DataSource jsonds = jsondr.CreateDataSource(outfilepath+".geojson");
+ if (jsonds == null) {
+ throw new RuntimeException("Failed to create GeoJSON data source");
+ }
+ int geometrytype = layer.GetGeomType();
+ Layer geojsonlayer = jsonds.CreateLayer(layer.GetName(), layer.GetSpatialRef(), geometrytype);
+ if (geojsonlayer == null) {
+ throw new RuntimeException("Failed to create GeoJSON layer");
+ }
+ for (int i = 0; i < layer.GetLayerDefn().GetFieldCount(); i++) {
+ geojsonlayer.CreateField(layer.GetLayerDefn().GetFieldDefn(i));
+ }
+ Feature feature;
+ while ((feature = layer.GetNextFeature()) != null) {
+ geojsonlayer.CreateFeature(feature);
+ feature.delete();
+ }
+ dataSource.delete();
+ jsonds.delete();
+ layer.delete();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args) {
+
+ }
+}
diff --git a/land-common/src/main/resources/CommonConfig.yaml b/land-common/src/main/resources/CommonConfig.yaml
new file mode 100644
index 0000000..d8d4fbd
--- /dev/null
+++ b/land-common/src/main/resources/CommonConfig.yaml
@@ -0,0 +1,2 @@
+file:
+ upload-dir: D:\testlearn\
\ No newline at end of file
diff --git a/land-dao/.gitignore b/land-dao/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/land-dao/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/land-dao/pom.xml b/land-dao/pom.xml
new file mode 100644
index 0000000..3d62af9
--- /dev/null
+++ b/land-dao/pom.xml
@@ -0,0 +1,32 @@
+
+
+ 4.0.0
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+
+ land-dao
+ 0.0.1-SNAPSHOT
+ dao
+ dao
+
+ 17
+
+
+
+ com.hy
+ land-common
+
+
+ org.mybatis
+ mybatis
+ 3.5.14
+ compile
+
+
+
+
+
+
diff --git a/land-dao/src/main/java/com/hy/dao/entity/GeoData.java b/land-dao/src/main/java/com/hy/dao/entity/GeoData.java
new file mode 100644
index 0000000..7537b07
--- /dev/null
+++ b/land-dao/src/main/java/com/hy/dao/entity/GeoData.java
@@ -0,0 +1,14 @@
+package com.hy.dao.entity;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GeoData {
+ public String name;
+ public String geojson;
+}
diff --git a/land-dao/src/main/java/com/hy/dao/mapper/GeoDataMapper.java b/land-dao/src/main/java/com/hy/dao/mapper/GeoDataMapper.java
new file mode 100644
index 0000000..82b59cd
--- /dev/null
+++ b/land-dao/src/main/java/com/hy/dao/mapper/GeoDataMapper.java
@@ -0,0 +1,17 @@
+package com.hy.dao.mapper;
+
+
+import com.hy.dao.entity.GeoData;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+@Mapper
+public interface GeoDataMapper {
+ GeoData getGeoDataByName(String name);
+ List getAllGeoData();
+ void insertGeoData(GeoData geoData);
+ void updateGeoData(GeoData geoData);
+ void deleteGeoData(String name);
+}
diff --git a/land-dao/src/main/resources/mapper/GeoDataMapper.xml b/land-dao/src/main/resources/mapper/GeoDataMapper.xml
new file mode 100644
index 0000000..a6dfa13
--- /dev/null
+++ b/land-dao/src/main/resources/mapper/GeoDataMapper.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO geodata (name, geojson) VALUES (#{name}, #{geojson})
+
+
+
+ UPDATE geodata SET geojson = #{geojson} WHERE name = #{name}
+
+
+
+ DELETE FROM geodata WHERE name = #{name}
+
+
+
diff --git a/land-service/.gitignore b/land-service/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/land-service/pom.xml b/land-service/pom.xml
new file mode 100644
index 0000000..27536d1
--- /dev/null
+++ b/land-service/pom.xml
@@ -0,0 +1,35 @@
+
+
+ 4.0.0
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+
+
+ land-service
+ 0.0.1-SNAPSHOT
+ service
+ service
+
+ 17
+
+
+
+
+ com.hy
+ land-dao
+
+
+ org.postgresql
+ postgresql
+
+
+ org.springframework
+ spring-context
+
+
+
+
+
diff --git a/land-service/src/main/java/com/hy/service/GeoDataService.java b/land-service/src/main/java/com/hy/service/GeoDataService.java
new file mode 100644
index 0000000..9047bc1
--- /dev/null
+++ b/land-service/src/main/java/com/hy/service/GeoDataService.java
@@ -0,0 +1,13 @@
+package com.hy.service;
+
+import com.hy.dao.entity.GeoData;
+
+import java.util.List;
+
+public interface GeoDataService {
+ GeoData getGeoDataByName(String name);
+ List getAllGeoData();
+ void insertGeoData(GeoData geoData);
+ void updateGeoData(GeoData geoData);
+ void deleteGeoData(String name);
+}
diff --git a/land-service/src/main/java/com/hy/serviceImpl/GeoDataServiceImpl.java b/land-service/src/main/java/com/hy/serviceImpl/GeoDataServiceImpl.java
new file mode 100644
index 0000000..399c17f
--- /dev/null
+++ b/land-service/src/main/java/com/hy/serviceImpl/GeoDataServiceImpl.java
@@ -0,0 +1,40 @@
+package com.hy.serviceImpl;
+
+import com.hy.dao.entity.GeoData;
+import com.hy.dao.mapper.GeoDataMapper;
+import com.hy.service.GeoDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class GeoDataServiceImpl implements GeoDataService {
+ @Autowired
+ private GeoDataMapper geoDataMapper;
+
+ @Override
+ public GeoData getGeoDataByName(String name) {
+ return geoDataMapper.getGeoDataByName(name);
+ }
+
+ @Override
+ public List getAllGeoData() {
+ return geoDataMapper.getAllGeoData();
+ }
+
+ @Override
+ public void insertGeoData(GeoData geoData) {
+ geoDataMapper.insertGeoData(geoData);
+ }
+
+ @Override
+ public void updateGeoData(GeoData geoData) {
+ geoDataMapper.updateGeoData(geoData);
+ }
+
+ @Override
+ public void deleteGeoData(String name) {
+ geoDataMapper.deleteGeoData(name);
+ }
+}
diff --git a/land-web/.gitignore b/land-web/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/land-web/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/land-web/pom.xml b/land-web/pom.xml
new file mode 100644
index 0000000..3ef5f43
--- /dev/null
+++ b/land-web/pom.xml
@@ -0,0 +1,60 @@
+
+
+ 4.0.0
+ land-web
+ 0.0.1-SNAPSHOT
+ web
+ web
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+
+
+
+
+ 17
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ com.hy
+ land-service
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+ 3.0.3
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter-test
+ 3.0.3
+ test
+
+
+ com.hy
+ land-api
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
diff --git a/land-web/src/main/java/com/hy/WebApplication.java b/land-web/src/main/java/com/hy/WebApplication.java
new file mode 100644
index 0000000..5a6ecb4
--- /dev/null
+++ b/land-web/src/main/java/com/hy/WebApplication.java
@@ -0,0 +1,21 @@
+package com.hy;
+
+import com.hy.dao.entity.GeoData;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@SpringBootApplication
+public class WebApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(WebApplication.class, args);
+ }
+
+
+}
diff --git a/land-web/src/main/resources/application.yaml b/land-web/src/main/resources/application.yaml
new file mode 100644
index 0000000..a360f25
--- /dev/null
+++ b/land-web/src/main/resources/application.yaml
@@ -0,0 +1,14 @@
+server:
+ port: 8080
+spring:
+ datasource:
+ driver-class-name: org.postgresql.Driver
+ url: jdbc:postgresql://123.249.39.101:5432/gisserver
+ username: postgres
+ password: dujunming520
+mybatis:
+# config-location: classpath:mybatis-config.xml
+ mapper-locations: classpath:mapper/*.xml
+ type-aliases-package: com.hy.dao.entity
+file:
+ upload-dir: D:\testlearn\
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..3f4f2b4
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,75 @@
+
+
+ 4.0.0
+
+ com.hy
+ land
+ 0.0.1-SNAPSHOT
+ land
+ land
+ pom
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.2.5
+
+
+
+
+ 17
+
+
+
+ land-web
+ land-common
+ land-service
+ land-api
+ land-dao
+
+
+
+
+ com.hy
+ land-web
+ 0.0.1-SNAPSHOT
+
+
+ com.hy
+ land-common
+ 0.0.1-SNAPSHOT
+
+
+ com.hy
+ land-dao
+ 0.0.1-SNAPSHOT
+
+
+ com.hy
+ land-api
+ 0.0.1-SNAPSHOT
+
+
+ com.hy
+ land-service
+ 0.0.1-SNAPSHOT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+