提交 f302746c 编写于 作者: wowowow刚刚's avatar wowowow刚刚

脚手架初始化

上级 00330145
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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="59ec00a0-b682-471c-8315-b245dcd866aa" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-api/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-api/src/main/java/org/itxzw/api/dto/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-api/src/main/java/org/itxzw/api/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-api/src/main/java/org/itxzw/api/response/Response.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/Dockerfile" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/build.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/Application.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/config/GuavaConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/config/ThreadPoolConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/config/ThreadPoolConfigProperties.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/config/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/java/org/itxzw/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/application-dev.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/application-prod.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/application-test.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/application.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/logback-spring.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/mybatis/config/mybatis-config.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/main/resources/mybatis/mapper/frame_case_mapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-app/src/test/java/org/itxzw/test/ApiTest.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/adapter/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/adapter/port/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/model/aggregate/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/model/entity/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/model/valobj/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/xxx/service/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/yyy/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/yyy/model/aggregate/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/yyy/model/entity/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/yyy/model/valobj/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-domain/src/main/java/org/itxzw/domain/yyy/service/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/adapter/port/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/dao/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/dao/po/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/gateway/dto/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/gateway/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-infrastructure/src/main/java/org/itxzw/infrastructure/redis/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-trigger/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-trigger/src/main/java/org/itxzw/trigger/http/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-trigger/src/main/java/org/itxzw/trigger/job/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-trigger/src/main/java/org/itxzw/trigger/listener/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-types/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-types/src/main/java/org/itxzw/types/common/Constants.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-types/src/main/java/org/itxzw/types/enums/ResponseCode.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/big-market-types/src/main/java/org/itxzw/types/exception/AppException.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/data/log/log_error.log" afterDir="false" />
<change afterPath="$PROJECT_DIR$/data/log/log_info.log" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docs/dev-ops/app/start.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docs/dev-ops/app/stop.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docs/dev-ops/docker-compose-app.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docs/dev-ops/docker-compose-environment.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docs/dev-ops/mysql/sql/xfg-frame-archetype.sql" afterDir="false" />
<change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/.idea/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/docs/dev-ops/app/start.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/docs/dev-ops/app/stop.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/docs/dev-ops/docker-compose-app.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/docs/dev-ops/docker-compose-environment.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/docs/dev-ops/mysql/sql/xfg-frame-archetype.sql" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-api/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-api/src/main/java/org/example/api/dto/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-api/src/main/java/org/example/api/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-api/src/main/java/org/example/api/response/Response.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/Dockerfile" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/build.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/Application.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/config/GuavaConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/config/ThreadPoolConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/config/ThreadPoolConfigProperties.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/config/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/java/org/example/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/application-dev.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/application-prod.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/application-test.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/application.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/logback-spring.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/mybatis/config/mybatis-config.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/main/resources/mybatis/mapper/frame_case_mapper.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-app/src/test/java/org/example/test/ApiTest.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/adapter/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/adapter/port/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/model/aggregate/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/model/entity/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/model/valobj/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/xxx/service/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/yyy/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/yyy/model/aggregate/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/yyy/model/entity/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/yyy/model/valobj/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-domain/src/main/java/org/example/domain/yyy/service/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/adapter/port/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/adapter/repository/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/dao/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/dao/po/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/gateway/dto/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/gateway/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-infrastructure/src/main/java/org/example/infrastructure/redis/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-trigger/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-trigger/src/main/java/org/example/trigger/http/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-trigger/src/main/java/org/example/trigger/job/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-trigger/src/main/java/org/example/trigger/listener/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-types/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-types/src/main/java/org/example/types/common/Constants.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-types/src/main/java/org/example/types/enums/ResponseCode.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/../untitled/untitled-types/src/main/java/org/example/types/exception/AppException.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="localRepository" value="D:\ToolSoftware\Maven\apache-maven-3.9.6\resp" />
<option name="userSettingsFile" value="D:\ToolSoftware\Maven\apache-maven-3.9.6\conf\settings.xml" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectId" id="2k8C8irvbkwfOg6D2C4YqlWgrlY" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"git-widget-placeholder": "master",
"last_opened_file_path": "D:/Code/Java/xiangmu/dayingxiao",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "reference.settings.ide.settings.new.ui",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RunManager">
<configuration name="Application" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="big-market-app" />
<option name="SPRING_BOOT_MAIN_CLASS" value="org.itxzw.Application" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="59ec00a0-b682-471c-8315-b245dcd866aa" name="Changes" comment="" />
<created>1722655660949</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1722655660949</updated>
<workItem from="1722655661932" duration="956000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>
\ No newline at end of file
# xfg-frame-archetype - DDD 脚手架
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-api</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* 数据传输对象 xxxRequestDTO xxxResponseDTO
*/
package org.itxzw.api.dto;
\ No newline at end of file
/**
* 定义api接口
*/
package org.itxzw.api;
\ No newline at end of file
package org.itxzw.api.response;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Response<T> implements Serializable {
private static final long serialVersionUID = 7000723935764546321L;
private String code;
private String info;
private T data;
}
# 基础镜像
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/big-market-app.jar /big-market-app.jar
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /big-market-app.jar $PARAMS"]
\ No newline at end of file
# 普通镜像构建,随系统版本构建 amd/arm
docker build -t system/big-market-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
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-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>org.itxzw</groupId>
<artifactId>big-market-trigger</artifactId>
</dependency>
<dependency>
<groupId>org.itxzw</groupId>
<artifactId>big-market-infrastructure</artifactId>
</dependency>
</dependencies>
<build>
<finalName>big-market-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>org.itxzw.Application</mainClass>
<layout>JAR</layout>
</configuration>
</plugin>
</plugins>
</build>
</project>
package org.itxzw;
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);
}
}
package org.itxzw.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();
}
}
package org.itxzw.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);
}
}
package org.itxzw.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";
}
/**
* 1. 用于管理引入的Jar所需的资源启动或者初始化处理
* 2. 如果有AOP切面,可以再建一个aop包,来写切面逻辑
*/
package org.itxzw.config;
/**
* 应用启动层,注意Application所在的包路径,是在上一层。这样才能扫描到其他 module
* */
package org.itxzw;
\ No newline at end of file
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 配置【如需使用记得打开】
#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
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
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
spring:
config:
name: big-market-app
profiles:
active: dev
<?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
<?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
<?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="org.itxzw.infrastructure.persistent.dao.Xxx">
<resultMap id="CaseMap" type="org.itxzw.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="org.itxzw.infrastructure.persistent.po.A">
INSERT INTO table(a,b,c) VALUES(#{a}, #{b}, #{c})
</insert>
<update id="update" parameterType="org.itxzw.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>
package org.itxzw.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("测试完成");
}
}
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-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>org.itxzw</groupId>
<artifactId>big-market-types</artifactId>
</dependency>
</dependencies>
<build>
<finalName>big-market-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>
/**
* 外部接口适配器层;当需要调用外部接口时,则创建出这一层,并定义接口,之后由基础设施层的 adapter 层具体实现
*/
package org.itxzw.domain.xxx.adapter;
\ No newline at end of file
/**
* 外部接口适配器层;当需要调用外部接口时,则创建出这一层,并定义接口,之后由基础设施层的 adapter 层具体实现
*/
package org.itxzw.domain.xxx.adapter.port;
\ No newline at end of file
/**
* 仓储服务
* 1. 定义仓储接口,之后由基础设施层做具体实现
*/
package org.itxzw.domain.xxx.adapter.repository;
\ No newline at end of file
/**
* 聚合对象;
* 1. 聚合实体和值对象
* 2. 聚合是聚合的对象,和提供基础处理对象的方法。但不建议在聚合中引入仓储和接口来做过大的逻辑。而这些复杂的操作应该放到service中处理
* 3. 对象名称 XxxAggregate
*/
package org.itxzw.domain.xxx.model.aggregate;
\ No newline at end of file
/**
* 实体对象;
* 1. 一般和数据库持久化对象1v1的关系,但因各自开发系统的不同,也有1vn的可能。
* 2. 如果是老系统改造,那么旧的库表冗余了太多的字段,可能会有nv1的情况
* 3. 对象名称 XxxEntity
*/
package org.itxzw.domain.xxx.model.entity;
\ No newline at end of file
/**
* 值对象;
* 1. 用于描述对象属性的值,如一个库表中有json后者一个字段多个属性信息的枚举对象
* 2. 对象名称如;XxxVO
*/
package org.itxzw.domain.xxx.model.valobj;
\ No newline at end of file
package org.itxzw.domain.xxx.service;
\ No newline at end of file
/**
* 聚合对象;
* 1. 聚合实体和值对象
* 2. 聚合是聚合的对象,和提供基础处理对象的方法。但不建议在聚合中引入仓储和接口来做过大的逻辑。而这些复杂的操作应该放到service中处理
* 3. 对象名称 XxxAggregate
*/
package org.itxzw.domain.yyy.model.aggregate;
\ No newline at end of file
/**
* 实体对象;
* 1. 一般和数据库持久化对象1v1的关系,但因各自开发系统的不同,也有1vn的可能。
* 2. 如果是老系统改造,那么旧的库表冗余了太多的字段,可能会有nv1的情况
* 3. 对象名称 XxxEntity
*/
package org.itxzw.domain.yyy.model.entity;
\ No newline at end of file
/**
* 值对象;
* 1. 用于描述对象属性的值,如一个库表中有json后者一个字段多个属性信息的枚举对象
* 2. 对象名称如;XxxVO
*/
package org.itxzw.domain.yyy.model.valobj;
\ No newline at end of file
package org.itxzw.domain.yyy.service;
\ No newline at end of file
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-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>org.itxzw</groupId>
<artifactId>big-market-domain</artifactId>
</dependency>
</dependencies>
<build>
<finalName>big-market-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>
/**
* 实现对外部的api调用,类的名称为 XxxPort 接口定义在 domain 中
*/
package org.itxzw.infrastructure.adapter.port;
\ No newline at end of file
/**
* 仓储实现;用于实现 domain 中定义的仓储接口,如;IXxxRepository 在 Repository 中调用服务
*/
package org.itxzw.infrastructure.adapter.repository;
\ No newline at end of file
/**
* DAO 接口;IXxxDao
*/
package org.itxzw.infrastructure.dao;
\ No newline at end of file
/**
* 持久化对象;XxxPO 最后的 PO 是大写,UserPO
*/
package org.itxzw.infrastructure.dao.po;
\ No newline at end of file
/**
* 定义http、rpc接口,调用外部。在 adapter 中调用这部分内容。
*/
package org.itxzw.infrastructure.gateway;
\ No newline at end of file
/**
* 提供redis链接配置
*/
package org.itxzw.infrastructure.redis;
\ No newline at end of file
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-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>org.itxzw</groupId>
<artifactId>big-market-types</artifactId>
</dependency>
<dependency>
<groupId>org.itxzw</groupId>
<artifactId>big-market-domain</artifactId>
</dependency>
</dependencies>
<build>
<finalName>big-market-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>
/**
* HTTP 接口服务
*/
package org.itxzw.trigger.http;
\ No newline at end of file
/**
* 任务服务,可以选择使用 Spring 默认提供的 Schedule https://bugstack.cn/md/road-map/quartz.html
*/
package org.itxzw.trigger.job;
\ No newline at end of file
/**
* 监听服务;在单体服务中,解耦流程。类似MQ的使用,如Spring的Event,Guava的事件总线都可以。如果使用了 Redis 那么也可以有发布/订阅使用。
* Guava:https://bugstack.cn/md/road-map/guava.html
*/
package org.itxzw.trigger.listener;
\ No newline at end of file
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>big-market-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>big-market-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>
package org.itxzw.types.common;
public class Constants {
public final static String SPLIT = ",";
}
package org.itxzw.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;
}
package org.itxzw.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 "org.itxzw.x.api.types.exception.XApiException{" +
"code='" + code + '\'' +
", info='" + info + '\'' +
'}';
}
}
24-08-03.11:28:50.103 [main ] WARN ClassPathMapperScanner - No MyBatis mapper was found in '[org.itxzw]' package. Please check your configuration.
24-08-03.11:28:49.610 [main ] INFO Application - Starting Application using Java 1.8.0_131 on zhiwen-xiong-hz with PID 10712 (D:\Code\Java\xiangmu\dayingxiao\xfg-frame-archetype-lite\big-market\big-market-app\target\classes started by a1829 in D:\Code\Java\xiangmu\dayingxiao\xfg-frame-archetype-lite\big-market)
24-08-03.11:28:49.612 [main ] INFO Application - The following 1 profile is active: "dev"
24-08-03.11:28:50.103 [main ] WARN ClassPathMapperScanner - No MyBatis mapper was found in '[org.itxzw]' package. Please check your configuration.
24-08-03.11:28:50.362 [main ] INFO TomcatWebServer - Tomcat initialized with port(s): 8091 (http)
24-08-03.11:28:50.369 [main ] INFO Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8091"]
24-08-03.11:28:50.369 [main ] INFO StandardService - Starting service [Tomcat]
24-08-03.11:28:50.369 [main ] INFO StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.75]
24-08-03.11:28:50.555 [main ] INFO [/] - Initializing Spring embedded WebApplicationContext
24-08-03.11:28:50.556 [main ] INFO ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 915 ms
24-08-03.11:28:50.950 [main ] INFO Http11NioProtocol - Starting ProtocolHandler ["http-nio-8091"]
24-08-03.11:28:50.966 [main ] INFO TomcatWebServer - Tomcat started on port(s): 8091 (http) with context path ''
24-08-03.11:28:50.972 [main ] INFO Application - Started Application in 1.788 seconds (JVM running for 2.674)
CONTAINER_NAME=big-market
IMAGE_NAME=system/big-market:1.0-SNAPSHOT
PORT=8091
echo "容器部署开始 ${CONTAINER_NAME}"
# 停止容器
docker stop ${CONTAINER_NAME}
# 删除容器
docker rm ${CONTAINER_NAME}
# 启动容器
docker run --name ${CONTAINER_NAME} \
-p ${PORT}:${PORT} \
-d ${IMAGE_NAME}
echo "容器部署成功 ${CONTAINER_NAME}"
docker logs -f ${CONTAINER_NAME}
\ No newline at end of file
docker stop big-market
\ No newline at end of file
# /usr/local/bin/docker-compose -f /docs/dev-ops/environment/environment-docker-compose-2.4.yml up -d
version: '3.8'
# docker-compose -f docker-compose-app.yml up -d
# 你需要修改system为你自身系统的仓库名
services:
big-market:
image: system/big-market:1.0-SNAPSHOT
container_name: big-market
restart: on-failure
ports:
- "8091:8091"
environment:
- TZ=PRC
- SERVER_PORT=8091
volumes:
- ./log:/data/log
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
\ No newline at end of file
# 命令执行 docker-compose -f docker-compose-environment.yml up -d
version: '3.9'
services:
mysql:
image: mysql:8.0.32
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
networks:
- my-network
depends_on:
- mysql-job-dbdata
ports:
- "13306:3306"
volumes:
- ./mysql/sql:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
volumes_from:
- mysql-job-dbdata
# 自动加载数据
mysql-job-dbdata:
image: alpine:3.18.2
container_name: mysql-job-dbdata
volumes:
- /var/lib/mysql
# phpmyadmin https://hub.docker.com/_/phpmyadmin
phpmyadmin:
image: phpmyadmin:5.2.1
container_name: phpmyadmin
hostname: phpmyadmin
ports:
- 8899:80
environment:
- PMA_HOST=mysql
- PMA_PORT=3306
- MYSQL_ROOT_PASSWORD=123456
depends_on:
mysql:
condition: service_healthy
networks:
- my-network
# Redis
redis:
image: redis:6.2
container_name: redis
restart: always
hostname: redis
privileged: true
ports:
- 16379:6379
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- my-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
# RedisAdmin https://github.com/joeferner/redis-commander
redis-admin:
image: spryker/redis-commander:0.8.0
container_name: redis-admin
hostname: redis-commander
restart: always
ports:
- 8081:8081
environment:
- REDIS_HOSTS=local:redis:6379
- HTTP_USER=admin
- HTTP_PASSWORD=admin
- LANG=C.UTF-8
- LANGUAGE=C.UTF-8
- LC_ALL=C.UTF-8
networks:
- my-network
depends_on:
redis:
condition: service_healthy
networks:
my-network:
driver: bridge
\ No newline at end of file
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50639
Source Host : localhost:3306
Source Schema : road-map
Target Server Type : MySQL
Target Server Version : 50639
File Encoding : 65001
Date: 15/07/2023 09:26:39
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
CREATE database if NOT EXISTS `xfg_frame_archetype` default character set utf8mb4 collate utf8mb4_0900_ai_ci;
use `xfg_frame_archetype`;
-- ----------------------------
-- Table structure for employee
-- ----------------------------
DROP TABLE IF EXISTS `employee`;
CREATE TABLE `employee` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员ID',
`employee_name` varchar(32) NOT NULL DEFAULT '' COMMENT '雇员姓名',
`employee_level` varchar(8) NOT NULL DEFAULT '' COMMENT '雇员级别',
`employee_title` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员岗位Title',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_employee_number` (`employee_number`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee
-- ----------------------------
BEGIN;
INSERT INTO `employee` VALUES (1, '10000001', 'sXvfDpsWnJdLsCVk64tJgw==', 'T-3', '中级工程师', '2023-07-14 15:26:26', '2023-07-14 15:26:26');
INSERT INTO `employee` VALUES (2, '10000010', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (3, '10000011', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (4, '10000012', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (5, '10000013', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (6, '10000014', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (9, '10000002', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-15 07:42:52', '2023-07-15 07:42:52');
INSERT INTO `employee` VALUES (22, '10000015', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (23, '10000016', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (24, '10000017', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (39, '10000022', 'GyG+V0r6mBCNsdusuKl03g==', 'T1', '实习工程师', '2023-07-15 09:17:49', '2023-07-15 09:17:49');
COMMIT;
-- ----------------------------
-- Table structure for employee_salary
-- ----------------------------
DROP TABLE IF EXISTS `employee_salary`;
CREATE TABLE `employee_salary` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号',
`salary_total_amount` decimal(8,2) NOT NULL COMMENT '薪资总额',
`salary_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效工资',
`salary_base_amount` decimal(8,2) NOT NULL COMMENT '基础工资',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_employee_number` (`employee_number`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee_salary
-- ----------------------------
BEGIN;
INSERT INTO `employee_salary` VALUES (1, '10000001', 5100.00, 1020.00, 4080.00, '2023-07-14 16:09:06', '2023-07-14 16:09:06');
INSERT INTO `employee_salary` VALUES (2, '10000010', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (3, '10000011', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (4, '10000012', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (5, '10000013', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (6, '10000014', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (8, '10000022', 100.00, 10.00, 90.00, '2023-07-15 09:17:49', '2023-07-15 09:17:49');
COMMIT;
-- ----------------------------
-- Table structure for employee_salary_adjust
-- ----------------------------
DROP TABLE IF EXISTS `employee_salary_adjust`;
CREATE TABLE `employee_salary_adjust` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号',
`adjust_order_id` varchar(32) NOT NULL DEFAULT '' COMMENT '调薪单号',
`adjust_total_amount` decimal(8,2) NOT NULL COMMENT '总额调薪',
`adjust_base_amount` decimal(8,2) NOT NULL COMMENT '基础调薪',
`adjust_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效调薪',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_order_id` (`adjust_order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee_salary_adjust
-- ----------------------------
BEGIN;
INSERT INTO `employee_salary_adjust` VALUES (1, '10000001', '109089990198888811', 1000.00, 800.00, 200.00, '2023-07-14 16:55:53', '2023-07-14 16:55:53');
INSERT INTO `employee_salary_adjust` VALUES (2, '10000001', '100908977676001', 100.00, 20.00, 80.00, '2023-07-14 21:57:39', '2023-07-14 21:57:39');
COMMIT;
\ No newline at end of file
<?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>org.itxzw</groupId>
<artifactId>big-market</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>big-market-api</module>
<module>big-market-app</module>
<module>big-market-domain</module>
<module>big-market-trigger</module>
<module>big-market-infrastructure</module>
<module>big-market-types</module>
</modules>
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>nexus-aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<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>org.itxzw</groupId>
<artifactId>big-market-domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.itxzw</groupId>
<artifactId>big-market-infrastructure</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.itxzw</groupId>
<artifactId>big-market-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.itxzw</groupId>
<artifactId>big-market-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/big-market-boot -Xloggc:/export/Logs/big-market-boot/gc-big-market-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/big-market-boot -Xloggc:/export/Logs/big-market-boot/gc-big-market-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/big-market-boot/gc-big-market-boot.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps</java_jvm>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
</project>
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
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
# xfg-frame-archetype - DDD 脚手架
CONTAINER_NAME=untitled
IMAGE_NAME=system/untitled:1.0-SNAPSHOT
PORT=8091
echo "容器部署开始 ${CONTAINER_NAME}"
# 停止容器
docker stop ${CONTAINER_NAME}
# 删除容器
docker rm ${CONTAINER_NAME}
# 启动容器
docker run --name ${CONTAINER_NAME} \
-p ${PORT}:${PORT} \
-d ${IMAGE_NAME}
echo "容器部署成功 ${CONTAINER_NAME}"
docker logs -f ${CONTAINER_NAME}
\ No newline at end of file
docker stop untitled
\ No newline at end of file
# /usr/local/bin/docker-compose -f /docs/dev-ops/environment/environment-docker-compose-2.4.yml up -d
version: '3.8'
# docker-compose -f docker-compose-app.yml up -d
# 你需要修改system为你自身系统的仓库名
services:
untitled:
image: system/untitled:1.0-SNAPSHOT
container_name: untitled
restart: on-failure
ports:
- "8091:8091"
environment:
- TZ=PRC
- SERVER_PORT=8091
volumes:
- ./log:/data/log
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
\ No newline at end of file
# 命令执行 docker-compose -f docker-compose-environment.yml up -d
version: '3.9'
services:
mysql:
image: mysql:8.0.32
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
networks:
- my-network
depends_on:
- mysql-job-dbdata
ports:
- "13306:3306"
volumes:
- ./mysql/sql:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 10
start_period: 15s
volumes_from:
- mysql-job-dbdata
# 自动加载数据
mysql-job-dbdata:
image: alpine:3.18.2
container_name: mysql-job-dbdata
volumes:
- /var/lib/mysql
# phpmyadmin https://hub.docker.com/_/phpmyadmin
phpmyadmin:
image: phpmyadmin:5.2.1
container_name: phpmyadmin
hostname: phpmyadmin
ports:
- 8899:80
environment:
- PMA_HOST=mysql
- PMA_PORT=3306
- MYSQL_ROOT_PASSWORD=123456
depends_on:
mysql:
condition: service_healthy
networks:
- my-network
# Redis
redis:
image: redis:6.2
container_name: redis
restart: always
hostname: redis
privileged: true
ports:
- 16379:6379
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- my-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
# RedisAdmin https://github.com/joeferner/redis-commander
redis-admin:
image: spryker/redis-commander:0.8.0
container_name: redis-admin
hostname: redis-commander
restart: always
ports:
- 8081:8081
environment:
- REDIS_HOSTS=local:redis:6379
- HTTP_USER=admin
- HTTP_PASSWORD=admin
- LANG=C.UTF-8
- LANGUAGE=C.UTF-8
- LC_ALL=C.UTF-8
networks:
- my-network
depends_on:
redis:
condition: service_healthy
networks:
my-network:
driver: bridge
\ No newline at end of file
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50639
Source Host : localhost:3306
Source Schema : road-map
Target Server Type : MySQL
Target Server Version : 50639
File Encoding : 65001
Date: 15/07/2023 09:26:39
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
CREATE database if NOT EXISTS `xfg_frame_archetype` default character set utf8mb4 collate utf8mb4_0900_ai_ci;
use `xfg_frame_archetype`;
-- ----------------------------
-- Table structure for employee
-- ----------------------------
DROP TABLE IF EXISTS `employee`;
CREATE TABLE `employee` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员ID',
`employee_name` varchar(32) NOT NULL DEFAULT '' COMMENT '雇员姓名',
`employee_level` varchar(8) NOT NULL DEFAULT '' COMMENT '雇员级别',
`employee_title` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员岗位Title',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_employee_number` (`employee_number`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee
-- ----------------------------
BEGIN;
INSERT INTO `employee` VALUES (1, '10000001', 'sXvfDpsWnJdLsCVk64tJgw==', 'T-3', '中级工程师', '2023-07-14 15:26:26', '2023-07-14 15:26:26');
INSERT INTO `employee` VALUES (2, '10000010', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (3, '10000011', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (4, '10000012', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (5, '10000013', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (6, '10000014', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40');
INSERT INTO `employee` VALUES (9, '10000002', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-15 07:42:52', '2023-07-15 07:42:52');
INSERT INTO `employee` VALUES (22, '10000015', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (23, '10000016', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (24, '10000017', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31');
INSERT INTO `employee` VALUES (39, '10000022', 'GyG+V0r6mBCNsdusuKl03g==', 'T1', '实习工程师', '2023-07-15 09:17:49', '2023-07-15 09:17:49');
COMMIT;
-- ----------------------------
-- Table structure for employee_salary
-- ----------------------------
DROP TABLE IF EXISTS `employee_salary`;
CREATE TABLE `employee_salary` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号',
`salary_total_amount` decimal(8,2) NOT NULL COMMENT '薪资总额',
`salary_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效工资',
`salary_base_amount` decimal(8,2) NOT NULL COMMENT '基础工资',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_employee_number` (`employee_number`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee_salary
-- ----------------------------
BEGIN;
INSERT INTO `employee_salary` VALUES (1, '10000001', 5100.00, 1020.00, 4080.00, '2023-07-14 16:09:06', '2023-07-14 16:09:06');
INSERT INTO `employee_salary` VALUES (2, '10000010', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (3, '10000011', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (4, '10000012', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (5, '10000013', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (6, '10000014', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10');
INSERT INTO `employee_salary` VALUES (8, '10000022', 100.00, 10.00, 90.00, '2023-07-15 09:17:49', '2023-07-15 09:17:49');
COMMIT;
-- ----------------------------
-- Table structure for employee_salary_adjust
-- ----------------------------
DROP TABLE IF EXISTS `employee_salary_adjust`;
CREATE TABLE `employee_salary_adjust` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号',
`adjust_order_id` varchar(32) NOT NULL DEFAULT '' COMMENT '调薪单号',
`adjust_total_amount` decimal(8,2) NOT NULL COMMENT '总额调薪',
`adjust_base_amount` decimal(8,2) NOT NULL COMMENT '基础调薪',
`adjust_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效调薪',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_order_id` (`adjust_order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of employee_salary_adjust
-- ----------------------------
BEGIN;
INSERT INTO `employee_salary_adjust` VALUES (1, '10000001', '109089990198888811', 1000.00, 800.00, 200.00, '2023-07-14 16:55:53', '2023-07-14 16:55:53');
INSERT INTO `employee_salary_adjust` VALUES (2, '10000001', '100908977676001', 100.00, 20.00, 80.00, '2023-07-14 21:57:39', '2023-07-14 21:57:39');
COMMIT;
\ No newline at end of file
<?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>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>untitled-api</module>
<module>untitled-app</module>
<module>untitled-domain</module>
<module>untitled-trigger</module>
<module>untitled-infrastructure</module>
<module>untitled-types</module>
</modules>
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>nexus-aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<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>org.example</groupId>
<artifactId>untitled-domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>untitled-infrastructure</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>untitled-types</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>untitled-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/untitled-boot -Xloggc:/export/Logs/untitled-boot/gc-untitled-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/untitled-boot -Xloggc:/export/Logs/untitled-boot/gc-untitled-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/untitled-boot/gc-untitled-boot.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps</java_jvm>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
</project>
<?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>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>untitled-api</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
/**
* 数据传输对象 xxxRequestDTO xxxResponseDTO
*/
package org.example.api.dto;
\ No newline at end of file
/**
* 定义api接口
*/
package org.example.api;
\ No newline at end of file
package org.example.api.response;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Response<T> implements Serializable {
private static final long serialVersionUID = 7000723935764546321L;
private String code;
private String info;
private T data;
}
# 基础镜像
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/untitled-app.jar /untitled-app.jar
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /untitled-app.jar $PARAMS"]
\ No newline at end of file
# 普通镜像构建,随系统版本构建 amd/arm
docker build -t system/untitled-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
<?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>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>untitled-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>org.example</groupId>
<artifactId>untitled-trigger</artifactId>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>untitled-infrastructure</artifactId>
</dependency>
</dependencies>
<build>
<finalName>untitled-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>org.example.Application</mainClass>
<layout>JAR</layout>
</configuration>
</plugin>
</plugins>
</build>
</project>
package org.example;
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);
}
}
package org.example.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();
}
}
package org.example.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);
}
}
package org.example.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";
}
/**
* 1. 用于管理引入的Jar所需的资源启动或者初始化处理
* 2. 如果有AOP切面,可以再建一个aop包,来写切面逻辑
*/
package org.example.config;
/**
* 应用启动层,注意Application所在的包路径,是在上一层。这样才能扫描到其他 module
* */
package org.example;
\ No newline at end of file
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 配置【如需使用记得打开】
#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
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
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
spring:
config:
name: untitled-app
profiles:
active: dev
<?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
<?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
<?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="org.example.infrastructure.persistent.dao.Xxx">
<resultMap id="CaseMap" type="org.example.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="org.example.infrastructure.persistent.po.A">
INSERT INTO table(a,b,c) VALUES(#{a}, #{b}, #{c})
</insert>
<update id="update" parameterType="org.example.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>
package org.example.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("测试完成");
}
}
<?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>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>untitled-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>org.example</groupId>
<artifactId>untitled-types</artifactId>
</dependency>
</dependencies>
<build>
<finalName>untitled-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>
/**
* 外部接口适配器层;当需要调用外部接口时,则创建出这一层,并定义接口,之后由基础设施层的 adapter 层具体实现
*/
package org.example.domain.xxx.adapter;
\ No newline at end of file
/**
* 外部接口适配器层;当需要调用外部接口时,则创建出这一层,并定义接口,之后由基础设施层的 adapter 层具体实现
*/
package org.example.domain.xxx.adapter.port;
\ No newline at end of file
/**
* 仓储服务
* 1. 定义仓储接口,之后由基础设施层做具体实现
*/
package org.example.domain.xxx.adapter.repository;
\ No newline at end of file
/**
* 聚合对象;
* 1. 聚合实体和值对象
* 2. 聚合是聚合的对象,和提供基础处理对象的方法。但不建议在聚合中引入仓储和接口来做过大的逻辑。而这些复杂的操作应该放到service中处理
* 3. 对象名称 XxxAggregate
*/
package org.example.domain.xxx.model.aggregate;
\ No newline at end of file
/**
* 实体对象;
* 1. 一般和数据库持久化对象1v1的关系,但因各自开发系统的不同,也有1vn的可能。
* 2. 如果是老系统改造,那么旧的库表冗余了太多的字段,可能会有nv1的情况
* 3. 对象名称 XxxEntity
*/
package org.example.domain.xxx.model.entity;
\ No newline at end of file
/**
* 值对象;
* 1. 用于描述对象属性的值,如一个库表中有json后者一个字段多个属性信息的枚举对象
* 2. 对象名称如;XxxVO
*/
package org.example.domain.xxx.model.valobj;
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册