Commit dad14d5a399357b47634d6068f78ddc91a05ea75

Authored by 张志伟
1 parent 8090cdd6

引入kotlin的支持

fw-valhalla-common/pom.xml
@@ -10,6 +10,12 @@ @@ -10,6 +10,12 @@
10 </parent> 10 </parent>
11 <modelVersion>4.0.0</modelVersion> 11 <modelVersion>4.0.0</modelVersion>
12 <packaging>jar</packaging> 12 <packaging>jar</packaging>
  13 +
  14 + <properties>
  15 + <kotlin.version>1.8.0</kotlin.version>
  16 + </properties>
  17 +
  18 +
13 <artifactId>fw-valhalla-common</artifactId> 19 <artifactId>fw-valhalla-common</artifactId>
14 20
15 <dependencies> 21 <dependencies>
@@ -53,7 +59,6 @@ @@ -53,7 +59,6 @@
53 <dependency> 59 <dependency>
54 <groupId>com.google.guava</groupId> 60 <groupId>com.google.guava</groupId>
55 <artifactId>guava</artifactId> 61 <artifactId>guava</artifactId>
56 - <version>27.0.1-jre</version>  
57 <scope>compile</scope> 62 <scope>compile</scope>
58 </dependency> 63 </dependency>
59 <dependency> 64 <dependency>
@@ -80,19 +85,15 @@ @@ -80,19 +85,15 @@
80 <dependency> 85 <dependency>
81 <groupId>cn.hutool</groupId> 86 <groupId>cn.hutool</groupId>
82 <artifactId>hutool-all</artifactId> 87 <artifactId>hutool-all</artifactId>
83 - <version>5.2.5</version> 88 + </dependency>
  89 + <dependency>
  90 + <groupId>org.jetbrains.kotlin</groupId>
  91 + <artifactId>kotlin-reflect</artifactId>
  92 + </dependency>
  93 + <dependency>
  94 + <groupId>org.jetbrains.kotlin</groupId>
  95 + <artifactId>kotlin-stdlib-jdk8</artifactId>
84 </dependency> 96 </dependency>
85 </dependencies> 97 </dependencies>
86 98
87 - <build>  
88 - <plugins>  
89 - <plugin>  
90 - <groupId>org.apache.maven.plugins</groupId>  
91 - <artifactId>maven-deploy-plugin</artifactId>  
92 - <configuration>  
93 - <skip>true</skip>  
94 - </configuration>  
95 - </plugin>  
96 - </plugins>  
97 - </build>  
98 </project> 99 </project>
99 \ No newline at end of file 100 \ No newline at end of file
fw-valhalla-dao/pom.xml
@@ -35,15 +35,4 @@ @@ -35,15 +35,4 @@
35 </dependency> 35 </dependency>
36 </dependencies> 36 </dependencies>
37 37
38 - <build>  
39 - <plugins>  
40 - <plugin>  
41 - <groupId>org.apache.maven.plugins</groupId>  
42 - <artifactId>maven-deploy-plugin</artifactId>  
43 - <configuration>  
44 - <skip>true</skip>  
45 - </configuration>  
46 - </plugin>  
47 - </plugins>  
48 - </build>  
49 </project> 38 </project>
50 \ No newline at end of file 39 \ No newline at end of file
fw-valhalla-domain/pom.xml
@@ -35,16 +35,4 @@ @@ -35,16 +35,4 @@
35 <artifactId>fw-valhalla-sdk</artifactId> 35 <artifactId>fw-valhalla-sdk</artifactId>
36 </dependency> 36 </dependency>
37 </dependencies> 37 </dependencies>
38 -  
39 - <build>  
40 - <plugins>  
41 - <plugin>  
42 - <groupId>org.apache.maven.plugins</groupId>  
43 - <artifactId>maven-deploy-plugin</artifactId>  
44 - <configuration>  
45 - <skip>true</skip>  
46 - </configuration>  
47 - </plugin>  
48 - </plugins>  
49 - </build>  
50 </project> 38 </project>
51 \ No newline at end of file 39 \ No newline at end of file
fw-valhalla-rpc/pom.xml
@@ -106,4 +106,5 @@ @@ -106,4 +106,5 @@
106 <optional>true</optional> 106 <optional>true</optional>
107 </dependency> 107 </dependency>
108 </dependencies> 108 </dependencies>
  109 +
109 </project> 110 </project>
110 \ No newline at end of file 111 \ No newline at end of file
fw-valhalla-server/pom.xml
@@ -169,13 +169,6 @@ @@ -169,13 +169,6 @@
169 <executable>true</executable> 169 <executable>true</executable>
170 </configuration> 170 </configuration>
171 </plugin> 171 </plugin>
172 - <plugin>  
173 - <groupId>org.apache.maven.plugins</groupId>  
174 - <artifactId>maven-deploy-plugin</artifactId>  
175 - <configuration>  
176 - <skip>true</skip>  
177 - </configuration>  
178 - </plugin>  
179 </plugins> 172 </plugins>
180 </build> 173 </build>
181 174
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/CommonController.java
@@ -17,7 +17,10 @@ import lombok.extern.slf4j.Slf4j; @@ -17,7 +17,10 @@ import lombok.extern.slf4j.Slf4j;
17 import org.apache.commons.lang3.StringUtils; 17 import org.apache.commons.lang3.StringUtils;
18 import org.apache.commons.lang3.math.NumberUtils; 18 import org.apache.commons.lang3.math.NumberUtils;
19 import org.springframework.validation.annotation.Validated; 19 import org.springframework.validation.annotation.Validated;
20 -import org.springframework.web.bind.annotation.*; 20 +import org.springframework.web.bind.annotation.GetMapping;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.RequestParam;
  23 +import org.springframework.web.bind.annotation.RestController;
