简介
源码地址
https://gitee.com/zhanghongbin/zebra
dev 分支为开发分支不稳定
环境说明
下方为本项目后端所需运行环境,请注意检查您的环境是否与本项目所需一致,以减少环境引起的问题。
运行环境 | 最低版本 |
---|---|
JDK(openjdk,LibericaJDK) | 11 |
Maven | 3.9.4 |
最新稳定版
工程结构
zebra 工程为多级 module 组成:
. zebra
├──zebra-dependencies 为所有库依赖配置-父模块
├──zebra-magic-api-starter magic-api 增强
├──zebra-spring-boot starter父模块
├──zebra-spring-boot-starter-web web核心增强模块提供全局异常处理及响应封装和多种类型注解等
├──zebra-spring-boot-starter-mybatis-plus mybatis plus 增强并整合了mybatis-plus-join和stream-query第三方框架
├──zebra-spring-boot-starter-logging 行为日志,系统日志规范化及sentry日志平台的整合
├──zebra-spring-boot-starter-monitoring 服务监控整合admin,koTime等
├──zebra-spring-boot-starter-cache 基于jetcache缓存,并采用msgpack序列化
├──zebra-spring-boot-starter-redisson 基于redisson封装和扩展
├──zebra-spring-boot-starter-satoken satoken中redis 采用msgpack序列化
├──zebra-spring-boot-starter-bean-searcher 简化复杂查询
├──zebra-spring-boot-starter-tenant 多租户
├──zebra-spring-boot-starter-captcha 验证码(包括图片,短信和邮件)
├──zebra-spring-boot-starter-file excel 导入导出,文件格式转换等
├──zebra-spring-boot-starter-message 基于sms4j进行封装,发送短信,邮件及钉钉等消息
├──zebra-spring-boot-starter-trans 字典翻译
├──zebra-spring-boot-starter-i18n 国际化
├──zebra-spring-boot-starter-cdc 数据同步
├──zebra-common 基础库公共父模块
├── zebra-common-rpc-apt 自动生成feign,forest,dubbo rpc接口模块
├── zebra-common-util 公共模块
├──zebra-tool 工具父模块
├── zebra-sonarqube-plugin sonarqube插件
├── zebra-generator-maven-plugin 代码生成工具
第三方及依赖库
名称 | 版本 | 用途 | 描述 |
---|---|---|---|
springboot | 2.7.18 | 使用 | |
mybatis-plus | 3.5.5 | 使用 | |
knife4j-openapi2-spring-boot-starter | 4.5.0 | 使用 | 接口文档 |
lombok | 1.18.30 | 使用 | |
druid-spring-boot-starter | 1.2.22 | 使用 | |
hutool | 5.8.24 | 使用 | |
flyway | 8.5.13 | 声明 | 数据库版本控制->参见 Java开发须知规约手册中 13.数据库规约 |
Forest | 1.5.35 | 声明 | 文档参见 网址 |
openfeign | 3.1.8 | 声明 | |
dubbo | 2.7.23 | 声明 | |
jetcache | 2.7.4 | 声明 | 文档参见 网址 |
postgresql | 42.2.18 | 声明 | |
mybatis-plus-join | 1.4.11 | 使用 | 文档参见 [网址](https://gitee.com/mhb0409/mybatis-plus-join |
stream-plugin-mybatis-plus | 2.0.3 | 使用 | 文档参见 [网址](https://gitee.com/dromara/stream-query#https://gitee.com/link?target=http%3A%2F%2Fstream-query.dromara.org |
javapoet | 1.13.0 | 使用 | 是开源Java代码生成框架, 能够提供Java生成源代码文件文件的能力, 通过这种自动化生成代码的方式, 可以让我们用更加简洁优雅的方式要替代繁琐冗杂的重复工作 |
auto-service | 1.1.1 | 使用 | google为注解处理器提供的注解,其作用是编译时在classpath下生成注解处理器的描述文件 |
freemarker | 2.3.32 | 使用 | 模板框架 |
javaparser-symbol-solver-core | 3.25.6 | 使用 | 提供了一个易于使用的 API,可以在几行代码中快速分析和处理 Java 代码。它可以将 Java 代码解析为 AST,然后开发人员可以使用 API 来遍历 AST,并对其进行修改和重用 |
guava | 28.0-jre | 依赖 | |
commons-pool2 | 2.12.0 | 声明 | |
sentry | 7.3.0 | 使用 | |
snakeyaml | 1.30 | 使用 | |
velocity | 2.3 | 使用 | |
maven-plugin-annotations | 3.6.1 | 使用 | |
janino | 3.1.12 | 依赖 | janino是一个轻量级的Java编译器 |
mapstruct-plus | 1.3.6 | 使用 | Mapstruct Plus 是 Mapstruct 的增强工具,在 Mapstruct 的基础上,实现了自动生成 文档参见 [网址] https://www.mapstruct.plus/ |
joda-time | 2.12.7 | 声明 | 时间库 |
javers-core | 7.4.1 | 声明 | 比较两个对象之间差异 |
tlog | 1.5.1 | 使用 | 日志跟踪框架 |
fastjson | 2.0.46 | 依赖 | |
caffeine | 3.1.8 | 依赖 | |
commons-io | 2.15.0 | 声明 | |
commons-lang3 | 3.12.0 | 依赖 | |
commons-lang | 2.6 | 依赖 | |
commons-beanutils | 1.9.4 | 依赖 | |
lock4j | 2.2.7 | 声明 | 分布式锁 文档参见 [网址] https://gitee.com/baomidou/lock4j |
transmittable-thread-local | 2.14.4 | 使用 | |
bcprov-jdk15on | 1.70 | 使用 | |
mysql | 8.0.33 | 声明 | |
sensitive-word | 0.15.0 | 声明 | 敏感词工具 |
jdframe | 0.0.2 | 声明 | 语意化和简化java8的stream流式处理工具 [网址] https://github.com/burukeYou/JDFrame |
vavr | 0.10.4 | 声明 | 函数编程语法库 |
ip2region | 2.7.0 | 声明 | ip 地址库 |
word-checker | 1.1.0 | 声明 | 单词拼写检查。支持英文单词拼写检测,和中文拼写检测 |
pinyin | 0.4.0 | 声明 | 拼音转汉字 |
fast-retry-all | 0.0.2 | 声明 | 重试框架 |
sa-token-spring-boot-starter | 1.38.0 | 使用 | |
sa-token-jwt | 1.38.0 | 使用 | |
x-file-storage-spring | 2.1.0 | 使用 | |
sms4j-spring-boot-starter | 3.2.1 | 使用 | 短信,邮件等 |
disruptor-spring-boot-starter | 2.7.x.20240823.RELEASE | 声明 | LMAX 开发的高性能队列框架 |
yitter | 1.0.6 | 声明 | 雪花id库 |
easyexcel | 4.0.1 | 使用 | excel库 |
deepoove | 1.12.2 | 使用 | word模版库 |
thumbnailator | 0.4.20 | 声明 | 图片库 |
eclipse-collections | 12.0.0.M3 | 声明 | 集合库 |
eclipse-collections-api | 12.0.0.M3 | 声明 | 集合库 |
spring-plugin-core | 2.0.0.RELEASE | 声明 | 插件开发 |
快速开始
通过arthetype生成项目骨架,有以下两种方式生成:
- cmd命令方式,打开shell输入以下命令
把 -DgroupId , -DartifactId 和 -Dversion 换成自己需要的。注:maven settings.xml 最好配置好阿里云镜像加快下载速度
shell
mvn archetype:generate -DgroupId=xxx.xx.x -DartifactId=x-x-x -Dversion=1.0.0-SNAPSHOT -DarchetypeGroupId=io.github.zhanghongbin -DarchetypeArtifactId=zebra-archetype-service-single -DarchetypeVersion=1.0.4
2 通过开发工具idea方式
注:idea默认使用的是用户目录下.m2里的settings.xml文件,最好把自己的配置好的settings.xml进行覆盖加快下载速度
如图按步骤进行填写 最后生成项目模板如下:
pom 已经配置好相关依赖
项目规范参见技术规范中的->java项目规范
项目启动方式和springboot一致,具体每个功能的使用方式参见->框架文档