From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
pom.xml | 209 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 129 insertions(+), 80 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0bb7353..d60f5ae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,10 +23,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
-<!-- <kotlin.version>1.5.0</kotlin.version>-->
+ <!-- <kotlin.version>1.5.0</kotlin.version>-->
<kotlin.version>1.4.32</kotlin.version>
<!-- tk.mybatis -->
<mapper.plugin>tk.mybatis.mapper.generator.MapperPlugin</mapper.plugin>
+<!-- <mapper.plugin>cn.flight.feather.mybatis.plugin.CustomAnnotationPlugin</mapper.plugin>-->
<mapper.Mapper>tk.mybatis.mapper.common.Mapper</mapper.Mapper>
<resource.delimiters>@</resource.delimiters>
</properties>
@@ -34,13 +35,23 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
+ <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
- <artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-quartz</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
</dependency>
<dependency>
@@ -57,6 +68,11 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.plugin/spring-plugin-core -->
@@ -84,9 +100,9 @@
<scope>runtime</scope>
</dependency>
<!--<dependency>-->
- <!--<groupId>org.springframework.boot</groupId>-->
- <!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
- <!--<scope>provided</scope>-->
+ <!--<groupId>org.springframework.boot</groupId>-->
+ <!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
+ <!--<scope>provided</scope>-->
<!--</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -114,16 +130,11 @@
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
-
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>druid</artifactId>
- <version>1.1.6</version>
+ <groupId>com.alibaba</groupId>
+ <artifactId>druid</artifactId>
+ <version>1.1.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator -->
@@ -158,17 +169,17 @@
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-typehandlers-jsr310 -->
<!--<dependency>-->
- <!--<groupId>org.mybatis</groupId>-->
- <!--<artifactId>mybatis-typehandlers-jsr310</artifactId>-->
- <!--<version>1.0.2</version>-->
+ <!--<groupId>org.mybatis</groupId>-->
+ <!--<artifactId>mybatis-typehandlers-jsr310</artifactId>-->
+ <!--<version>1.0.2</version>-->
<!--</dependency>-->
<!--<!– https://mvnrepository.com/artifact/org.docx4j/docx4j-ImportXHTML –>-->
<!--<dependency>-->
- <!--<groupId>org.docx4j</groupId>-->
- <!--<artifactId>docx4j-ImportXHTML</artifactId>-->
- <!--<version>3.3.6</version>-->
+ <!--<groupId>org.docx4j</groupId>-->
+ <!--<artifactId>docx4j-ImportXHTML</artifactId>-->
+ <!--<version>3.3.6</version>-->
<!--</dependency>-->
<!--mapper-->
@@ -214,10 +225,28 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
+<!-- <dependency>-->
+<!-- <groupId>org.junit.jupiter</groupId>-->
+<!-- <artifactId>junit-jupiter-api</artifactId>-->
+<!-- <version>5.0.0</version>-->
+<!-- <scope>test</scope>-->
+<!-- </dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
- <version>5.0.0</version>
+ <version>5.8.1</version> <!-- 浣跨敤鏈�鏂扮殑鐗堟湰鍙� -->
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-params</artifactId>
+ <version>5.8.1</version> <!-- 浣跨敤鏈�鏂扮殑鐗堟湰鍙� -->
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <version>5.8.1</version> <!-- 浣跨敤鏈�鏂扮殑鐗堟湰鍙� -->
<scope>test</scope>
</dependency>
<dependency>
@@ -240,18 +269,18 @@
</dependency>
<!--<dependency>-->
- <!--<groupId>com.alibaba</groupId>-->
- <!--<artifactId>druid-spring-boot-starter</artifactId>-->
- <!--<version>1.1.6</version>-->
+ <!--<groupId>com.alibaba</groupId>-->
+ <!--<artifactId>druid-spring-boot-starter</artifactId>-->
+ <!--<version>1.1.6</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/junit/junit -->
-<!-- <dependency>-->
-<!-- <groupId>junit</groupId>-->
-<!-- <artifactId>junit</artifactId>-->
-<!-- <version>4.12</version>-->
-<!-- <scope>test</scope>-->
-<!-- </dependency>-->
+ <!-- <dependency>-->
+ <!-- <groupId>junit</groupId>-->
+ <!-- <artifactId>junit</artifactId>-->
+ <!-- <version>4.12</version>-->
+ <!-- <scope>test</scope>-->
+ <!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-test-junit -->
<dependency>
@@ -283,6 +312,13 @@
<version>4.1.2</version>
</dependency>
+ <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
+ <dependency>
+ <groupId>org.apache.poi</groupId>
+ <artifactId>poi-ooxml</artifactId>
+ <version>4.1.2</version>
+ </dependency>
+
<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
<dependency>
<groupId>com.google.zxing</groupId>
@@ -292,16 +328,16 @@
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<!--<dependency>-->
- <!--<groupId>io.springfox</groupId>-->
- <!--<artifactId>springfox-swagger2</artifactId>-->
- <!--<version>2.8.0</version>-->
+ <!--<groupId>io.springfox</groupId>-->
+ <!--<artifactId>springfox-swagger2</artifactId>-->
+ <!--<version>2.8.0</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<!--<dependency>-->
- <!--<groupId>io.springfox</groupId>-->
- <!--<artifactId>springfox-swagger-ui</artifactId>-->
- <!--<version>2.8.0</version>-->
+ <!--<groupId>io.springfox</groupId>-->
+ <!--<artifactId>springfox-swagger-ui</artifactId>-->
+ <!--<version>2.8.0</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
@@ -340,30 +376,30 @@
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
-<!-- <plugin>-->
-<!-- <groupId>org.springframework.boot</groupId>-->
-<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
-<!-- </plugin>-->
+ <!-- <plugin>-->
+ <!-- <groupId>org.springframework.boot</groupId>-->
+ <!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
+ <!-- </plugin>-->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
-<!-- <version>${kotlin.version}</version>-->
-<!-- <executions>-->
-<!-- <execution>-->
-<!-- <id>compile</id>-->
-<!-- <phase>compile</phase>-->
-<!-- <goals>-->
-<!-- <goal>compile</goal>-->
-<!-- </goals>-->
-<!-- </execution>-->
-<!-- <execution>-->
-<!-- <id>test-compile</id>-->
-<!-- <phase>test-compile</phase>-->
-<!-- <goals>-->
-<!-- <goal>test-compile</goal>-->
-<!-- </goals>-->
-<!-- </execution>-->
-<!-- </executions>-->
+ <!-- <version>${kotlin.version}</version>-->
+ <!-- <executions>-->
+ <!-- <execution>-->
+ <!-- <id>compile</id>-->
+ <!-- <phase>compile</phase>-->
+ <!-- <goals>-->
+ <!-- <goal>compile</goal>-->
+ <!-- </goals>-->
+ <!-- </execution>-->
+ <!-- <execution>-->
+ <!-- <id>test-compile</id>-->
+ <!-- <phase>test-compile</phase>-->
+ <!-- <goals>-->
+ <!-- <goal>test-compile</goal>-->
+ <!-- </goals>-->
+ <!-- </execution>-->
+ <!-- </executions>-->
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
@@ -420,8 +456,8 @@
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
-<!-- <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>-->
- <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile>
+ <configurationFile>src/main/resources/generator/generatorConfig4ds1.xml</configurationFile>
+<!-- <configurationFile>src/main/resources/generator/generatorConfig4ds3.xml</configurationFile>-->
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
@@ -432,36 +468,43 @@
<artifactId>mapper</artifactId>
<version>3.3.9</version>
</dependency>
+ <dependency>
+ <groupId>cn.flight.feather.devtool</groupId>
+ <artifactId>mybatis-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <scope>system</scope>
+ <systemPath>C:/work/ideaProject/java-repository/mybatis-plugin-1.0-SNAPSHOT.jar</systemPath>
+ </dependency>
</dependencies>
</plugin>
-<!-- <plugin>-->
-<!-- <groupId>org.apache.maven.plugins</groupId>-->
-<!-- <artifactId>maven-resources-plugin</artifactId>-->
-<!-- <configuration>-->
-<!-- <delimiters>@</delimiters>-->
-<!-- <useDefaultDelimiters>false</useDefaultDelimiters>-->
-<!-- </configuration>-->
-<!-- </plugin>-->
+ <!-- <plugin>-->
+ <!-- <groupId>org.apache.maven.plugins</groupId>-->
+ <!-- <artifactId>maven-resources-plugin</artifactId>-->
+ <!-- <configuration>-->
+ <!-- <delimiters>@</delimiters>-->
+ <!-- <useDefaultDelimiters>false</useDefaultDelimiters>-->
+ <!-- </configuration>-->
+ <!-- </plugin>-->
</plugins>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
-<!-- <excludes>-->
-<!-- <exclude>application-dev.yml</exclude>-->
-<!-- <exclude>application-pro.yml</exclude>-->
-<!-- <exclude>application.yml</exclude>-->
-<!-- </excludes>-->
+ <!-- <excludes>-->
+ <!-- <exclude>application-dev.yml</exclude>-->
+ <!-- <exclude>application-pro.yml</exclude>-->
+ <!-- <exclude>application.yml</exclude>-->
+ <!-- </excludes>-->
</resource>
-<!-- <resource>-->
-<!-- <filtering>true</filtering>-->
-<!-- <directory>src/main/resources</directory>-->
-<!-- <includes>-->
-<!-- <include>application-${profileActive}.yml</include>-->
-<!-- <include>application.yml</include>-->
-<!-- </includes>-->
-<!-- </resource>-->
+ <!-- <resource>-->
+ <!-- <filtering>true</filtering>-->
+ <!-- <directory>src/main/resources</directory>-->
+ <!-- <includes>-->
+ <!-- <include>application-${profileActive}.yml</include>-->
+ <!-- <include>application.yml</include>-->
+ <!-- </includes>-->
+ <!-- </resource>-->
</resources>
</build>
@@ -482,6 +525,12 @@
</properties>
</profile>
<profile>
+ <id>pro-https</id>
+ <properties>
+ <profileActive>pro-https</profileActive>
+ </properties>
+ </profile>
+ <profile>
<id>test</id>
<properties>
<profileActive>test</profileActive>
--
Gitblit v1.9.3