mirror of
https://gitee.com/ChinaLym/shoulder-platform.git
synced 2025-12-30 02:52:27 +00:00
feat: 调整 archetype,借鉴 DDD 尽量隔离易变项
This commit is contained in:
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.js linguist-language=java
|
||||
*.css linguist-language=java
|
||||
*.html linguist-language=java
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -14,6 +14,9 @@
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
# vscode
|
||||
.vscode
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
|
||||
78
BUILDING
Normal file
78
BUILDING
Normal 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
BIN
img/ddd.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
img/ddd1.jpg
Normal file
BIN
img/ddd1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
img/ddd2.jpg
Normal file
BIN
img/ddd2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
img/projectAndModule.png
Normal file
BIN
img/projectAndModule.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
@@ -1,4 +1,14 @@
|
||||
# shoulder-platform-common
|
||||
|
||||
统一平台的技术栈选型,项目中一般不应引入除了本模块中以外的能力,以保证平台的安全与易维护
|
||||
(由于仓库较多,未创新新仓库维护)
|
||||
Shoulder 平台各个工程的`基础设施层`统一实现
|
||||
|
||||
一般的工程模块图如下
|
||||
|
||||

|
||||
|
||||
* 本模块提供了基础中间件的选型与集成,目的:统一技术栈选型。
|
||||
* 本项目中一般不应引入本模块以外的能力,以保证平台的安全与易维护。
|
||||
|
||||
(仓库较多,未创新新仓库维护)
|
||||
|
||||
由于各个工程必然存在重复的工作(技术选型与对接、依赖管理与维护、系统级规范与约定)在这里统一实现
|
||||
@@ -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
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
*.js linguist-language=java
|
||||
*.css linguist-language=java
|
||||
*.html linguist-language=java
|
||||
@@ -1,2 +1,5 @@
|
||||
# ${rootArtifactId}
|
||||
|
||||
工程目录结构:
|
||||
|
||||

|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义配置类
|
||||
*/
|
||||
package ${package}.common.config;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义常量类
|
||||
*/
|
||||
package ${package}.common.constant;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里实现 api / ui 接口
|
||||
*/
|
||||
package ${package}.common.controller;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义传输对象
|
||||
*/
|
||||
package ${package}.common.dto;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义接口入参对象
|
||||
*/
|
||||
package ${package}.common.dto.param;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义接口返回值对象
|
||||
*/
|
||||
package ${package}.common.dto.result;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义枚举类
|
||||
*/
|
||||
package ${package}.common.enums;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里定义异常类
|
||||
*/
|
||||
package ${package}.common.exception;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里存放存储层实现
|
||||
*/
|
||||
package ${package}.common.repository.impl;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里存放业务层实现
|
||||
*/
|
||||
package ${package}.common.service.impl;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里存放业务层接口
|
||||
*/
|
||||
package ${package}.common.service;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* 这里存放工具类
|
||||
*/
|
||||
package ${package}.common.util;
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义配置类(可选)
|
||||
*/
|
||||
package ${package}.cache.config;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义常量类(可选)
|
||||
*/
|
||||
package ${package}.cache.constant;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里存放存储层实体/数据库表对应对象
|
||||
*/
|
||||
package ${package}.cache.po;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义枚举类(可选)
|
||||
*/
|
||||
package ${package}.cache.enums;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义异常类(可选)
|
||||
*/
|
||||
package ${package}.cache.exception;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
|
||||
*/
|
||||
package ${package}.cache;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里存放缓存层接口
|
||||
*/
|
||||
package ${package}.cache.service;
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层 - 使用 mysql 实现
|
||||
*/
|
||||
package ${package}.storage;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 存储具体实现
|
||||
*/
|
||||
package ${package}.storage.repository.impl;
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义配置类(可选)
|
||||
*/
|
||||
package ${package}.storage.config;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义常量类(可选)
|
||||
*/
|
||||
package ${package}.storage.constant;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义枚举类(可选)
|
||||
*/
|
||||
package ${package}.storage.enums;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义异常类(可选)
|
||||
*/
|
||||
package ${package}.storage.exception;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
|
||||
*/
|
||||
package ${package}.storage;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里存放存储层实体/数据库表对应对象
|
||||
*/
|
||||
package ${package}.storage.po;
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* 这里存放存储层接口
|
||||
*/
|
||||
package ${package}.common.repository;
|
||||
package ${package}.storage.repository;
|
||||
@@ -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>
|
||||
@@ -10,8 +10,11 @@
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<description>具体业务/子业务 按模块划分</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!-- 统一依赖 core -->
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-core</artifactId>
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义配置类(可选)
|
||||
*/
|
||||
package ${package}.provider.config;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义常量类(可选)
|
||||
*/
|
||||
package ${package}.provider.constant;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 给其他服务提供服务的实现
|
||||
*/
|
||||
package ${package}.provider.controller;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义枚举类(可选)
|
||||
*/
|
||||
package ${package}.provider.enums;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义异常类(可选)
|
||||
*/
|
||||
package ${package}.provider.exception;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
|
||||
*/
|
||||
package ${package}.storage;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 工具类,主要是DTO、模型转换等
|
||||
*/
|
||||
package ${package}.provider.util;
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义配置类(可选)
|
||||
*/
|
||||
package ${package}.reference.config;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义常量类(可选)
|
||||
*/
|
||||
package ${package}.reference.constant;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义枚举类(可选)
|
||||
*/
|
||||
package ${package}.reference.enums;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义异常类(可选)
|
||||
*/
|
||||
package ${package}.reference.exception;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
|
||||
*/
|
||||
package ${package}.reference;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里实现外部接口调用接口适配器类
|
||||
*/
|
||||
package ${package}.reference.service.impl;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义供自身工程使用的外部接口适配器接口
|
||||
*/
|
||||
package ${package}.reference.service;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 工具类,主要是DTO、模型转换等
|
||||
*/
|
||||
package ${package}.reference.util;
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 具体某个应用的接口
|
||||
*/
|
||||
package ${package}.reference;
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
*
|
||||
* 一个示例
|
||||
*
|
||||
* @author ${author}
|
||||
*/
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义配置类(可选)
|
||||
*/
|
||||
package ${package}.web.config;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义常量类(可选)
|
||||
*/
|
||||
package ${package}.web.constant;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义供自身工程给自己的前端提供的接口
|
||||
*/
|
||||
package ${package}.web.controller;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义枚举类(可选)
|
||||
*/
|
||||
package ${package}.web.enums;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 这里定义异常类(可选)
|
||||
*/
|
||||
package ${package}.web.exception;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* ${appId} 存储层相关定义,供 存储层实现模块、具体业务模块依赖,隔离存储实现
|
||||
*/
|
||||
package ${package}.storage;
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 工具类,主要是DTO、模型转换等
|
||||
*/
|
||||
package ${package}.web.util;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user