Compare commits

...

24 Commits

Author SHA1 Message Date
oyo
a6f53bf39e Merge branch 'main' of https://code.byteawake.com/templates/spring5-springboot2-project-template-for-community 2026-06-12 11:46:23 +08:00
oyo
8bd9171345 去掉junit4依赖 2026-06-12 11:45:30 +08:00
ycl
dac8f0777c 更新 template/pom.xml 2026-06-10 09:54:46 +08:00
oyo
2b137ecb9b 增加sources.jar 2026-06-03 15:57:32 +08:00
oyo
3db951e5a0 dist打包修改 2026-06-02 16:33:56 +08:00
oyo
9c6af1d68b 修改为remote_contract 2026-06-01 10:51:58 +08:00
oyo
5c8ad7d42e 修改dist 2026-05-27 19:27:41 +08:00
oyo
f4c08d26bd revision 2026-05-27 17:41:37 +08:00
oyo
f89f015f5f 修改打包模板 2026-05-27 17:28:55 +08:00
oyo
ac97eeca58 修改为interfaces 2026-05-27 17:02:59 +08:00
oyo
a3e7d7d0fa 修改为interfaces 2026-05-27 16:58:14 +08:00
oyo
60e2ad6ccd 修改为interfaces 2026-05-27 16:22:15 +08:00
oyo
fe5d6ec08e client模块被根依赖 2026-05-27 15:35:50 +08:00
oyo
44deb7ab4e client模块被根依赖 2026-05-27 15:28:02 +08:00
oyo
66b13750f3 增加microserviceFrameworkType: ""
microserviceFrameworkVersion: ""
2026-05-26 16:41:23 +08:00
oyo
51a2b345a9 git ignore 2026-05-26 16:40:18 +08:00
oyo
0c327f7dd4 增加微服务配置pom动态化 2026-05-26 16:36:57 +08:00
oyo
f05dab17f6 增加打包内容,包含QueryResult、TocoGenerated、TocoGenerated$LockLevel 2026-05-22 15:57:15 +08:00
oyo
3882e2d0b5 jar 改为dist 2026-05-22 14:16:38 +08:00
oyo
6ece5fb212 jar 改为dist 2026-05-21 17:10:30 +08:00
oyo
8ce7e21255 去掉modules 2026-05-21 16:52:38 +08:00
oyo
14c90c288e facade改为client,增加public-api 2026-05-21 16:35:42 +08:00
oyo
9295402789 facade改为client 2026-05-21 14:30:38 +08:00
ycl
aa6be4960b #支持微服务,添加facade模块用于放置对外的rpc服务 2026-05-11 13:51:21 +08:00
11 changed files with 269 additions and 15 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
## IntelliJ IDEA
.idea/
*.iml
## Maven
target/
## System
.DS_Store

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}

11
template/client/pom.xml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}</artifactId>
<version>${revision}</version>
</parent>
<artifactId>{{ .artifactId }}-client</artifactId>
</project>

View File

@@ -19,4 +19,4 @@
<modules>
<module>web</module>
</modules>
</project>
</project>

View File

@@ -20,11 +20,27 @@
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>3.0-SNAPSHOT</revision>
{{- if eq .microserviceFrameworkType "SPRING_CLOUD" }}
<spring.cloud.version>{{ default "2021.0.9" .microserviceFrameworkVersion }}</spring.cloud.version>
{{- end }}
{{- if eq .dbType "dm" }}
<dm.driver.version>18</dm.driver.version>
<db.hiernate.dialect.version>8.1.3.140</db.hiernate.dialect.version>
{{- end }}
</properties>
{{- if eq .microserviceFrameworkType "SPRING_CLOUD" }}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
{{- end }}
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
@@ -36,12 +52,6 @@
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
@@ -158,11 +168,6 @@
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@@ -198,7 +203,7 @@
<dependency>
<groupId>io.github.think-1024</groupId>
<artifactId>toco-all-spring5-springboot2-community</artifactId>
<version>2.0</version>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
@@ -231,6 +236,13 @@
<artifactId>transmittable-thread-local</artifactId>
<version>2.12.3</version>
</dependency>
{{- if and (eq .microserviceFrameworkType "DUBBO") .microserviceFrameworkVersion }}
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>{{ .microserviceFrameworkVersion }}</version>
</dependency>
{{- end }}
{{- if eq .dbType "dm" }}
<dependency>
<groupId>dm</groupId>
@@ -306,8 +318,11 @@
</plugins>
</build>
<modules>
<module>remote_contract/types</module>
<module>remote_contract/interfaces</module>
<module>public_service</module>
<module>entrance</module>
<module>common</module>
<module>public_service</module>
<module>client</module>
</modules>
</project>
</project>

View File

@@ -8,4 +8,12 @@
<version>${revision}</version>
</parent>
<artifactId>{{ .artifactId }}-public-service</artifactId>
<dependencies>
<dependency>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract-types</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>

113
template/remote_contract/dist/pom.xml vendored Normal file
View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-api</artifactId>
<version>3.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract-interfaces</artifactId>
<version>3.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract-types</artifactId>
<version>3.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.github.think-1024</groupId>
<artifactId>toco-all-spring5-springboot2-community</artifactId>
<version>2.0</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<finalName>{{ .artifactId }}-api</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>{{ .groupId }}:{{ .artifactId }}-remote-contract-interfaces</include>
<include>{{ .groupId }}:{{ .artifactId }}-remote-contract-types</include>
<include>io.github.think-1024:toco-all-spring5-springboot2-community</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>io.github.think-1024:toco-all-spring5-springboot2-community</artifact>
<includes>
<include>com/vs/query/QueryResult.class</include>
<include>com/vs/code/TocoGenerated.class</include>
<include>com/vs/code/TocoGenerated$LockLevel.class</include>
</includes>
</filter>
</filters>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-api-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/api-sources</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../types/src/main/java</directory>
</resource>
<resource>
<directory>${project.basedir}/../interfaces/src/main/java</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-api-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.build.directory}/api-sources</classesDirectory>
<classifier>sources</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>{{ .artifactId }}-remote-contract-interfaces</artifactId>
<dependencies>
<dependency>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract-types</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<revision>3.0-SNAPSHOT</revision>
<lombok.version>1.18.20</lombok.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<toco.version>2.0</toco.version>
</properties>
<dependencies>
<dependency>
<groupId>io.github.think-1024</groupId>
<artifactId>toco-all-spring5-springboot2-community</artifactId>
<version>${toco.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<modules>
<module>types</module>
<module>interfaces</module>
<module>dist</module>
</modules>
</project>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>{{ .groupId }}</groupId>
<artifactId>{{ .artifactId }}-remote-contract</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>{{ .artifactId }}-remote-contract-types</artifactId>
</project>

View File

@@ -6,6 +6,8 @@ version: 1.0-SNAPSHOT
vsVersion: 1.0.0
projectId: 3fdc654b-feb2-4d4a-be19-e9ca2998b5d6
dbType: mysql
microserviceFrameworkType: ""
microserviceFrameworkVersion: ""
dbHost: 10.0.2.201
dbPort: 3306
package: "{{ .groupId }}.{{ .artifactId }}"