# springboot-master **Repository Path**: haoliangjun/springboot-master ## Basic Information - **Project Name**: springboot-master - **Description**: 基于springboot集成常用框架的demo - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 35 - **Forks**: 19 - **Created**: 2024-01-10 - **Last Updated**: 2026-03-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [toc] # 简介 基于springboot框架实现一些常用的功能 # 环境 环境 | 版本 ---- | ---- JKD |1.8 Spring Boot | 2.3.0.RELEASE 项目 | 描述 ---- | --- 01_helloword| [springboot入门项目,实现了简单的web服务功能](https://blog.csdn.net/ming19951224/article/details/106159309) 02_thymeleaf | [整合thymeleaf模板引擎,在页面渲染后台数据](https://blog.csdn.net/ming19951224/article/details/106160322) 03_simplifycode| [简化一些繁琐的配置](https://blog.csdn.net/ming19951224/article/details/106173840) 04_jta_atomikos | [实现分布式事务](https://blog.csdn.net/ming19951224/article/details/105753333) 05_distributed_lock | [分布式锁的三种实现方式](https://blog.csdn.net/ming19951224/article/details/106205332) 06_docker_build | [使用dockerfile编排springboot项目](https://blog.csdn.net/ming19951224/article/details/105923548) 07_release_build | [服务发布到生产环境流程](https://blog.csdn.net/ming19951224/article/details/106212271) 08_my_spring_boot_starter_parent | [编写自己的spring-boot-start](https://blog.csdn.net/ming19951224/article/details/106224172) 09_dobbo_parent | [整合dobbo实现简单的RPC服务调用](https://blog.csdn.net/ming19951224/article/details/106225928) 10_api_limit | [对API接口限流](https://blog.csdn.net/ming19951224/article/details/106227451) 11_spring_data_jpa | [实现了常用的数据库CRUD操作](https://blog.csdn.net/ming19951224/article/details/106308544) 12_druid_monitor | [Druid Monitor不仅可以监控数据源和慢查询,还可以监控Web应用、URI监控、Session监控、Spring监控](https://blog.csdn.net/ming19951224/article/details/106317893) 13_spring_boot_admin | [使用springboot admin对springboot应用进行监控](https://blog.csdn.net/ming19951224/article/details/107138845) 14_mybatis_plus | [mybatis-plus实战](https://blog.csdn.net/ming19951224/article/details/107145780) 15_shiro | [使用shiro对web应用进行权限认证](https://blog.csdn.net/ming19951224/article/details/107192585) 16_security_jwt | [security整合jwt实现对前后端分离的项目进行权限认证](https://blog.csdn.net/ming19951224/article/details/107733689) 17_swagger | [使用swagger2生成RESTful风格的接口文档](https://blog.csdn.net/ming19951224/article/details/107741541) 18_netty-websocket | [使用Netty加websocket实现在线聊天功能](https://blog.csdn.net/ming19951224/article/details/108555917) 19_redis_session | [使用spring-session加redis来实现session共享](https://blog.csdn.net/ming19951224/article/details/112758560) 20_config_switch | [自定义@Configuration配置类启用开关](https://blog.csdn.net/ming19951224/article/details/108555917) 21_webdemo | [对springboot框架编译后的jar文件瘦身](https://blog.csdn.net/ming19951224/article/details/119024251) 22_rocketmq | [ 集成RocketMQ实现消息发布和订阅](https://blog.csdn.net/ming19951224/article/details/119523197) 23_smartdoc | [集成smart-doc插件零侵入自动生成RESTful格式API文档](https://blog.csdn.net/ming19951224/article/details/120824308) 24_fastdfs | [集成FastDFS实现文件的分布式存储](https://blog.csdn.net/ming19951224/article/details/121529384) 25_minio | [集成Minio实现文件的分布式对象存储](https://blog.csdn.net/ming19951224/article/details/121739211) 26_validation | [集成spring-boot-starter-validation对接口参数校验](https://blog.csdn.net/ming19951224/article/details/124782483) 27_email | [集成mail实现邮件推送带网页样式的消息](https://blog.csdn.net/ming19951224/article/details/125016994) 28_jdbctemplate | [使用JdbcTemplate操作数据库](https://blog.csdn.net/ming19951224/article/details/126592129) 29_lowcode | [Jpa+vue实现单模型的低代码平台](https://blog.csdn.net/ming19951224/article/details/126466950) 30_sharding_jdbc | [使用sharding-jdbc实现读写分离和分库分表](https://blog.csdn.net/ming19951224/article/details/126736786) 31_distributed_job | [基于分布式锁或xxx-job实现分布式任务调度](https://blog.csdn.net/ming19951224/article/details/1268883456) 32_repeatsubmit| [基于注解+redis实现表单防重复提交](https://blog.csdn.net/ming19951224/article/details/128410984) 33_i18n | [优雅集成i18n实现国际化信息返回](https://blog.csdn.net/ming19951224/article/details/132183237) 34_retry | [使用Spring Retry完成任务的重试](https://blog.csdn.net/ming19951224/article/details/135373329) 35_kafka | [kafka环境搭建和在收发消息](https://blog.csdn.net/ming19951224/article/details/135634610) 36_tess4j | [36.整合Tess4J搭建提供图片文字识别的Web服务](https://blog.csdn.net/ming19951224/article/details/136611148) 37_grpc | [37.使用gRPC实现远程服务调用](https://dominick-li.blog.csdn.net/article/details/136919922) # 功能分类 ## Web基础 | 模块 | 说明 | |------|------| | 01_helloword | Spring Boot 入门,快速搭建 Web 服务 | | 02_thymeleaf | 服务端模板渲染,整合 Thymeleaf | | 03_simplifycode | 自定义配置简化,减少样板代码 | | 20_config_switch | 自定义 @Configuration 启用开关 | | 21_webdemo | JAR 瘦身优化,减小部署包体积 | | 26_validation | 参数校验,集成 spring-boot-starter-validation | | 33_i18n | 国际化(i18n),多语言消息返回 | ## 安全认证 | 模块 | 说明 | |------|------| | 15_shiro | Apache Shiro 角色与权限控制 | | 16_security_jwt | Spring Security + JWT 前后端分离认证 | | 32_repeatsubmit | 注解 + Redis 防表单重复提交 | ## 数据访问 | 模块 | 说明 | |------|------| | 11_spring_data_jpa | Spring Data JPA 常用 CRUD | | 12_druid_monitor | Druid 数据源监控(SQL/Web/URI/Session) | | 14_mybatis_plus | MyBatis-Plus 实战(CRUD + 代码生成器) | | 28_jdbctemplate | JdbcTemplate 轻量级数据库操作 | | 30_sharding_jdbc | Sharding-JDBC 读写分离与分库分表 | ## 分布式与微服务 | 模块 | 说明 | |------|------| | 04_jta_atomikos | JTA + Atomikos 分布式事务 | | 05_distributed_lock | 分布式锁三种实现(数据库/Redis/ZooKeeper) | | 09_dobbo_parent | Dubbo RPC 服务调用 | | 10_api_limit | API 限流(Guava/Semaphore/Redis) | | 31_distributed_job | 分布式任务调度(Redis 锁 / XXL-Job) | | 37_grpc | gRPC 远程服务调用(Protobuf + Spring Boot) | ## 消息队列 | 模块 | 说明 | |------|------| | 22_rocketmq | RocketMQ 消息发布与订阅 | | 35_kafka | Kafka 消息收发与消费者组 | ## 文件存储 | 模块 | 说明 | |------|------| | 24_fastdfs | FastDFS 分布式文件存储 | | 25_minio | MinIO 对象存储 | ## 实时通信 | 模块 | 说明 | |------|------| | 18_netty_websocket | Netty + WebSocket 在线聊天 | | 19_redis_session | Spring Session + Redis 会话共享 | ## 运维与部署 | 模块 | 说明 | |------|------| | 06_docker_build | Dockerfile 编排 Spring Boot 项目 | | 07_release_build | 生产环境发布流程 | | 08_my_spring_boot_starter_parent | 自定义 Spring Boot Starter | | 13_spring_boot_admin | Spring Boot Admin 应用监控 | ## 工具集成 | 模块 | 说明 | |------|------| | 17_swagger | Swagger / OpenAPI 接口文档生成 | | 23_smartdoc | Smart-doc 零侵入 API 文档 | | 27_email | 邮件推送(支持 HTML 样式) | | 29_lowcode | JPA + Vue 单模型低代码平台 | | 34_retry | Spring Retry 任务重试机制 | | 36_tess4j | Tess4J OCR 图片文字识别 | # 技术栈 | 技术 | 版本 | 说明 | |------|--------|-----| | Spring Boot | 2.3.0 | 主框架 | | JDK | 1.8+ | 最低运行版本 | | Maven | 3.6+ | 构建工具 | | MySQL | 8.0 | 关系型数据库 | | Redis | 6.0+ | 缓存 / 分布式锁 / Session | | MyBatis-Plus | 3.5.2 | ORM 框架 | | Druid | - | 数据库连接池与监控 | | Sharding-JDBC | - | 分库分表中间件 | | Apache Shiro | - | 安全框架 | | Spring Security | - | 安全框架(JWT 模式) | | Kafka | - | 消息队列 | | RocketMQ | - | 消息队列 | | Dubbo | - | RPC 框架 | | gRPC | 1.54.0 | RPC 框架(Protobuf 3.22) | | Netty | - | 网络通信框架 | | MinIO | - | 对象存储 | | FastDFS | - | 分布式文件系统 | | Docker | - | 容器化部署 | # 快速开始 ## 前置条件 - JDK 1.8+ - Maven 3.3+ - MySQL 8.0+(数据访问类模块需要) - Redis 6.0+(缓存/锁/Session 类模块需要) ## 克隆项目 ```bash git clone https://gitee.com/ljm-boot/springboot-master.git cd springboot-master ``` ## 运行单个模块 每个模块都是独立的 Spring Boot 应用,可以单独运行: ```bash # 以 01_helloword 为例 cd 01_helloword mvn spring-boot:run ``` 部分模块需要先修改 `application.yml` 中的数据库、Redis 等连接配置。 ## 编译整个项目 ```bash mvn clean install -DskipTests ``` # 项目结构 ``` springboot-master/ ├── pom.xml # 父 POM(聚合模块) ├── 01_helloword/ # Web 入门 ├── 02_thymeleaf/ # 模板引擎 ├── ... ├── 05_distributed_lock/ # 分布式锁(多子模块) │ ├── database_lock/ │ ├── redis_lock/ │ └── zookeeper_lock/ ├── ... ├── 09_dobbo_parent/ # Dubbo(多子模块) │ ├── dubbo-api/ │ ├── dubbo-provider/ │ └── dubbo-consumer/ ├── ... ├── 37_grpc/ # gRPC(多子模块) │ ├── grpc-api/ │ ├── grpc-server/ │ └── grpc-client/ └── README.md ``` 每个模块遵循标准 Spring Boot 项目结构: ``` 模块名/ ├── pom.xml └── src/main/ ├── java/com/ljm/boot/xxx/ │ ├── XxxApplication.java # 启动类 │ ├── controller/ # 控制层 │ ├── service/ # 业务层 │ ├── model/ # 实体类 │ └── config/ # 配置类 └── resources/ └── application.yml # 应用配置 ``` # 学习路线建议 ``` 入门 → 01 Hello World → 02 Thymeleaf → 03 配置简化 ↓ 数据 → 11 JPA → 14 MyBatis-Plus → 28 JdbcTemplate → 12 Druid 监控 ↓ 安全 → 15 Shiro → 16 Security + JWT → 32 防重复提交 ↓ 分布式 → 05 分布式锁 → 04 分布式事务 → 31 分布式任务 ↓ 消息 → 22 RocketMQ → 35 Kafka ↓ 微服务 → 09 Dubbo → 37 gRPC → 10 API 限流 ↓ 存储 → 24 FastDFS → 25 MinIO ↓ 部署 → 06 Docker → 07 发布流程 → 13 Admin 监控 ``` # 参与贡献 1. Fork 本仓库 2. 创建特性分支 (`git checkout -b feature/xxx`) 3. 提交更改 (`git commit -m 'feat: 添加xxx功能'`) 4. 推送到分支 (`git push origin feature/xxx`) 5. 提交 Pull Request # 许可证 本项目仅供学习交流使用。 # 致谢 每个模块都配有详细的 CSDN 博客教程,点击上方模块表格中的链接即可查看。