# weed-spring-boot **Repository Path**: wangze123321/weed-spring-boot ## Basic Information - **Project Name**: weed-spring-boot - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-24 - **Last Updated**: 2026-03-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Leinao Spring Boot Leinao Spring Boot 致力于提供基于spring-boot一站式解决方案。此项目包含自定义spring-boot组件,方便开发者通过 Spring Boot 编程模型轻松使用这些组件来开发微服务应用服务。 依托 Leinao Spring Boot,您只需要添加一些注解和少量配置,就可以将 Spring Boot 应用接入类脑微服务解决方案,通过类脑中间件来迅速搭建微服务应用系统。 ## Leinao Spring Boot架构的目录结构介绍 ```shell . ├── leinao-spring-boot-dependencies ├── leinao-spring-boot-parent ├── leinao-spring-boot-starters │   ├── leinao-spring-boot-starter-http │   ├── leinao-spring-boot-starter-log │   ├── leinao-spring-boot-starter-mybatis │   ├── leinao-spring-boot-starter-mybatis-plus │   ├── leinao-spring-boot-starter-redis │   ├── leinao-spring-boot-starter-rocketmq │   ├── leinao-spring-boot-starter-swagger │   ├── leinao-spring-boot-starter-initializr │   ├── leinao-spring-boot-starter-xxljob-executor │   ├── leinao-spring-boot-starter-xxljob-admin │   ├── leinao-spring-boot-starter-dynamic-datasource │   ├── leinao-spring-boot-starter-captcha │   ├── leinao-spring-boot-starter-websocket │   ├── leinao-spring-boot-starter-mq │   └── leinao-spring-cloud-starter-web │   └── leinao-spring-cloud-starter-test │   └── leinao-spring-boot-starter-druid-admin │   └── leinao-spring-boot-starter-druid-monitor ├── leinao-spring-boot-examples │   ├── leinao-spring-boot-http-example │   ├── leinao-spring-boot-log-example │   ├── leinao-spring-boot-mybatis-example │   ├── leinao-spring-boot--mybatis-plus-example │   ├── leinao-spring-boot-redis-example │   ├── leinao-spring-boot-rocketmq-example │   ├── leinao-spring-boot-swagger-example │   └── leinao-spring-boot-web-example │   └── leinao-spring-boot-websocket-example │   └── leinao-spring-boot-websocket-dis-example │   └── leinao-spring-boot-initializr-example │   └── leinao-spring-boot-xxljob-executor-example │   └── leinao-spring-boot-xxljob-executor-admin │   └── leinao-spring-boot-dynamic-datasource-example │   └── leinao-spring-boot-captcha-example │   └── leinao-spring-boot-websocket2-example │   ├── leinao-spring-boot-starter-mq-example │   └── leinao-spring-boot-validation-example │   └── leinao-spring-boot-druid-admin-example │   └── leinao-spring-boot-druid-monitor-example ``` - `leinao-spring-boot-dependencies` 定义Leinao Spring Boot架构依赖 - `leinao-spring-boot-parent` 主要负责实现在具体项目中的引用 - `leinao-spring-boot-starters` 负责维护微服务组件starter - `leinao-spring-boot-examples` 负责维护微服务组件starter案例 ## 更新记录 | 时间 | 更新内容 | |------------|--------------------------------------------------------------------| | 2022-02-25 | 1.0.0 初版入库 | | 2022-12-17 | 1.1.0 新增xxl-job admin和executor包 | | 2022-12-28 | 1.1.0 跨域配置key由support.web.cross.enable调整为support.web.cross.enabled | | 2022-12-28 | 1.1.0 日志组件增加Controller含有敏感参数及响应的地址过滤配置 | | 2023-04-28 | 1.1.1 pom构建逻辑调整,改进revision版本占位符替换 | | 2023-04-29 | 1.2.0 升级Spring Boot版本为2.6.11 | | 2023-07-11 | 1.2.1 升级mybatis-plus支持批量插入、更新操作 | | 2023-07-31 | 1.2.2 升级Leinao Framework版本为1.2.2 | | 2023-07-31 | 1.2.3 异常拦截逻辑调整、增加禁止请求传不存在的参数、禁止请求传表情参数 | | 2024-03-13 | 1.2.4 kubernetes-client当前为5.10.2版本非常老,本次升级为6.10.0 | | 2024-03-26 | 1.2.5 新增异常处理,支持异常返回时在response同步返回业务数据 | | 2024-03-26 | 1.2.5 Mybatis和Mybatis-plus新增分页拷贝PageCopyUtil工具类 | | 2024-05-06 | 1.2.6 xxx-job国产化数据库适配 | | 2024-05-20 | 1.2.7 新增数据库数据源动态切换包 | | 2024-06-03 | 1.2.8 新增图片验证码starter | | 2024-06-13 | 1.2.8 新增Json支持自定义特性 | | 2024-06-21 | 1.2.8 新增mq组件 | | 2024-06-21 | 1.2.8 新增websocket组件 | | 2024-11-22 | 1.2.9 Mybatis支持多数据库以及数据库查询Mapper增强 | | 2024-11-22 | 1.2.9 支持脱敏 | | 2025-02-13 | 1.2.10 修复数据库静态切换导致的insertBatchSomeColumn报错问题 | | 2025-02-13 | 1.2.10 Mybatis-plus提供新版本批量插入方法,支持分批插入 | | 2025-02-13 | 1.2.10 新增单元测试组件,以及核心模块补充单元测试 | | 2025-03-18 | 1.2.11 Mybatis-plus新增支持tdengine厂商 | | 2025-06-05 | 1.2.12 新增数据库基础Entity和Dto | | 2025-06-05 | 1.2.12 新增日期序列化配置 | | 2025-06-27 | 1.2.13 新增数据库事务回调工具类 | | 2025-07-08 | 1.2.13 单元测试Mybatis-plus-join插件加载顺序调整-解决连表组件 | | 2025-07-10 | 1.2.13 单元测试Mybatis-plus like匹配关键词重复加载问题修复 | | 2025-09-26 | 1.2.14 新增慢SQL监控功能 | | 2025-12-30 | 1.2.15 xxl-job升级到2.5.0-release | | 2025-12-30 | 1.2.15 spring.boot.rocketmq 2.2.1升级到2.3.0,解决合肥大数据漏洞要求 | | 2025-12-30 | 1.2.15 rocketmq.version 4.8.0升级到5.2.0,解决合肥大数据漏洞要求 | ## 更新列表 | 更新内容 | |----------------------------------------------------------------------------| | 1、新增leinao-spring-boot框架1.0.0版本 | | 2、新增xxl-job-admin定时任务包 | | 3、新增xxl-job-executor定时任务包 | | 4、跨域配置key由support.web.cross.enable调整为support.web.cross.enabled | | 5、日志组件增加Controller含有敏感参数及响应的地址过滤配置 | | 6、pom构建逻辑调整,改进revision版本占位符替换 | | 7、升级Spring Boot版本为2.6.11 | | 8、升级mybatis-plus支持批量插入、更新操作 | | 9、异常拦截逻辑调整、增加禁止请求传不存在的参数、禁止请求传表情参数 | | 10、kubernetes-client当前为5.10.2版本非常老,本次升级为6.10.0 | | 11、新增异常处理,支持异常返回时在response同步返回业务数据 | | 12、Mybatis和Mybatis-plus新增分页拷贝PageCopyUtil工具类 | | 13、xxx-job国产化数据库适配 | | 14、新增数据库数据源动态切换包 | | 15、新增图片验证码starter | | 16、新增Json支持自定义特性 | | 17、新增websocket组件 | | 18、Mybatis支持多数据库 | | 19、支持脱敏 | | 20、修复数据库静态切换导致的insertBatchSomeColumn报错问题 | | 21、Mybatis-plus提供新版本批量插入方法,支持分批插入 | | 22、新增单元测试组件,以及核心模块补充单元测试 | | 23、Mybatis-plus新增支持tdengine厂商 | | 24、新增数据库基础Entity和Dto | | 25、新增日期序列化配置 | | 26、新增数据库事务回调工具类 | | 27、单元测试Mybatis-plus-join插件加载顺序调整-解决连表组件、单元测试Mybatis-plus like匹配关键词重复加载问题修复 | | 28、新增慢SQL监控功能 | | 28、xxl-job升级到2.5.0-release | | 29、spring.boot.rocketmq 2.2.1升级到2.3.0,解决合肥大数据漏洞要求、rocketmq.version 4.8.0升级到5.2.0,解决合肥大数据漏洞要求 | ## 1.0.0 新增1.0.0基础版本,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.1.0 新增1.1.0 xxl-job admin和executor包版本以及部分组件优化,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.1.1 新增1.1.1 pom构建逻辑调整,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.0 SpringBoot版本升级为2.6.11,pagehelper-spring-boot-starter升级为1.4.6,flatten-maven-plugin版本升级为1.2.7,spring-cloud-starter-netflix-hystrix版本没有了,取消引用,如有迁移疑问,请联系 liangbo@leinao.ai ## 1.2.1 mybatis-plus支持批量插入、更新操作,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.2 升级leinao framework版本为1.2.2,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.3 异常拦截逻辑调整、增加禁止请求传不存在的参数、禁止请求传表情参数,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.4 kubernetes-client当前为5.10.2版本非常老,本次升级为6.10.0,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.5 新增异常处理,支持异常返回时在response同步返回业务数据,如有迁移疑问,请联系 qiliang@leinao.ai Mybatis和Mybatis-plus新增分页拷贝PageCopyUtil工具类,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.6 xxx-job国产化数据库适配,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.7 新增数据库数据源动态切换包,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.8 新增图片验证码starter、Json支持自定义特性、websocket starter,mq starter组件,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.9 Mybatis支持多数据库以及数据库查询Mapper增强、支持脱敏,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.10 新增单元测试组件,Mybatis-plus提供新版本批量插入方法,支持分批插入,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.11 Mybatis-plus新增支持tdengine厂商,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.12 新增数据库基础Entity和Dto、新增日期序列化配置,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.13 新增数据库事务回调工具类、单元测试Mybatis-plus-join插件加载顺序调整-解决连表组件、单元测试Mybatis-plus like匹配关键词重复加载问题修复,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.14 新增慢SQL监控功能,如有迁移疑问,请联系 qiliang@leinao.ai ## 1.2.15 xxl-job升级到2.5.0-release、spring.boot.rocketmq 2.2.1升级到2.3.0,解决合肥大数据漏洞要求、rocketmq.version 4.8.0升级到5.2.0,解决合肥大数据漏洞要求,如有迁移疑问,请联系 qiliang@leinao.ai ## Maven配置 参考:[Maven私库配置与使用手册](https://wiki.bitahub.com/pages/viewpage.action?pageId=1148014 "Maven私库配置与使用手册") ## leinao-spring-boot-dependencies主要组件依赖 |依赖 |版本 |leinao版本 | | ------------------------ | ------------------------ | ------------------------ | |Spring Boot | 2.3.8.RELEASE |1.0.x | |Spring Boot | 2.6.11 |1.2.x | ## 主要功能 * **Http增强**:提供RestTemplate增强日志打印功能、提供HttpClient对RestTemplate进行封装,统一使用OkHttp作为客户端。 * **Log日志**:提供Web Controller请求和响应日志打印、提供方法级别日志打印、提供操作记录接口。 * **Redis**:修改RedisTemplate key和value默认序列化方式为string,也可以直接使用StringRedisTemplate,提供分布式锁。 * **Swagger**:提供接口文档能力,建议接口文档在接口文档平台http://doc.bitahub.com/ 维护。 * **Web**:提供跨域和全局异常捕获解析功能、支持脱敏。 * **Mybatis**:提供mybatis包管理。 * **Mybatis Plus**:提供mybatis plus包管理,提供常用查询封装。 * **Initializr**:提供脚手架功能。 * **xxljob-admin**:提供定时任务admin管理端功能。 * **xxljob-executor**:提供定时任务executor执行器功能。 * **dynamic-datasource**:提供新增数据库数据源动态切换功能。 * **captcha**:提供图片验证码功能。 * **mq**:提供MQ功能。 * **websocket**:提供websocket功能。 * **druid monitor**:提供慢SQL监控功能。 ## 组件 **[Http](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-http)**:提供HttpClient对RestTemplate进行封装,统一使用OkHttp作为客户端。 **[Log and Trace](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-log)**:提供web请求、方法参数响应打印功能。 **[Mybatis](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-mybatis)**:提供Mybatis包管理。 **[Mybatis Plus](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-mybatis-plus)**:提供Mybatis Plus包管理。 **[Redis](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-redis)**:提供RedisTemplate重定义以及分布式锁。 **[RocketMQ](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-rocketmq)**:提供消息队列提供生产者和消费者管理。 **[Swagger](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-swagger)**:提供接口文档能力,建议接口文档在接口文档平台:http://doc.bitahub.com/维护。 **[Web](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-web)**:提供Web功能以及跨域以及全局异常管理。 **[Initializr](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-initializr)**:提供提供脚手架功能。 **[Xxljob-Admin](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-xxljob-admin)**:提供定时任务admin管理端功能。 **[Xxljob-Executor](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-xxljob-executor)**:提供定时任务executor执行器功能。 **[Dynamic-Datasource](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-dynamic-datasource)**:提供数据库数据源动态切换功能。 **[Captcha](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-captcha)**:提供图片验证码功能。 **[MQ](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-mq)**:提供MQ功能。 **[Websocket](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-websocket)**:提Websocket功能。 **[Druid-Admin](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-druid-admin)**:提Druid-Admin功能。 **[Druid-Monitor](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-druid-monitor)**:提Druid-Monitor。 **[Test](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-starters/leinao-spring-boot-starter-test)**:提单元测试功能。 ## 如何构建 * master 对应的是最新代码,最低支持 JDK 1.8。 * 1.0.x 分支对应的是 Spring Boot 2.3.8.RELEASE,最低支持 JDK 1.8。 * 1.2.x 分支对应的是Spring Boot 2.6.11,最低支持JDK1.8。 Leinao Spring Boot 使用 Maven 来构建,最快的使用方式是将本项目 clone 到本地,然后执行以下命令: ```bash mvn install ``` 执行完毕后,项目将被安装到本地 Maven 仓库。 java包构建: ```bash mvn clean -U -D maven.test.skip=true install -settings "D:\program files\apache-maven-3.5.4\conf\settings-new-repo_deploy.xml" ``` 开发环境远程仓库推送包,不用指定-P,mvn setting配置文件默认激活的是开发环境,命令构建可能会出现Connection reset,重复几次就好了: ```bash mvn deploy -U -D maven.test.skip=true -settings "D:\program files\apache-maven-3.5.4\conf\settings-new-repo_deploy.xml" ``` 生产环境远程仓库推送包,命令构建可能会出现Connection reset,重复几次就好了: ```bash mvn deploy -U -D maven.test.skip=true -P platform-official -settings "D:\program files\apache-maven-3.5.4\conf\settings-new-repo_deploy.xml" ``` ## 如何使用 ### 如何引入依赖 如果需要使用已发布的版本,在 `parent`或`dependencyManagement` 中添加如下配置。 ```xml com.leinao.boot leinao-spring-boot-parent 1.0.0 ``` ```xml com.leinao.boot leinao-spring-boot-dependencies 1.0.0 pom import ``` 然后在 `dependencies` 中添加自己所需使用的依赖即可使用。 如果使用1.2.0的版本,将version的1.0.0修改为1.2.0即可。 ## 演示 Demo 为了演示如何使用,Leinao Spring Boot 项目包含了一个子模块`leinao-spring-boot-examples`。此模块中提供了演示用的 example ,您可以阅读对应的 example 工程下的 readme 文档,根据里面的步骤来体验。 Example 列表: [Http](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-http-example) [Log and Trace](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-log-example) [Mybatis](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-mybatis-example) [Mybatis Plus](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-mybatis-plus-example) [Redis](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-redis-example) [RocketMQ](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-rocketmq-example) [Swagger](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-swagger-example) [Web](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-web-example) [Validation](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-validation-example) [Websocket](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-websocket-example) [Websocket2](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-websocket2-example) [Websocket-dis](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-websocket-dis-example) [Initializr](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-initializr-example) [Xxljob-Admin](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-xxljob-admin-example) [Xxljob-Executor](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-xxljob-executor-example) [Dynamic-Datasource](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-dynamic-datasource-example) [Captcha](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-captcha-example) [MQ](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-mq-example) [Druid-Admin](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-druid-admin-example) [Druid-Monitor](https://gitlab.bitahub.com/leinao-spring-projects/leinao-spring-boot/tree/master/leinao-spring-boot-examples/leinao-spring-boot-druid-monitor-example) ## 版本管理规范 项目的版本号格式为 x.x.x 的形式,其中 x 的数值类型为数字,从 0 开始取值,且不限于 0~9 这个范围。第一位版本号固定使用 1,即版本号为 1.x.x 的格式。 * 1.0.x 版本适用于 Spring Boot 2.3.8.RELEASE * 1.2.x 版本适用于Spring Boot 2.6.11 ## 架构图 #