feat: 调整 archetype,借鉴 DDD 尽量隔离易变项

This commit is contained in:
lym
2020-10-16 18:23:38 +08:00
parent 40dcf3e4e5
commit 3e5bf60e1b
80 changed files with 806 additions and 78 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.js linguist-language=java
*.css linguist-language=java
*.html linguist-language=java

3
.gitignore vendored
View File

@@ -14,6 +14,9 @@
.idea
*.iml
# vscode
.vscode
# Package Files #
*.jar
*.war

78
BUILDING Normal file
View File

@@ -0,0 +1,78 @@
Build Instructions for shoulder-platform
====================================================
(1) Prerequisites
JDK 1.8+ is required in order to compile and run shoulder-platform.
shoulder-platform utilizes Maven as a distribution management and packaging tool. Version 3.0.3 or later is required.
Maven installation and configuration instructions can be found here:
http://maven.apache.org/run-maven/index.html
(2) Run test cases
This project contains several sub projects, external pom.xml It is only used for unified packaging,
so the run / test needs to be tested in a specific project.
(3) Import projects to Eclipse IDE
First, generate eclipse project files:
$ mvn -U eclipse:eclipse
Then, import to eclipse by specifying the root directory of the project via:
[File] > [Import] > [Existing Projects into Workspace].
(4) Build distribution packages
Execute the following command in order to build the tar.gz packages and install JAR into local repository:
#build shoulder-platform
$ mvn -Prelease -Dmaven.test.skip=true clean install -U
#############################################################################
shoulder-platform 构建说明
====================================================
1 前提
为了编译和运行 shoulder-platform需要 JDK 1.8+。
shoulder-platform 使用 Maven 作为分发管理和打包工具。需要3.0.3或更高版本。
Maven安装和配置说明如下
http://maven.apache.org/run-maven/index.html
2 运行测试用例
本项目包含多个子项目,外部 pom.xml 仅用于统一打包,因此运行/测试需要进入特定的工程中测试。
3 将项目导入Eclipse IDE
首先生成eclipse项目文件
$ mvn -U eclipse:eclipse
然后通过指定项目的根目录导入到eclipse方式如下
[File] > [Import] > [Existing Projects into Workspace]
4 生成成果物包
执行以下命令打包并将JAR安装到本地maven仓库库中
# 跳过测试、清理、安装;强制更新 SNAPSHOT、如果是 release 则不更新
$ mvn -Dmaven.test.skip=true clean install -U

BIN
img/ddd.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
img/ddd1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
img/ddd2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
img/projectAndModule.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@@ -1,4 +1,14 @@
# shoulder-platform-common
统一平台的技术栈选型,项目中一般不应引入除了本模块中以外的能力,以保证平台的安全与易维护
(由于仓库较多,未创新新仓库维护)
Shoulder 平台各个工程的`基础设施层`统一实现
一般的工程模块图如下
![projectAndModule.png](../img/projectAndModule.png)
* 本模块提供了基础中间件的选型与集成,目的:统一技术栈选型。
* 本项目中一般不应引入本模块以外的能力,以保证平台的安全与易维护。
(仓库较多,未创新新仓库维护)
由于各个工程必然存在重复的工作(技术选型与对接、依赖管理与维护、系统级规范与约定)在这里统一实现

View File

@@ -64,3 +64,11 @@ version 1.0-SNAPSHOT
| contextPath | 上下文路径 | `${appId}` |
| StartClassName | 启动类名 | ShoulderApplication |
| author | 作者名 | shoulder |
---
## DDD 介绍
* https://zhuanlan.zhihu.com/p/77311830
* https://www.cnblogs.com/daoqidelv/p/7499244.html

View File

@@ -66,25 +66,124 @@
</fileSets>
</module>
<module id="${rootArtifactId}-common" dir="__rootArtifactId__-common" name="${rootArtifactId}-common">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<module id="${rootArtifactId}-infrastructure" dir="__rootArtifactId__-infrastructure" name="${rootArtifactId}-infrastructure">
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<modules>
<module id="${rootArtifactId}-storage" dir="__rootArtifactId__-storage" name="${rootArtifactId}-storage">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/test/java</directory>
</fileSet>
</fileSets>
<module id="${rootArtifactId}-storage-mysql" dir="__rootArtifactId__-storage-mysql"
name="${rootArtifactId}-storage-mysql">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-cache" dir="__rootArtifactId__-cache" name="${rootArtifactId}-cache">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-cache-memory" dir="__rootArtifactId__-cache-memory"
name="${rootArtifactId}-cache-memory">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-cache-redis" dir="__rootArtifactId__-cache-redis"
name="${rootArtifactId}-cache-redis">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
</modules>
</module>
<module id="${rootArtifactId}-reference" dir="__rootArtifactId__-reference" name="${rootArtifactId}-reference">
<modules>
<module id="${rootArtifactId}-reference-adaptor" dir="__rootArtifactId__-reference-adaptor" name="${rootArtifactId}-reference-adaptor">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-reference-xxx" dir="__rootArtifactId__-reference-xxx"
name="${rootArtifactId}-reference-xxx">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</module>
</modules>
</module>
<module id="${rootArtifactId}-core" dir="__rootArtifactId__-core" name="${rootArtifactId}-core">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
@@ -129,6 +228,44 @@
</modules>
</module>
<module id="${rootArtifactId}-provider" dir="__rootArtifactId__-provider" name="${rootArtifactId}-provider">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/test/java</directory>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-web" dir="__rootArtifactId__-web" name="${rootArtifactId}-web">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/test/java</directory>
</fileSet>
</fileSets>
</module>
<module id="${rootArtifactId}-start" dir="__rootArtifactId__-start" name="${rootArtifactId}-start">
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
@@ -146,8 +283,9 @@
<directory>src/test/java</directory>
</fileSet>
</fileSets>
</module>
</modules>
</archetype-descriptor>