21 24
22 import javax.validation.constraints.NotBlank; 25 import javax.validation.constraints.NotBlank;
23 import javax.validation.constraints.NotNull; 26 import javax.validation.constraints.NotNull;
fw-valhalla-service/pom.xml
@@ -129,15 +129,4 @@ @@ -129,15 +129,4 @@
129 <artifactId>fw-identify-sdk</artifactId> 129 <artifactId>fw-identify-sdk</artifactId>
130 </dependency> 130 </dependency>
131 </dependencies> 131 </dependencies>
132 - <build>  
133 - <plugins>  
134 - <plugin>  
135 - <groupId>org.apache.maven.plugins</groupId>  
136 - <artifactId>maven-deploy-plugin</artifactId>  
137 - <configuration>  
138 - <skip>true</skip>  
139 - </configuration>  
140 - </plugin>  
141 - </plugins>  
142 - </build>  
143 </project> 132 </project>
144 \ No newline at end of file 133 \ No newline at end of file
lombok.config 0 → 100644
  1 +config.stopBubbling = true
  2 +lombok.accessors.chain=true
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <parent> 12 <parent>
13 <groupId>cn.fw</groupId> 13 <groupId>cn.fw</groupId>
14 <artifactId>fw-common-dependencies</artifactId> 14 <artifactId>fw-common-dependencies</artifactId>
15 - <version>3.3.0</version> 15 + <version>3.3.1</version>
16 </parent> 16 </parent>
17 17
18 <modules> 18 <modules>
@@ -27,7 +27,10 @@ @@ -27,7 +27,10 @@
27 27
28 <properties> 28 <properties>
29 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 29 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  30 + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
30 <java.version>1.8</java.version> 31 <java.version>1.8</java.version>
  32 + <!-- 启用kotlin增量编译 -->
  33 + <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
31 <fw.valhalla.version>1.0.0</fw.valhalla.version> 34 <fw.valhalla.version>1.0.0</fw.valhalla.version>
32 <!-- util --> 35 <!-- util -->
33 <poi.version>4.1.0</poi.version> 36 <poi.version>4.1.0</poi.version>
@@ -294,11 +297,30 @@ @@ -294,11 +297,30 @@
294 <artifactId>junit</artifactId> 297 <artifactId>junit</artifactId>
295 <scope>test</scope> 298 <scope>test</scope>
296 </dependency> 299 </dependency>
  300 +
  301 + <!-- kotlin -->
  302 + <dependency>
  303 + <groupId>org.jetbrains.kotlin</groupId>
  304 + <artifactId>kotlin-reflect</artifactId>
  305 + </dependency>
  306 + <dependency>
  307 + <groupId>org.jetbrains.kotlin</groupId>
  308 + <artifactId>kotlin-stdlib-jdk8</artifactId>
  309 + </dependency>
  310 + <dependency>
  311 + <groupId>com.fasterxml.jackson.module</groupId>
  312 + <artifactId>jackson-module-kotlin</artifactId>
  313 + </dependency>
  314 +
297 </dependencies> 315 </dependencies>
298 316
299 <build> 317 <build>
300 <plugins> 318 <plugins>
301 <plugin> 319 <plugin>
  320 + <groupId>org.jetbrains.kotlin</groupId>
  321 + <artifactId>kotlin-maven-plugin</artifactId>
  322 + </plugin>
  323 + <plugin>
302 <groupId>org.apache.maven.plugins</groupId> 324 <groupId>org.apache.maven.plugins</groupId>
303 <artifactId>maven-compiler-plugin</artifactId> 325 <artifactId>maven-compiler-plugin</artifactId>
304 <configuration> 326 <configuration>
@@ -307,6 +329,13 @@ @@ -307,6 +329,13 @@
307 </configuration> 329 </configuration>
308 </plugin> 330 </plugin>
309 <plugin> 331 <plugin>
  332 + <groupId>org.apache.maven.plugins</groupId>
  333 + <artifactId>maven-deploy-plugin</artifactId>
  334 + <configuration>
  335 + <skip>true</skip>
  336 + </configuration>
  337 + </plugin>
  338 + <plugin>
310 <groupId>org.codehaus.mojo</groupId> 339 <groupId>org.codehaus.mojo</groupId>
311 <artifactId>versions-maven-plugin</artifactId> 340 <artifactId>versions-maven-plugin</artifactId>
312 </plugin> 341 </plugin>
@@ -315,20 +344,20 @@ @@ -315,20 +344,20 @@
315 344
316 <repositories> 345 <repositories>
317 <repository> 346 <repository>
318 - <id>feewee-maven-public</id>  
319 - <name>feewee maven public</name>  
320 - <url>https://nexus.feewee.cn/nexus/content/groups/public/</url>  
321 - <releases>  
322 - <enabled>true</enabled>  
323 - <updatePolicy>always</updatePolicy>  
324 - </releases>  
325 - <snapshots>  
326 - <enabled>true</enabled>  
327 - <updatePolicy>always</updatePolicy>  
328 - </snapshots> 347 + <id>aliyun</id>
  348 + <name>aliyun</name>
  349 + <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
329 </repository> 350 </repository>
330 </repositories> 351 </repositories>
331 352
  353 + <pluginRepositories>
  354 + <pluginRepository>
  355 + <id>aliyun</id>
  356 + <name>aliyun</name>
  357 + <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
  358 + </pluginRepository>
  359 + </pluginRepositories>
  360 +
332 <distributionManagement> 361 <distributionManagement>
333 <repository> 362 <repository>
334 <id>feewee-maven-releases</id> 363 <id>feewee-maven-releases</id>