Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KnowledgePlanet
road-map
xfg-frame-archetype-lite
提交
a3fe8a92
xfg-frame-archetype-lite
项目概览
KnowledgePlanet
/
road-map
/
xfg-frame-archetype-lite
通知
1648
Star
80
Fork
96
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
xfg-frame-archetype-lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a3fe8a92
编写于
11月 04, 2023
作者:
小傅哥
⛹
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小傅哥,feat:初始化轻量版DDD脚手架
上级
变更
47
隐藏空白更改
内联
并排
Showing
47 changed file
with
1218 addition
and
0 deletion
+1218
-0
.gitignore
.gitignore
+39
-0
README.md
README.md
+2
-0
pom.xml
pom.xml
+183
-0
xfg-frame-archetype-lite-app/Dockerfile
xfg-frame-archetype-lite-app/Dockerfile
+18
-0
xfg-frame-archetype-lite-app/build.sh
xfg-frame-archetype-lite-app/build.sh
+7
-0
xfg-frame-archetype-lite-app/pom.xml
xfg-frame-archetype-lite-app/pom.xml
+138
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/Application.java
...etype-lite-app/src/main/java/cn/bugstack/Application.java
+15
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/GuavaConfig.java
...ite-app/src/main/java/cn/bugstack/config/GuavaConfig.java
+20
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/ThreadPoolConfig.java
...pp/src/main/java/cn/bugstack/config/ThreadPoolConfig.java
+50
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/ThreadPoolConfigProperties.java
...n/java/cn/bugstack/config/ThreadPoolConfigProperties.java
+26
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/package-info.java
...te-app/src/main/java/cn/bugstack/config/package-info.java
+6
-0
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/package-info.java
...type-lite-app/src/main/java/cn/bugstack/package-info.java
+5
-0
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
...archetype-lite-app/src/main/resources/application-dev.yml
+42
-0
xfg-frame-archetype-lite-app/src/main/resources/application-prod.yml
...rchetype-lite-app/src/main/resources/application-prod.yml
+42
-0
xfg-frame-archetype-lite-app/src/main/resources/application-test.yml
...rchetype-lite-app/src/main/resources/application-test.yml
+42
-0
xfg-frame-archetype-lite-app/src/main/resources/application.yml
...ame-archetype-lite-app/src/main/resources/application.yml
+5
-0
xfg-frame-archetype-lite-app/src/main/resources/logback-spring.xml
...-archetype-lite-app/src/main/resources/logback-spring.xml
+114
-0
xfg-frame-archetype-lite-app/src/main/resources/mybatis/config/mybatis-config.xml
...-app/src/main/resources/mybatis/config/mybatis-config.xml
+10
-0
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/frame_case_mapper.xml
...p/src/main/resources/mybatis/mapper/frame_case_mapper.xml
+25
-0
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/ApiTest.java
...type-lite-app/src/test/java/cn/bugstack/test/ApiTest.java
+19
-0
xfg-frame-archetype-lite-domain/pom.xml
xfg-frame-archetype-lite-domain/pom.xml
+75
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/adapter/package-info.java
...ain/java/cn/bugstack/domain/xxx/adapter/package-info.java
+5
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/aggregate/package-info.java
.../cn/bugstack/domain/xxx/model/aggregate/package-info.java
+8
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/entity/package-info.java
...ava/cn/bugstack/domain/xxx/model/entity/package-info.java
+8
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/valobj/package-info.java
...ava/cn/bugstack/domain/xxx/model/valobj/package-info.java
+7
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/repository/package-info.java
.../java/cn/bugstack/domain/xxx/repository/package-info.java
+6
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/service/package-info.java
...ain/java/cn/bugstack/domain/xxx/service/package-info.java
+2
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/aggregate/package-info.java
.../cn/bugstack/domain/yyy/model/aggregate/package-info.java
+8
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/entity/package-info.java
...ava/cn/bugstack/domain/yyy/model/entity/package-info.java
+8
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/valobj/package-info.java
...ava/cn/bugstack/domain/yyy/model/valobj/package-info.java
+7
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/repository/package-info.java
.../java/cn/bugstack/domain/yyy/repository/package-info.java
+6
-0
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/service/package-info.java
...ain/java/cn/bugstack/domain/yyy/service/package-info.java
+2
-0
xfg-frame-archetype-lite-infrastructure/pom.xml
xfg-frame-archetype-lite-infrastructure/pom.xml
+46
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/adapter/package-info.java
...bugstack/infrastructure/gateway/adapter/package-info.java
+2
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/api/package-info.java
.../cn/bugstack/infrastructure/gateway/api/package-info.java
+2
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/dto/package-info.java
.../cn/bugstack/infrastructure/gateway/dto/package-info.java
+2
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/package-info.java
.../bugstack/infrastructure/persistent/dao/package-info.java
+5
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/package-info.java
...n/bugstack/infrastructure/persistent/po/package-info.java
+5
-0
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/package-info.java
...ck/infrastructure/persistent/repository/package-info.java
+5
-0
xfg-frame-archetype-lite-trigger/pom.xml
xfg-frame-archetype-lite-trigger/pom.xml
+59
-0
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/http/package-info.java
.../src/main/java/cn/bugstack/trigger/http/package-info.java
+5
-0
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/job/package-info.java
...r/src/main/java/cn/bugstack/trigger/job/package-info.java
+5
-0
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/listener/package-info.java
.../main/java/cn/bugstack/trigger/listener/package-info.java
+6
-0
xfg-frame-archetype-lite-types/pom.xml
xfg-frame-archetype-lite-types/pom.xml
+53
-0
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java
...pes/src/main/java/cn/bugstack/types/common/Constants.java
+7
-0
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/enums/ResponseCode.java
...s/src/main/java/cn/bugstack/types/enums/ResponseCode.java
+20
-0
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/exception/AppException.java
...c/main/java/cn/bugstack/types/exception/AppException.java
+46
-0
未找到文件。
.gitignore
0 → 100644
浏览文件 @
a3fe8a92
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
\ No newline at end of file
README.md
0 → 100644
浏览文件 @
a3fe8a92
# xfg-frame-archetype - DDD 脚手架
pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<modules>
<module>
xfg-frame-archetype-lite-app
</module>
<module>
xfg-frame-archetype-lite-domain
</module>
<module>
xfg-frame-archetype-lite-trigger
</module>
<module>
xfg-frame-archetype-lite-infrastructure
</module>
<module>
xfg-frame-archetype-lite-types
</module>
</modules>
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<developers>
<developer>
<name>
xiaofuge
</name>
<email>
184172133@qq.com
</email>
<organization>
fuzhengwei
</organization>
<organizationUrl>
https://github.com/fuzhengwei
</organizationUrl>
</developer>
</developers>
<licenses>
<license>
<name>
Apache License, Version 2.0
</name>
<url>
https://www.apache.org/licenses/LICENSE-2.0
</url>
</license>
</licenses>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.7.12
</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.1.4
</version>
</dependency>
<!-- # 多数据源路由配置
# mysql 5.x driver-class-name: com.mysql.jdbc.Driver mysql-connector-java 5.1.34
# mysql 8.x driver-class-name: com.mysql.cj.jdbc.Driver mysql-connector-java 8.0.22-->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.22
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
2.0.28
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.9
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
32.1.3-jre
</version>
</dependency>
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
<version>
1.6.1
</version>
</dependency>
<dependency>
<groupId>
com.thoughtworks.xstream
</groupId>
<artifactId>
xstream
</artifactId>
<version>
1.4.10
</version>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
<version>
0.9.1
</version>
</dependency>
<dependency>
<groupId>
com.auth0
</groupId>
<artifactId>
java-jwt
</artifactId>
<version>
4.4.0
</version>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
<version>
1.15
</version>
</dependency>
<!-- 工程模块 -->
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-domain
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-infrastructure
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-types
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-trigger
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.0
</version>
<configuration>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
2.5
</version>
<configuration>
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
versions-maven-plugin
</artifactId>
<version>
2.7
</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>
dev
</id>
<activation>
<activeByDefault>
true
</activeByDefault>
</activation>
<properties>
<java_jvm>
-Xms1G -Xmx1G -server -XX:MaxPermSize=256M -Xss256K -Dspring.profiles.active=test -XX:+DisableExplicitGC -XX:+UseG1GC -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/export/Logs/xfg-frame-archetype-lite-boot -Xloggc:/export/Logs/xfg-frame-archetype-lite-boot/gc-xfg-frame-archetype-lite-boot.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
</java_jvm>
<profileActive>
dev
</profileActive>
</properties>
</profile>
<profile>
<id>
test
</id>
<properties>
<java_jvm>
-Xms1G -Xmx1G -server -XX:MaxPermSize=256M -Xss256K -Dspring.profiles.active=test -XX:+DisableExplicitGC -XX:+UseG1GC -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/export/Logs/xfg-frame-archetype-lite-boot -Xloggc:/export/Logs/xfg-frame-archetype-lite-boot/gc-xfg-frame-archetype-lite-boot.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
</java_jvm>
<profileActive>
test
</profileActive>
</properties>
</profile>
<profile>
<id>
prod
</id>
<properties>
<java_jvm>
-Xms6G -Xmx6G -server -XX:MaxPermSize=256M -Xss256K -Dspring.profiles.active=release -XX:+DisableExplicitGC -XX:+UseG1GC -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/export/Logs/fq-mall-activity-app -Xloggc:/export/Logs/xfg-frame-archetype-lite-boot/gc-xfg-frame-archetype-lite-boot.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
</java_jvm>
<profileActive>
prod
</profileActive>
</properties>
</profile>
</profiles>
</project>
xfg-frame-archetype-lite-app/Dockerfile
0 → 100644
浏览文件 @
a3fe8a92
# 基础镜像
FROM
openjdk:8-jre-slim
# 作者
MAINTAINER
xiaofuge
# 配置
ENV
PARAMS=""
# 时区
ENV
TZ=PRC
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
# 添加应用
ADD
target/xfg-frame-archetype-lite-app-app.jar /xfg-frame-archetype-lite-app-app.jar
ENTRYPOINT
["sh","-c","java -jar $JAVA_OPTS /xfg-frame-archetype-lite-app-app.jar $PARAMS"]
\ No newline at end of file
xfg-frame-archetype-lite-app/build.sh
0 → 100644
浏览文件 @
a3fe8a92
# 普通镜像构建,随系统版本构建 amd/arm
docker build
-t
system/xfg-frame-archetype-lite-app:1.0-SNAPSHOT
-f
./Dockerfile
.
# 兼容 amd、arm 构建镜像
# docker buildx build --load --platform liunx/amd64,linux/arm64 -t xiaofuge/xfg-frame-archetype-app:1.0 -f ./Dockerfile . --push
\ No newline at end of file
xfg-frame-archetype-lite-app/pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
xfg-frame-archetype-lite-app
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
</dependency>
<!-- # 多数据源路由配置
# mysql 5.x driver-class-name: com.mysql.jdbc.Driver mysql-connector-java 5.1.34
# mysql 8.x driver-class-name: com.mysql.cj.jdbc.Driver mysql-connector-java 8.0.22-->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
</dependency>
<dependency>
<groupId>
com.auth0
</groupId>
<artifactId>
java-jwt
</artifactId>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
</dependency>
<dependency>
<groupId>
com.squareup.retrofit2
</groupId>
<artifactId>
converter-gson
</artifactId>
<version>
2.9.0
</version>
</dependency>
<!-- 工程模块;启动依赖 trigger->domain, infrastructure-->
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-trigger
</artifactId>
</dependency>
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-infrastructure
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
xfg-frame-archetype-lite-app
</finalName>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<filtering>
true
</filtering>
<includes>
<include>
**/**
</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>
src/test/resources
</directory>
<filtering>
true
</filtering>
<includes>
<include>
**/**
</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.6
</version>
<configuration>
<skipTests>
true
</skipTests>
<testFailureIgnore>
false
</testFailureIgnore>
<includes>
<include>
**/*Test.java
</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<mainClass>
cn.bugstack.Application
</mainClass>
<layout>
JAR
</layout>
</configuration>
</plugin>
</plugins>
</build>
</project>
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/Application.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack
;
import
org.springframework.beans.factory.annotation.Configurable
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
@Configurable
public
class
Application
{
public
static
void
main
(
String
[]
args
){
SpringApplication
.
run
(
Application
.
class
);
}
}
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/GuavaConfig.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.config
;
import
com.google.common.cache.Cache
;
import
com.google.common.cache.CacheBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.concurrent.TimeUnit
;
@Configuration
public
class
GuavaConfig
{
@Bean
(
name
=
"cache"
)
public
Cache
<
String
,
String
>
cache
()
{
return
CacheBuilder
.
newBuilder
()
.
expireAfterWrite
(
3
,
TimeUnit
.
SECONDS
)
.
build
();
}
}
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/ThreadPoolConfig.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
java.util.concurrent.*
;
@Slf4j
@EnableAsync
@Configuration
@EnableConfigurationProperties
(
ThreadPoolConfigProperties
.
class
)
public
class
ThreadPoolConfig
{
@Bean
@ConditionalOnMissingBean
(
ThreadPoolExecutor
.
class
)
public
ThreadPoolExecutor
threadPoolExecutor
(
ThreadPoolConfigProperties
properties
)
throws
ClassNotFoundException
,
InstantiationException
,
IllegalAccessException
{
// 实例化策略
RejectedExecutionHandler
handler
;
switch
(
properties
.
getPolicy
()){
case
"AbortPolicy"
:
handler
=
new
ThreadPoolExecutor
.
AbortPolicy
();
break
;
case
"DiscardPolicy"
:
handler
=
new
ThreadPoolExecutor
.
DiscardPolicy
();
break
;
case
"DiscardOldestPolicy"
:
handler
=
new
ThreadPoolExecutor
.
DiscardOldestPolicy
();
break
;
case
"CallerRunsPolicy"
:
handler
=
new
ThreadPoolExecutor
.
CallerRunsPolicy
();
break
;
default
:
handler
=
new
ThreadPoolExecutor
.
AbortPolicy
();
break
;
}
// 创建线程池
return
new
ThreadPoolExecutor
(
properties
.
getCorePoolSize
(),
properties
.
getMaxPoolSize
(),
properties
.
getKeepAliveTime
(),
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
properties
.
getBlockQueueSize
()),
Executors
.
defaultThreadFactory
(),
handler
);
}
}
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/ThreadPoolConfigProperties.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.config
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@Data
@ConfigurationProperties
(
prefix
=
"thread.pool.executor.config"
,
ignoreInvalidFields
=
true
)
public
class
ThreadPoolConfigProperties
{
/** 核心线程数 */
private
Integer
corePoolSize
=
20
;
/** 最大线程数 */
private
Integer
maxPoolSize
=
200
;
/** 最大等待时间 */
private
Long
keepAliveTime
=
10L
;
/** 最大队列数 */
private
Integer
blockQueueSize
=
5000
;
/*
* AbortPolicy:丢弃任务并抛出RejectedExecutionException异常。
* DiscardPolicy:直接丢弃任务,但是不会抛出异常
* DiscardOldestPolicy:将最早进入队列的任务删除,之后再尝试加入队列的任务被拒绝
* CallerRunsPolicy:如果任务添加线程池失败,那么主线程自己执行该任务
* */
private
String
policy
=
"AbortPolicy"
;
}
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/config/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 1. 用于管理引入的Jar所需的资源启动或者初始化处理
* 2. 如果有AOP切面,可以再建一个aop包,来写切面逻辑
*/
package
cn.bugstack.config
;
xfg-frame-archetype-lite-app/src/main/java/cn/bugstack/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 应用启动层,注意Application所在的包路径,是在上一层。这样才能扫描到其他 module
* */
package
cn.bugstack
;
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/application-dev.yml
0 → 100644
浏览文件 @
a3fe8a92
server
:
port
:
8091
# 线程池配置
thread
:
pool
:
executor
:
config
:
core-pool-size
:
20
max-pool-size
:
50
keep-alive-time
:
5000
block-queue-size
:
5000
policy
:
CallerRunsPolicy
# 数据库配置;启动时配置数据库资源信息
spring
:
datasource
:
username
:
root
password
:
123456
url
:
jdbc:mysql://127.0.0.1:3306/xfg_frame_archetype?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
driver-class-name
:
com.mysql.cj.jdbc.Driver
hikari
:
pool-name
:
Retail_HikariCP
minimum-idle
:
15
#最小空闲连接数量
idle-timeout
:
180000
#空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size
:
25
#连接池最大连接数,默认是10
auto-commit
:
true
#此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime
:
1800000
#此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
connection-timeout
:
30000
#数据库连接超时时间,默认30秒,即30000
connection-test-query
:
SELECT
1
type
:
com.zaxxer.hikari.HikariDataSource
#mybatis:
# mapper-locations: classpath:/mybatis/mapper/*.xml
# config-location: classpath:/mybatis/config/mybatis-config.xml
# 日志
logging
:
level
:
root
:
info
config
:
classpath:logback-spring.xml
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/application-prod.yml
0 → 100644
浏览文件 @
a3fe8a92
server
:
port
:
8091
# 线程池配置
thread
:
pool
:
executor
:
config
:
core-pool-size
:
20
max-pool-size
:
50
keep-alive-time
:
5000
block-queue-size
:
5000
policy
:
CallerRunsPolicy
# 数据库配置
#spring:
# datasource:
# username: root
# password: 123456
# url: jdbc:mysql://127.0.0.1:3306/xfg_frame_archetype?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
# driver-class-name: com.mysql.cj.jdbc.Driver
# hikari:
# pool-name: Retail_HikariCP
# minimum-idle: 15 #最小空闲连接数量
# idle-timeout: 180000 #空闲连接存活最大时间,默认600000(10分钟)
# maximum-pool-size: 25 #连接池最大连接数,默认是10
# auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
# max-lifetime: 1800000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# connection-timeout: 30000 #数据库连接超时时间,默认30秒,即30000
# connection-test-query: SELECT 1
# type: com.zaxxer.hikari.HikariDataSource
#mybatis:
# mapper-locations: classpath:/mybatis/mapper/*.xml
# config-location: classpath:/mybatis/config/mybatis-config.xml
# 日志
logging
:
level
:
root
:
info
config
:
classpath:logback-spring.xml
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/application-test.yml
0 → 100644
浏览文件 @
a3fe8a92
server
:
port
:
8091
# 线程池配置
thread
:
pool
:
executor
:
config
:
core-pool-size
:
20
max-pool-size
:
50
keep-alive-time
:
5000
block-queue-size
:
5000
policy
:
CallerRunsPolicy
# 数据库配置
#spring:
# datasource:
# username: root
# password: 123456
# url: jdbc:mysql://127.0.0.1:3306/xfg_frame_archetype?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC&useSSL=true
# driver-class-name: com.mysql.cj.jdbc.Driver
# hikari:
# pool-name: Retail_HikariCP
# minimum-idle: 15 #最小空闲连接数量
# idle-timeout: 180000 #空闲连接存活最大时间,默认600000(10分钟)
# maximum-pool-size: 25 #连接池最大连接数,默认是10
# auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
# max-lifetime: 1800000 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# connection-timeout: 30000 #数据库连接超时时间,默认30秒,即30000
# connection-test-query: SELECT 1
# type: com.zaxxer.hikari.HikariDataSource
#mybatis:
# mapper-locations: classpath:/mybatis/mapper/*.xml
# config-location: classpath:/mybatis/config/mybatis-config.xml
# 日志
logging
:
level
:
root
:
info
config
:
classpath:logback-spring.xml
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/application.yml
0 → 100644
浏览文件 @
a3fe8a92
spring
:
config
:
name
:
xfg-frame-archetype-lite-app
profiles
:
active
:
dev
xfg-frame-archetype-lite-app/src/main/resources/logback-spring.xml
0 → 100644
浏览文件 @
a3fe8a92
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<contextName>
logback
</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<springProperty
scope=
"context"
name=
"log.path"
source=
"logging.path"
/>
<!-- 日志格式 -->
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<!-- 输出到控制台 -->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- 此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息 -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
info
</level>
</filter>
<encoder>
<pattern>
%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0}%X{ServiceId} -%X{trace-id} %m%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender
name=
"INFO_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
./data/log/log_info.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0}%X{ServiceId} -%X{trace-id} %m%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>
./data/log/log-info-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>
15
</maxHistory>
<totalSizeCap>
10GB
</totalSizeCap>
</rollingPolicy>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 正在记录的日志文件的路径及文件名 -->
<file>
./data/log/log_error.log
</file>
<!--日志文件输出格式-->
<encoder>
<pattern>
%d{yy-MM-dd.HH:mm:ss.SSS} [%-16t] %-5p %-22c{0}%X{ServiceId} -%X{trace-id} %m%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<fileNamePattern>
./data/log/log-error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"
>
<maxFileSize>
100MB
</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 日志文件保留天数【根据服务器预留,可自行调整】 -->
<maxHistory>
7
</maxHistory>
<totalSizeCap>
5GB
</totalSizeCap>
</rollingPolicy>
<!-- WARN 级别及以上 -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
WARN
</level>
</filter>
</appender>
<!-- 异步输出 -->
<appender
name=
"ASYNC_FILE_INFO"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<!-- 队列剩余容量小于discardingThreshold,则会丢弃TRACT、DEBUG、INFO级别的日志;默认值-1,为queueSize的20%;0不丢失日志 -->
<discardingThreshold>
0
</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>
8192
</queueSize>
<!-- neverBlock:true 会丢失日志,但业务性能不受影响 -->
<neverBlock>
true
</neverBlock>
<!--是否提取调用者数据-->
<includeCallerData>
false
</includeCallerData>
<appender-ref
ref=
"INFO_FILE"
/>
</appender>
<appender
name=
"ASYNC_FILE_ERROR"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<!-- 队列剩余容量小于discardingThreshold,则会丢弃TRACT、DEBUG、INFO级别的日志;默认值-1,为queueSize的20%;0不丢失日志 -->
<discardingThreshold>
0
</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
<queueSize>
1024
</queueSize>
<!-- neverBlock:true 会丢失日志,但业务性能不受影响 -->
<neverBlock>
true
</neverBlock>
<!--是否提取调用者数据-->
<includeCallerData>
false
</includeCallerData>
<appender-ref
ref=
"ERROR_FILE"
/>
</appender>
<!-- 开发环境:控制台打印 -->
<springProfile
name=
"dev"
>
<logger
name=
"com.nmys.view"
level=
"debug"
/>
</springProfile>
<root
level=
"info"
>
<appender-ref
ref=
"CONSOLE"
/>
<!-- 异步日志-INFO -->
<appender-ref
ref=
"ASYNC_FILE_INFO"
/>
<!-- 异步日志-ERROR -->
<appender-ref
ref=
"ASYNC_FILE_ERROR"
/>
</root>
</configuration>
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/mybatis/config/mybatis-config.xml
0 → 100644
浏览文件 @
a3fe8a92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 暂时未使用 文档:https://mybatis.org/mybatis-3/zh/configuration.html#typeAliases -->
<typeAliases>
</typeAliases>
</configuration>
\ No newline at end of file
xfg-frame-archetype-lite-app/src/main/resources/mybatis/mapper/frame_case_mapper.xml
0 → 100644
浏览文件 @
a3fe8a92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.bugstack.infrastructure.persistent.dao.Xxx"
>
<resultMap
id=
"CaseMap"
type=
"cn.bugstack.infrastructure.persistent.po.A"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<insert
id=
"insert"
parameterType=
"cn.bugstack.infrastructure.persistent.po.A"
>
INSERT INTO table(a,b,c) VALUES(#{a}, #{b}, #{c})
</insert>
<update
id=
"update"
parameterType=
"cn.bugstack.infrastructure.persistent.po.A"
>
UPDATE table SET a = #{a} WHERE b = #{b}
</update>
<select
id=
"queryEmployeeByEmployNumber"
parameterType=
"java.lang.String"
resultMap=
"CaseMap"
>
SELECT a, b, c
FROM table
WHERE a = #{a}
</select>
</mapper>
xfg-frame-archetype-lite-app/src/test/java/cn/bugstack/test/ApiTest.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.test
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
ApiTest
{
@Test
public
void
test
()
{
log
.
info
(
"测试完成"
);
}
}
xfg-frame-archetype-lite-domain/pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
xfg-frame-archetype-lite-domain
</artifactId>
<dependencies>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
</dependency>
<dependency>
<groupId>
io.jsonwebtoken
</groupId>
<artifactId>
jjwt
</artifactId>
</dependency>
<dependency>
<groupId>
com.auth0
</groupId>
<artifactId>
java-jwt
</artifactId>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
</dependency>
<!-- 系统模块 -->
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-types
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
xfg-frame-archetype-lite-domain
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-archetype-plugin
</artifactId>
<version>
3.2.0
</version>
<executions>
<execution>
<goals>
<goal>
create-from-project
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<compilerVersion>
${java.version}
</compilerVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/adapter/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 外部接口适配器层;当需要调用外部接口时,则创建出这一层,并定义接口,之后由基础设施层的 adapter 层具体实现
*/
package
cn.bugstack.domain.xxx.adapter
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/aggregate/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 聚合对象;
* 1. 聚合实体和值对象
* 2. 聚合是聚合的对象,和提供基础处理对象的方法。但不建议在聚合中引入仓储和接口来做过大的逻辑。而这些复杂的操作应该放到service中处理
* 3. 对象名称 XxxAggregate
*/
package
cn.bugstack.domain.xxx.model.aggregate
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/entity/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 实体对象;
* 1. 一般和数据库持久化对象1v1的关系,但因各自开发系统的不同,也有1vn的可能。
* 2. 如果是老系统改造,那么旧的库表冗余了太多的字段,可能会有nv1的情况
* 3. 对象名称 XxxEntity
*/
package
cn.bugstack.domain.xxx.model.entity
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/model/valobj/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 值对象;
* 1. 用于描述对象属性的值,如一个库表中有json后者一个字段多个属性信息的枚举对象
* 2. 对象名称如;XxxVO
*/
package
cn.bugstack.domain.xxx.model.valobj
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/repository/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 仓储服务
* 1. 定义仓储接口,之后由基础设施层做具体实现
*/
package
cn.bugstack.domain.xxx.repository
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/xxx/service/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.domain.xxx.service
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/aggregate/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 聚合对象;
* 1. 聚合实体和值对象
* 2. 聚合是聚合的对象,和提供基础处理对象的方法。但不建议在聚合中引入仓储和接口来做过大的逻辑。而这些复杂的操作应该放到service中处理
* 3. 对象名称 XxxAggregate
*/
package
cn.bugstack.domain.yyy.model.aggregate
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/entity/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 实体对象;
* 1. 一般和数据库持久化对象1v1的关系,但因各自开发系统的不同,也有1vn的可能。
* 2. 如果是老系统改造,那么旧的库表冗余了太多的字段,可能会有nv1的情况
* 3. 对象名称 XxxEntity
*/
package
cn.bugstack.domain.yyy.model.entity
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/model/valobj/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 值对象;
* 1. 用于描述对象属性的值,如一个库表中有json后者一个字段多个属性信息的枚举对象
* 2. 对象名称如;XxxVO
*/
package
cn.bugstack.domain.yyy.model.valobj
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/repository/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 仓储服务
* 1. 定义仓储接口,之后由基础设施层做具体实现
*/
package
cn.bugstack.domain.yyy.repository
;
\ No newline at end of file
xfg-frame-archetype-lite-domain/src/main/java/cn/bugstack/domain/yyy/service/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.domain.yyy.service
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
xfg-frame-archetype-lite-infrastructure
</artifactId>
<dependencies>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<!-- 系统模块 -->
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-domain
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
xfg-frame-archetype-lite-infrastructure
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-archetype-plugin
</artifactId>
<version>
3.2.0
</version>
<executions>
<execution>
<goals>
<goal>
create-from-project
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/adapter/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.infrastructure.gateway.adapter
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/api/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.infrastructure.gateway.api
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/gateway/dto/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.infrastructure.gateway.dto
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/dao/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* DAO 接口;IXxxDao
*/
package
cn.bugstack.infrastructure.persistent.dao
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/po/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 持久化对象;XxxPO 最后的 PO 是大写,UserPO
*/
package
cn.bugstack.infrastructure.persistent.po
;
\ No newline at end of file
xfg-frame-archetype-lite-infrastructure/src/main/java/cn/bugstack/infrastructure/persistent/repository/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 仓储实现;用于实现 domain 中定义的仓储接口,如;IXxxRepository 在 Repository 中调用服务
*/
package
cn.bugstack.infrastructure.persistent.repository
;
\ No newline at end of file
xfg-frame-archetype-lite-trigger/pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
xfg-frame-archetype-lite-trigger
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<!-- 系统模块 -->
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-types
</artifactId>
</dependency>
<dependency>
<groupId>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite-domain
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
xfg-frame-archetype-lite-trigger
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-archetype-plugin
</artifactId>
<version>
3.2.0
</version>
<executions>
<execution>
<goals>
<goal>
create-from-project
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/http/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* HTTP 接口服务
*/
package
cn.bugstack.trigger.http
;
\ No newline at end of file
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/job/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 任务服务,可以选择使用 Spring 默认提供的 Schedule https://bugstack.cn/md/road-map/quartz.html
*/
package
cn.bugstack.trigger.job
;
\ No newline at end of file
xfg-frame-archetype-lite-trigger/src/main/java/cn/bugstack/trigger/listener/package-info.java
0 → 100644
浏览文件 @
a3fe8a92
/**
* 监听服务;在单体服务中,解耦流程。类似MQ的使用,如Spring的Event,Guava的事件总线都可以。如果使用了 Redis 那么也可以有发布/订阅使用。
* Guava:https://bugstack.cn/md/road-map/guava.html
*/
package
cn.bugstack.trigger.listener
;
\ No newline at end of file
xfg-frame-archetype-lite-types/pom.xml
0 → 100644
浏览文件 @
a3fe8a92
<?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>
cn.bugstack
</groupId>
<artifactId>
xfg-frame-archetype-lite
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
xfg-frame-archetype-lite-types
</artifactId>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.thoughtworks.xstream
</groupId>
<artifactId>
xstream
</artifactId>
</dependency>
<dependency>
<groupId>
dom4j
</groupId>
<artifactId>
dom4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
xfg-frame-archetype-lite-types
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-archetype-plugin
</artifactId>
<version>
3.2.0
</version>
<executions>
<execution>
<goals>
<goal>
create-from-project
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/common/Constants.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.types.common
;
public
class
Constants
{
public
final
static
String
SPLIT
=
","
;
}
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/enums/ResponseCode.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.types.enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
@AllArgsConstructor
@NoArgsConstructor
@Getter
public
enum
ResponseCode
{
SUCCESS
(
"0000"
,
"成功"
),
UN_ERROR
(
"0001"
,
"未知失败"
),
ILLEGAL_PARAMETER
(
"0002"
,
"非法参数"
),
;
private
String
code
;
private
String
info
;
}
xfg-frame-archetype-lite-types/src/main/java/cn/bugstack/types/exception/AppException.java
0 → 100644
浏览文件 @
a3fe8a92
package
cn.bugstack.types.exception
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
AppException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
5317680961212299217L
;
/** 异常码 */
private
String
code
;
/** 异常信息 */
private
String
info
;
public
AppException
(
String
code
)
{
this
.
code
=
code
;
}
public
AppException
(
String
code
,
Throwable
cause
)
{
this
.
code
=
code
;
super
.
initCause
(
cause
);
}
public
AppException
(
String
code
,
String
message
)
{
this
.
code
=
code
;
this
.
info
=
message
;
}
public
AppException
(
String
code
,
String
message
,
Throwable
cause
)
{
this
.
code
=
code
;
this
.
info
=
message
;
super
.
initCause
(
cause
);
}
@Override
public
String
toString
()
{
return
"cn.bugstack.x.api.types.exception.XApiException{"
+
"code='"
+
code
+
'\''
+
", info='"
+
info
+
'\''
+
'}'
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录