View File

@@ -0,0 +1,3 @@
*.js linguist-language=java
*.css linguist-language=java
*.html linguist-language=java

View File

@@ -1,2 +1,5 @@
# ${rootArtifactId}
工程目录结构:
![目录结构](img/projectAndModule.png)

View File

@@ -1,4 +0,0 @@
/**
* 这里定义接口返回值对象
*/
package ${package}.common.dto.result;

View File

@@ -9,17 +9,33 @@
<artifactId>${artifactId}</artifactId>
<description>共性业务放这里</description>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-common</artifactId>
</dependency>
<dependency>
<groupId>cn.itlym.platform</groupId>
<artifactId>shoulder-platform-starter-micro</artifactId>
</dependency>
<!-- 持久层接口 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-storage</artifactId>
</dependency>
<!-- 缓存层接口 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-cache</artifactId>
</dependency>
<!-- 外部调用适配层 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference-adaptor</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,29 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-cache</artifactId>
<description>jvm 内存缓存。
该缓存实现 在开发/测试模式会将缓存DTO序列化/反序列化以便于后续改为使用redis等缓存做铺垫。
</description>
<dependencies>
<!-- 缓存层定义 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-cache</artifactId>
<version>${version}</version>
</dependency>
<!-- caffine 相关依赖 -->
</dependencies>
</project>

View File

@@ -0,0 +1,28 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-cache-redis</artifactId>
<description>redis 缓存</description>
<dependencies>
<!-- 缓存层定义 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-cache</artifactId>
<version>${version}</version>
</dependency>
<!-- redis 相关依赖 -->
</dependencies>
</project>

View File

@@ -0,0 +1,14 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-cache</artifactId>
<description>缓存相关接口定义</description>
</project>

View File

@@ -0,0 +1,4 @@
/**
* 这里存放存储层实体/数据库表对应对象
*/
package ${package}.cache.po;

View File

@@ -0,0 +1,4 @@
/**
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
*/
package ${package}.cache;

View File

