Browse Source

refactor 升级到JDK17

黎有为 1 year ago
parent
commit
f2cd62463c

+ 0 - 24
base-boot/src/main/java/com/citygis/base/boot/controller/GridPartitioningProperties.java

@@ -1,24 +0,0 @@
-package com.citygis.base.boot.controller;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-@PropertySource(
-        value = "classpath:grid-partitioning.properties",
-        ignoreResourceNotFound = false
-)
-@ConfigurationProperties(
-        prefix = "grid-partitioning"
-)
-@Configuration
-@Getter
-@Setter
-public class GridPartitioningProperties {
-    private ConcurrentHashMap<Integer, Integer> longitudeDegreeMap = new ConcurrentHashMap<>();
-    private ConcurrentHashMap<Integer, Integer> latitudeDegreeMap = new ConcurrentHashMap<>();
-}

+ 0 - 63
base-boot/src/main/java/com/citygis/base/boot/controller/Test.java

@@ -1,63 +0,0 @@
-package com.citygis.base.boot.controller;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import lombok.Builder;
-import lombok.Data;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-@RestController
-public class Test {
-    @Autowired
-    private GridPartitioningProperties properties;
-
-    @Data
-    @Builder
-    static class PartitionInfo {
-        private Integer longitudePartition;
-        private Integer latitudePartition;
-    }
-
-    private PartitionInfo calculatePartitionNumber(String x, String y) {
-        Integer longitudePartition = calculateLongitude(x, LongitudeLatitudeEnum.LONGITUDE);
-        Integer latitudePartition = calculateLongitude(y, LongitudeLatitudeEnum.LATITUDE);
-        return PartitionInfo.builder()
-                .longitudePartition(longitudePartition)
-                .latitudePartition(latitudePartition)
-                .build();
-    }
-
-    enum LongitudeLatitudeEnum {
-        LONGITUDE(),
-        LATITUDE()
-    }
-
-    private Integer calculateLongitude(String value, LongitudeLatitudeEnum type) {
-        Map<Integer, Integer> longitudeDegreeMap = properties.getLongitudeDegreeMap();
-        Map<Integer, Integer> latitudeDegreeMap = properties.getLatitudeDegreeMap();
-        String[] degreeAndMinutes = value.replace("′", "").replace("′", "").split("°");
-        Integer degree = Integer.parseInt(degreeAndMinutes[0]);
-        Integer minutes = Integer.parseInt(degreeAndMinutes[1]);
-        Integer quickCalculationDeduction = 0;
-        Integer result = 0;
-        switch (type) {
-            case LONGITUDE:
-                quickCalculationDeduction = longitudeDegreeMap.get(degree);
-                break;
-            case LATITUDE:
-                quickCalculationDeduction = latitudeDegreeMap.get(degree);
-                break;
-        }
-        result = quickCalculationDeduction + minutes;
-        return result;
-    }
-
-    @GetMapping("/config/{x}&&{y}")
-    public Object config(@PathVariable String x, @PathVariable String y) throws JsonProcessingException {
-        return calculatePartitionNumber(x, y);
-    }
-}

+ 0 - 3
common-boot/pom.xml

@@ -11,9 +11,6 @@
     <version>0.0.1-SNAPSHOT</version>
     <name>common-boot</name>
     <packaging>jar</packaging>
-    <properties>
-        <java.version>1.8</java.version>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 2 - 2
pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.7.11</version>
+        <version>3.1.0</version>
         <relativePath/> <!-- lookup parent from repository -->
     </parent>
 
@@ -20,7 +20,7 @@
         <module>common-boot</module>
     </modules>
     <properties>
-        <java.version>1.8</java.version>
+        <java.version>17</java.version>
         <spring-boot.verison>2.7.11</spring-boot.verison>
         <spring-cloud.version>2021.0.4</spring-cloud.version>
         <spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>