@@ -0,0 +1,32 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-storage</artifactId>
<description>持久化存储 mysql 实现(这里选用 jdbc、hibernate、mybatis都不会对业务模块产生影响自由切换</description>
<dependencies>
<!-- 持久层定义 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-storage</artifactId>
<version>${version}</version>
</dependency>
<!-- mysql 相关依赖 -->
<dependency>
<groupId>cn.itlym.platform</groupId>
<artifactId>shoulder-platform-starter-db</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,14 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-storage</artifactId>
<description>持久化存储相关接口Mapper/Repository、数据库模型定义Entity/PO</description>
</project>

View File

@@ -0,0 +1,4 @@
/**
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
*/
package ${package}.storage;

View File

@@ -0,0 +1,4 @@
/**
* 这里存放存储层实体/数据库表对应对象
*/
package ${package}.storage.po;

View File

@@ -0,0 +1,31 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<packaging>pom</packaging>
<description>基础设施层:存放可能随着 技术发展、部署环境、产品定位 而产生变化的代码,如:数据库在不同环境选型容易更换</description>
<modules>
<module>${rootArtifactId}-storage</module>
<module>${rootArtifactId}-storage-mysql</module>
<module>${rootArtifactId}-cache</module>
<module>${rootArtifactId}-cache-memory</module>
<module>${rootArtifactId}-cache-redis</module>
</modules>
<dependencies>
</dependencies>
</project>

View File

@@ -10,8 +10,11 @@
<artifactId>${artifactId}</artifactId>
<packaging>pom</packaging>
<description>具体业务/子业务 按模块划分</description>
<dependencies>
<!-- 统一依赖 core -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-core</artifactId>

View File

@@ -0,0 +1,23 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<description>为外部提供服务,若子业务过多,可拆分为多个 provider该模块也可合并至具体 module 中</description>
<dependencies>
<!-- 将业务模块引入 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-xxx</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
/**
* 这里定义配置类(可选)
*/
package ${package}.provider.config;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义常量类(可选)
*/
package ${package}.provider.constant;

View File

@@ -0,0 +1,4 @@
/**
* 给其他服务提供服务的实现
*/
package ${package}.provider.controller;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义枚举类(可选)
*/
package ${package}.provider.enums;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义异常类(可选)
*/
package ${package}.provider.exception;

View File

@@ -0,0 +1,4 @@
/**
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
*/
package ${package}.storage;

View File

@@ -0,0 +1,4 @@
/**
* 工具类主要是DTO、模型转换等
*/
package ${package}.provider.util;

View File

@@ -0,0 +1,30 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-reference-adaptor</artifactId>
<description>调用外部服务接口适配模块、主要做DTO转换、错误码转换异常处理等。</description>
<!--若未调用其他服务接口、则删掉该模块即可-->
<dependencies>
<!-- xxx 应用 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference-xxx</artifactId>
<version>${version}</version>
<!-- 可能不是所有子业务都会依赖某个第三方提供的接口,故设置为可选,在具体业务模块中声明依赖 -->
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
/**
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
*/
package ${package}.reference;

View File

@@ -0,0 +1,4 @@
/**
* 这里实现外部接口调用接口适配器类
*/
package ${package}.reference.service.impl;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义供自身工程使用的外部接口适配器接口
*/
package ${package}.reference.service;

View File

@@ -0,0 +1,31 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${rootArtifactId}-storage</artifactId>
<description>调用 xxx 应用提供的接口</description>
<!-- 该模块通常仅仅是继承 提供方提供的 dto/api 以屏蔽外部包路径,为可选模块,
若服务提供方未提供 DTO、Api 定义则在该模块放置 API、DTO、枚举等 -->
<dependencies>
<!-- xxx 相关依赖 -->
<!--<dependency>
<groupId>cn.itlym.platform</groupId>
<artifactId>xxx-api</artifactId>
<artifactId>xxx-client</artifactId>
</dependency>-->
</dependencies>
</project>

View File

@@ -0,0 +1,29 @@
<?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">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<packaging>pom</packaging>
<description>存放调用其他服务的代码</description>
<modules>
<!-- 外部 api 定义/依赖 -->
<module>${rootArtifactId}-reference-xxx</module>
<!-- 防腐层 -->
<module>${rootArtifactId}-reference-adaptor</module>
</modules>
<dependencies>
</dependencies>
</project>

View File

@@ -9,7 +9,7 @@
<artifactId>${artifactId}</artifactId>
<name>${artifactId}</name>
<description>${artifactId}</description>
<description>${artifactId} 调试/运行/测试/打包 模块</description>
<dependencies>
@@ -18,6 +18,15 @@
<artifactId>${rootArtifactId}-xxx</artifactId>
</dependency>
<!-- ============================= 中间件技术选型 ============================= -->
<!-- 数据库选用 mysql -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-storage-mysql</artifactId>
</dependency>
</dependencies>
<profiles>

View File

@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* 一个示例
*
* @author ${author}
*/

View File

@@ -1,20 +1,24 @@
<?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">
<parent>
<artifactId>${rootArtifactId}</artifactId>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<description>为自身前端提供的接口</description>
<!--如果前后分离,则不需要该模块-->
<dependencies>
<!-- 将业务模块引入 -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-api</artifactId>
<artifactId>${rootArtifactId}-xxx</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
/**
* 这里定义配置类(可选)
*/
package ${package}.web.config;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义常量类(可选)
*/
package ${package}.web.constant;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义供自身工程给自己的前端提供的接口
*/
package ${package}.web.controller;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义枚举类(可选)
*/
package ${package}.web.enums;

View File

@@ -0,0 +1,4 @@
/**
* 这里定义异常类(可选)
*/
package ${package}.web.exception;

View File

@@ -0,0 +1,4 @@
/**
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
*/
package ${package}.storage;

View File

@@ -0,0 +1,4 @@
/**
* 工具类主要是DTO、模型转换等
*/
package ${package}.web.util;

View File

@@ -14,19 +14,76 @@
<packaging>pom</packaging>
<version>${version}</version><!-- ${rootArtifactId}.version -->
<modules>
<module>${rootArtifactId}-api</module>
<module>${rootArtifactId}-infrastructure</module>
<module>${rootArtifactId}-core</module>
<module>${rootArtifactId}-reference</module>
<module>${rootArtifactId}-modules</module>
<module>${rootArtifactId}-provider</module>
<module>${rootArtifactId}-web</module>
<module>${rootArtifactId}-start</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- ======================= 基础设施层 ======================= -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-api</artifactId>
<artifactId>${rootArtifactId}-infrastructure</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-storage</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-storage-mysql</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-common</artifactId>
<artifactId>${rootArtifactId}-cache</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-cache-memory</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-cache-redis</artifactId>
<version>${version}</version>
</dependency>
<!-- ======================= 外部接口、消息通知依赖 ======================= -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference-adaptor</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-reference-xxx</artifactId>
<version>${version}</version>
</dependency>
<!-- ======================= 通用业务 ======================= -->
<dependency>
<groupId>${groupId}</groupId>
@@ -35,12 +92,40 @@
</dependency>
<!-- ======================= 具体业务 ======================= -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-modules</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-xxx</artifactId>
<version>${version}</version>
</dependency>
<!-- ======================= 为外部提供 api ======================= -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-api</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-provider</artifactId>
<version>${version}</version>
</dependency>
<!-- ======================= web 层,如自带的管理界面 ======================= -->
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-web</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</dependencyManagement>