Commit afc76973ce2423dffd528b67ad39cbb8cee83cf5
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/1.8.0-uniapp
# Conflicts: # yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponBaseVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponExcelVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponExportReqVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponPageReqVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/coupon/vo/CouponRespVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteBaseVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExcelVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteExportReqVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempletePageReqVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/controller/admin/templete/vo/CouponTempleteRespVO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/CouponTemplete/CouponTempleteDO.java # yudao-module-mall/yudao-module-coupon-biz/src/main/java/cn/iocoder/yudao/module/coupon/dal/dataobject/coupon/CouponDO.java # yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java # yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuRespVO.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/discount/DiscountProductDO.java # yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/reward/RewardActivityDO.java # yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java # yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/TradeCartItemDO.java # yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/dto/UserInfoDTO.java # yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java # yudao-server/pom.xml # yudao-server/src/main/resources/application-local.yaml # yudao-server/src/main/resources/application.yaml # yudao-ui-admin/src/views/mall/CouponTemplete/index.vue # yudao-ui-admin/src/views/mall/product/property/index.vue # yudao-ui-admin/src/views/mall/product/spu/index.vue # yudao-ui-admin/src/views/mall/product/spu/save.vue # yudao-ui-admin/src/views/system/role/index.vue
Showing
744 changed files
with
30729 additions
and
21310 deletions
Too many changes.
To preserve performance only 100 of 744 files are displayed.
README.md
| @@ -44,6 +44,18 @@ | @@ -44,6 +44,18 @@ | ||
| 44 | | `yudao-cloud` | Spring Cloud 微服务 | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)** [Github](https://github.com/YunaiV/yudao-cloud) | | 44 | | `yudao-cloud` | Spring Cloud 微服务 | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)** [Github](https://github.com/YunaiV/yudao-cloud) | |
| 45 | | `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)** [Github](https://github.com/YunaiV/SpringBoot-Labs) | | 45 | | `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)** [Github](https://github.com/YunaiV/SpringBoot-Labs) | |
| 46 | 46 | ||
| 47 | +## 😎 开源协议 | ||
| 48 | + | ||
| 49 | +**为什么推荐使用本项目?** | ||
| 50 | + | ||
| 51 | +① 本项目采用比 Apache 2.0 更宽松的 [MIT License](https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE) 开源协议,个人与企业可 100% 免费使用,不用保留类作者、Copyright 信息。 | ||
| 52 | + | ||
| 53 | +② 代码全部开源,不会像其他项目一样,只开源部分代码,让你无法了解整个项目的架构设计。[国产开源项目对比](https://www.yuque.com/xiatian-bsgny/lm0ec1/wqf8mn) | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + | ||
| 57 | +③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,57000 行 Java 代码,22000 行代码注释。 | ||
| 58 | + | ||
| 47 | ## 🐼 内置功能 | 59 | ## 🐼 内置功能 |
| 48 | 60 | ||
| 49 | 系统内置多种多种业务功能,可以用于快速你的业务系统: | 61 | 系统内置多种多种业务功能,可以用于快速你的业务系统: |
| @@ -174,44 +186,44 @@ ps:核心功能已经实现,正在对接微信小程序中... | @@ -174,44 +186,44 @@ ps:核心功能已经实现,正在对接微信小程序中... | ||
| 174 | 186 | ||
| 175 | ### 后端 | 187 | ### 后端 |
| 176 | 188 | ||
| 177 | -| 框架 | 说明 | 版本 | 学习指南 | | ||
| 178 | -|---------------------------------------------------------------------------------------------|-----------------------|------------------|----------------------------------------------------------------| | ||
| 179 | -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | ||
| 180 | -| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | | ||
| 181 | -| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.13-SNSAPSHOT | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | ||
| 182 | -| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | ||
| 183 | -| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | ||
| 184 | -| [Redis](https://redis.io/) | key-value 数据库 | 5.0 | | | ||
| 185 | -| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.7 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | | ||
| 186 | -| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.20 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | | ||
| 187 | -| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.5 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | | ||
| 188 | -| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | ||
| 189 | -| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) | | ||
| 190 | -| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | | ||
| 191 | -| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | | ||
| 192 | -| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | ||
| 193 | -| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | | ||
| 194 | -| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.9 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | ||
| 195 | -| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | ||
| 196 | -| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.2.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | | ||
| 197 | -| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.24 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | ||
| 198 | -| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | ||
| 199 | -| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - | | 189 | +| 框架 | 说明 | 版本 | 学习指南 | |
| 190 | +|---------------------------------------------------------------------------------------------|-----------------------|-------------|----------------------------------------------------------------| | ||
| 191 | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.6.13 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | ||
| 192 | +| [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | | ||
| 193 | +| [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.14 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | ||
| 194 | +| [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | ||
| 195 | +| [Dynamic Datasource](https://dynamic-datasource.com/) | 动态数据源 | 3.5.2 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | ||
| 196 | +| [Redis](https://redis.io/) | key-value 数据库 | 5.0 / 6.0 | | | ||
| 197 | +| [Redisson](https://github.com/redisson/redisson) | Redis 客户端 | 3.17.7 | [文档](http://www.iocoder.cn/Spring-Boot/Redis/?yudao) | | ||
| 198 | +| [Spring MVC](https://github.com/spring-projects/spring-framework/tree/master/spring-webmvc) | MVC 框架 | 5.3.23 | [文档](http://www.iocoder.cn/SpringMVC/MVC/?yudao) | | ||
| 199 | +| [Spring Security](https://github.com/spring-projects/spring-security) | Spring 安全框架 | 5.6.8 | [文档](http://www.iocoder.cn/Spring-Boot/Spring-Security/?yudao) | | ||
| 200 | +| [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.3 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | ||
| 201 | +| [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.7.2 | [文档](https://doc.iocoder.cn/bpm/) | | ||
| 202 | +| [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | | ||
| 203 | +| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | | ||
| 204 | +| [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | ||
| 205 | +| [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.5.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | | ||
| 206 | +| [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.6.9 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | | ||
| 207 | +| [Jackson](https://github.com/FasterXML/jackson) | JSON 工具库 | 2.13.3 | | | ||
| 208 | +| [MapStruct](https://mapstruct.org/) | Java Bean 转换 | 1.5.3.Final | [文档](http://www.iocoder.cn/Spring-Boot/MapStruct/?yudao) | | ||
| 209 | +| [Lombok](https://projectlombok.org/) | 消除冗长的 Java 代码 | 1.18.24 | [文档](http://www.iocoder.cn/Spring-Boot/Lombok/?yudao) | | ||
| 210 | +| [JUnit](https://junit.org/junit5/) | Java 单元测试框架 | 5.8.2 | - | | ||
| 211 | +| [Mockito](https://github.com/mockito/mockito) | Java Mock 框架 | 4.8.0 | - | | ||
| 200 | 212 | ||
| 201 | ### [管理后台 Vue2 前端](./yudao-ui-admin) | 213 | ### [管理后台 Vue2 前端](./yudao-ui-admin) |
| 202 | 214 | ||
| 203 | -| 框架 | 说明 | 版本 | | ||
| 204 | -|------------------------------------------------------------------------------|---------------|--------| | ||
| 205 | -| [Vue](https://cn.vuejs.org/index.html) | JavaScript 框架 | 2.6.12 | | ||
| 206 | -| [Vue Element Admin](https://panjiachen.github.io/vue-element-admin-site/zh/) | 后台前端解决方案 | - | | 215 | +| 框架 | 说明 | 版本 | |
| 216 | +|------------------------------------------------------------------------------|---------------|-------| | ||
| 217 | +| [Vue](https://cn.vuejs.org/index.html) | JavaScript 框架 | 2.7.0 | | ||
| 218 | +| [Vue Element Admin](https://panjiachen.github.io/vue-element-admin-site/zh/) | 后台前端解决方案 | - | | ||
| 207 | 219 | ||
| 208 | ### [管理后台 Vue3 前端](./yudao-ui-admin-vue3) | 220 | ### [管理后台 Vue3 前端](./yudao-ui-admin-vue3) |
| 209 | 221 | ||
| 210 | -| 框架 | 说明 | 版本 | | 222 | +| 框架 | 说明 | 版本 | |
| 211 | |----------------------------------------------------------------------|-----------------|--------| | 223 | |----------------------------------------------------------------------|-----------------|--------| |
| 212 | -| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.41 | | ||
| 213 | -| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.1.8 | | ||
| 214 | -| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.18 | | 224 | +| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.44 | |
| 225 | +| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 3.2.3 | | ||
| 226 | +| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.20 | | ||
| 215 | | [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.8.4 | | 227 | | [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.8.4 | |
| 216 | | [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.23 | | 228 | | [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.23 | |
| 217 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | | 229 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | |
pom.xml
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> | 38 | <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> |
| 39 | <!-- 看看咋放到 bom 里 --> | 39 | <!-- 看看咋放到 bom 里 --> |
| 40 | <lombok.version>1.18.24</lombok.version> | 40 | <lombok.version>1.18.24</lombok.version> |
| 41 | - <mapstruct.version>1.5.2.Final</mapstruct.version> | 41 | + <mapstruct.version>1.5.3.Final</mapstruct.version> |
| 42 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 42 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 43 | </properties> | 43 | </properties> |
| 44 | 44 |
sql/mysql/vue3-menu.sql renamed to sql/mysql/optional/vue3-menu.sql
| 1 | -- ---------------------------- | 1 | -- ---------------------------- |
| 2 | -- Table structure for system_menu | 2 | -- Table structure for system_menu |
| 3 | -- icon 不兼容 | 3 | -- icon 不兼容 |
| 4 | +-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!! | ||
| 5 | +-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!! | ||
| 6 | +-- 注意!!!只有在使用 yudao-ui-admin-vue3 才进行导入!!! | ||
| 4 | -- ---------------------------- | 7 | -- ---------------------------- |
| 5 | DROP TABLE IF EXISTS `system_menu`; | 8 | DROP TABLE IF EXISTS `system_menu`; |
| 6 | CREATE TABLE `system_menu` ( | 9 | CREATE TABLE `system_menu` ( |
| @@ -257,7 +260,7 @@ INSERT INTO `system_menu` VALUES (1264, '客户端查询', 'system:oauth2-client | @@ -257,7 +260,7 @@ INSERT INTO `system_menu` VALUES (1264, '客户端查询', 'system:oauth2-client | ||
| 257 | INSERT INTO `system_menu` VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', b'0'); | 260 | INSERT INTO `system_menu` VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', b'0'); |
| 258 | INSERT INTO `system_menu` VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', b'0'); | 261 | INSERT INTO `system_menu` VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', b'0'); |
| 259 | INSERT INTO `system_menu` VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0'); | 262 | INSERT INTO `system_menu` VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0'); |
| 260 | -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'ep:histogram', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); | ||
| 261 | -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'ep:histogram', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0'); | 263 | +INSERT INTO `system_menu` VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'ep:histogram', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); |
| 264 | +INSERT INTO `system_menu` VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'ep:histogram', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0'); | ||
| 262 | 265 | ||
| 263 | SET FOREIGN_KEY_CHECKS = 1; | 266 | SET FOREIGN_KEY_CHECKS = 1; |
sql/mysql/update.sql deleted
| 1 | --- ---------------------------- | ||
| 2 | --- 升级SQL文件,全新安装只需要执行ruoyi-vue-pro.sql文件即可 | ||
| 3 | --- 1.6.2 ==> 1.6.3 | ||
| 4 | --- ---------------------------- | ||
| 5 | --- 积木报表菜单 | ||
| 6 | -INSERT INTO `system_menu` VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'chart', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); | ||
| 7 | -INSERT INTO `system_menu` VALUES (1282, '积木报表', '', 2, 1, 1281, 'jm-report', '#', 'visualization/jm/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-10 20:33:26', b'0'); | ||
| 8 | \ No newline at end of file | 0 | \ No newline at end of file |
sql/optional/mall/coupon.sql
| @@ -20,10 +20,10 @@ CREATE TABLE `coupon` | @@ -20,10 +20,10 @@ CREATE TABLE `coupon` | ||
| 20 | `whether_noticed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否已提醒', | 20 | `whether_noticed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否已提醒', |
| 21 | `state` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠券状态 1已领用(未使用) 2已使用 3已过期', | 21 | `state` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠券状态 1已领用(未使用) 2已使用 3已过期', |
| 22 | `get_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取', | 22 | `get_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '获取方式1订单2.直接领取3.活动领取 4转赠 5分享获取', |
| 23 | - `fetch_time` datetime NOT NULL DEFAULT 0 COMMENT '领取时间', | ||
| 24 | - `use_time` datetime NOT NULL DEFAULT 0 COMMENT '使用时间', | ||
| 25 | - `start_time` datetime NOT NULL DEFAULT 0 COMMENT '可使用的开始时间', | ||
| 26 | - `end_time` datetime NOT NULL DEFAULT 0 COMMENT '有效期结束时间', | 23 | + `fetch_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '领取时间', |
| 24 | + `use_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使用时间', | ||
| 25 | + `start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '可使用的开始时间', | ||
| 26 | + `end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '有效期结束时间', | ||
| 27 | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | 27 | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', |
| 28 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 28 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 29 | `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | 29 | `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', |
sql/optional/mall/mall.sql
| @@ -23,18 +23,18 @@ SET FOREIGN_KEY_CHECKS = 0; | @@ -23,18 +23,18 @@ SET FOREIGN_KEY_CHECKS = 0; | ||
| 23 | DROP TABLE IF EXISTS `market_activity`; | 23 | DROP TABLE IF EXISTS `market_activity`; |
| 24 | CREATE TABLE `market_activity` ( | 24 | CREATE TABLE `market_activity` ( |
| 25 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '活动编号', | 25 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '活动编号', |
| 26 | - `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '活动标题', | 26 | + `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '活动标题', |
| 27 | `activity_type` tinyint NOT NULL COMMENT '活动类型', | 27 | `activity_type` tinyint NOT NULL COMMENT '活动类型', |
| 28 | `status` tinyint NOT NULL DEFAULT -1 COMMENT '活动状态', | 28 | `status` tinyint NOT NULL DEFAULT -1 COMMENT '活动状态', |
| 29 | `start_time` datetime NOT NULL COMMENT '开始时间', | 29 | `start_time` datetime NOT NULL COMMENT '开始时间', |
| 30 | `end_time` datetime NOT NULL COMMENT '结束时间', | 30 | `end_time` datetime NOT NULL COMMENT '结束时间', |
| 31 | `invalid_time` datetime NULL DEFAULT NULL COMMENT '失效时间', | 31 | `invalid_time` datetime NULL DEFAULT NULL COMMENT '失效时间', |
| 32 | `delete_time` datetime NULL DEFAULT NULL COMMENT '删除时间', | 32 | `delete_time` datetime NULL DEFAULT NULL COMMENT '删除时间', |
| 33 | - `time_limited_discount` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', | ||
| 34 | - `full_privilege` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', | ||
| 35 | - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', | 33 | + `time_limited_discount` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', |
| 34 | + `full_privilege` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '限制折扣字符串,使用 JSON 序列化成字符串存储', | ||
| 35 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | ||
| 36 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 36 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 37 | - `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', | 37 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', |
| 38 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | 38 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 39 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | 39 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 40 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | 40 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| @@ -53,18 +53,18 @@ COMMIT; | @@ -53,18 +53,18 @@ COMMIT; | ||
| 53 | DROP TABLE IF EXISTS `market_banner`; | 53 | DROP TABLE IF EXISTS `market_banner`; |
| 54 | CREATE TABLE `market_banner` ( | 54 | CREATE TABLE `market_banner` ( |
| 55 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'Banner编号', | 55 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'Banner编号', |
| 56 | - `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT 'Banner标题', | ||
| 57 | - `pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '图片URL', | 56 | + `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Banner标题', |
| 57 | + `pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '图片URL', | ||
| 58 | `status` tinyint NOT NULL DEFAULT -1 COMMENT '活动状态', | 58 | `status` tinyint NOT NULL DEFAULT -1 COMMENT '活动状态', |
| 59 | - `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '跳转地址', | ||
| 60 | - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建者', | 59 | + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '跳转地址', |
| 60 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | ||
| 61 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 61 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| 62 | - `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新者', | 62 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', |
| 63 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | 63 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 64 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | 64 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 65 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | 65 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 66 | `sort` tinyint NULL DEFAULT NULL COMMENT '排序', | 66 | `sort` tinyint NULL DEFAULT NULL COMMENT '排序', |
| 67 | - `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述', | 67 | + `memo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '描述', |
| 68 | PRIMARY KEY (`id`) USING BTREE | 68 | PRIMARY KEY (`id`) USING BTREE |
| 69 | ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Banner管理'; | 69 | ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Banner管理'; |
| 70 | 70 | ||
| @@ -81,11 +81,11 @@ DROP TABLE IF EXISTS `member_address`; | @@ -81,11 +81,11 @@ DROP TABLE IF EXISTS `member_address`; | ||
| 81 | CREATE TABLE `member_address` ( | 81 | CREATE TABLE `member_address` ( |
| 82 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '收件地址编号', | 82 | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '收件地址编号', |
| 83 | `user_id` bigint NOT NULL COMMENT '用户编号', | 83 | `user_id` bigint NOT NULL COMMENT '用户编号', |
| 84 | - `name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '收件人名称', | ||
| 85 | - `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '手机号', | 84 | + `name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收件人名称', |
| 85 | + `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '手机号', | ||
| 86 | `area_id` bigint NOT NULL COMMENT '地区编码', | 86 | `area_id` bigint NOT NULL COMMENT '地区编码', |
| 87 | - `post_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '邮编', | ||
| 88 | - `detail_address` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '收件详细地址', | 87 | + `post_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮编', |
| 88 | + `detail_address` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收件详细地址', | ||
| 89 | `defaulted` bit(1) NOT NULL COMMENT '是否默认', | 89 | `defaulted` bit(1) NOT NULL COMMENT '是否默认', |
| 90 | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | 90 | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', |
| 91 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | 91 | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| @@ -95,7 +95,7 @@ CREATE TABLE `member_address` ( | @@ -95,7 +95,7 @@ CREATE TABLE `member_address` ( | ||
| 95 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | 95 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 96 | PRIMARY KEY (`id`) USING BTREE, | 96 | PRIMARY KEY (`id`) USING BTREE, |
| 97 | INDEX `idx_userId`(`user_id` ASC) USING BTREE | 97 | INDEX `idx_userId`(`user_id` ASC) USING BTREE |
| 98 | -) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户收件地址'; | 98 | +) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户收件地址'; |
| 99 | 99 | ||
| 100 | -- ---------------------------- | 100 | -- ---------------------------- |
| 101 | -- Records of member_address | 101 | -- Records of member_address |
| @@ -307,7 +307,7 @@ INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, ` | @@ -307,7 +307,7 @@ INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, ` | ||
| 307 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2022, '规格更新', 'product:property:update', 3, 3, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); | 307 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2022, '规格更新', 'product:property:update', 3, 3, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); |
| 308 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2023, '规格删除', 'product:property:delete', 3, 4, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); | 308 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2023, '规格删除', 'product:property:delete', 3, 4, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); |
| 309 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2024, '规格导出', 'product:property:export', 3, 5, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); | 309 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2024, '规格导出', 'product:property:export', 3, 5, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-08-01 14:55:35', b'0'); |
| 310 | -INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2025, 'Banner管理', '', 2, 1, 2000, 'brand', '', 'mall/market/banner/index', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | 310 | +INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2025, 'Banner管理', '', 2, 1, 2000, 'banner', '', 'mall/market/banner/index', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| 311 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2026, 'Banner查询', 'market:banner:query', 3, 1, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | 311 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2026, 'Banner查询', 'market:banner:query', 3, 1, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| 312 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2027, 'Banner创建', 'market:banner:create', 3, 2, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | 312 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2027, 'Banner创建', 'market:banner:create', 3, 2, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
| 313 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | 313 | INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); |
yudao-dependencies/pom.xml
| @@ -16,19 +16,18 @@ | @@ -16,19 +16,18 @@ | ||
| 16 | <properties> | 16 | <properties> |
| 17 | <revision>1.6.4-snapshot</revision> | 17 | <revision>1.6.4-snapshot</revision> |
| 18 | <!-- 统一依赖管理 --> | 18 | <!-- 统一依赖管理 --> |
| 19 | - <spring.boot.version>2.6.12</spring.boot.version> | 19 | + <spring.boot.version>2.6.13</spring.boot.version> |
| 20 | <!-- Web 相关 --> | 20 | <!-- Web 相关 --> |
| 21 | <knife4j.version>3.0.3</knife4j.version> | 21 | <knife4j.version>3.0.3</knife4j.version> |
| 22 | <swagger-annotations.version>1.6.7</swagger-annotations.version> | 22 | <swagger-annotations.version>1.6.7</swagger-annotations.version> |
| 23 | <servlet.versoin>2.5</servlet.versoin> | 23 | <servlet.versoin>2.5</servlet.versoin> |
| 24 | <!-- DB 相关 --> | 24 | <!-- DB 相关 --> |
| 25 | - <druid.version>1.2.13-SNSAPSHOT</druid.version> | 25 | + <druid.version>1.2.14</druid.version> |
| 26 | <mybatis-plus.version>3.5.2</mybatis-plus.version> | 26 | <mybatis-plus.version>3.5.2</mybatis-plus.version> |
| 27 | <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> | 27 | <mybatis-plus-generator.version>3.5.2</mybatis-plus-generator.version> |
| 28 | <dynamic-datasource.version>3.5.2</dynamic-datasource.version> | 28 | <dynamic-datasource.version>3.5.2</dynamic-datasource.version> |
| 29 | <redisson.version>3.17.7</redisson.version> | 29 | <redisson.version>3.17.7</redisson.version> |
| 30 | <!-- Config 配置中心相关 --> | 30 | <!-- Config 配置中心相关 --> |
| 31 | - <apollo.version>2.0.1</apollo.version> | ||
| 32 | <!-- 服务保障相关 --> | 31 | <!-- 服务保障相关 --> |
| 33 | <lock4j.version>2.2.2</lock4j.version> | 32 | <lock4j.version>2.2.2</lock4j.version> |
| 34 | <resilience4j.version>1.7.1</resilience4j.version> | 33 | <resilience4j.version>1.7.1</resilience4j.version> |
| @@ -43,11 +42,10 @@ | @@ -43,11 +42,10 @@ | ||
| 43 | <!-- Bpm 工作流相关 --> | 42 | <!-- Bpm 工作流相关 --> |
| 44 | <flowable.version>6.7.2</flowable.version> | 43 | <flowable.version>6.7.2</flowable.version> |
| 45 | <!-- 工具类相关 --> | 44 | <!-- 工具类相关 --> |
| 46 | - <jasypt-spring-boot-starter.version>3.0.4</jasypt-spring-boot-starter.version> | ||
| 47 | <lombok.version>1.18.24</lombok.version> | 45 | <lombok.version>1.18.24</lombok.version> |
| 48 | - <mapstruct.version>1.5.2.Final</mapstruct.version> | ||
| 49 | - <hutool.version>5.8.8</hutool.version> | ||
| 50 | - <easyexcel.verion>3.1.1</easyexcel.verion> | 46 | + <mapstruct.version>1.5.3.Final</mapstruct.version> |
| 47 | + <hutool.version>5.8.9</hutool.version> | ||
| 48 | + <easyexcel.verion>3.1.2</easyexcel.verion> | ||
| 51 | <velocity.version>2.3</velocity.version> | 49 | <velocity.version>2.3</velocity.version> |
| 52 | <screw.version>1.0.5</screw.version> | 50 | <screw.version>1.0.5</screw.version> |
| 53 | <fastjson.version>1.2.83</fastjson.version> | 51 | <fastjson.version>1.2.83</fastjson.version> |
| @@ -225,17 +223,6 @@ | @@ -225,17 +223,6 @@ | ||
| 225 | </dependency> | 223 | </dependency> |
| 226 | 224 | ||
| 227 | <!-- Config 配置中心相关 --> | 225 | <!-- Config 配置中心相关 --> |
| 228 | - <dependency> | ||
| 229 | - <groupId>cn.iocoder.boot</groupId> | ||
| 230 | - <artifactId>yudao-spring-boot-starter-config</artifactId> | ||
| 231 | - <version>${revision}</version> | ||
| 232 | - </dependency> | ||
| 233 | - | ||
| 234 | - <dependency> | ||
| 235 | - <groupId>com.ctrip.framework.apollo</groupId> | ||
| 236 | - <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 --> | ||
| 237 | - <version>${apollo.version}</version> | ||
| 238 | - </dependency> | ||
| 239 | 226 | ||
| 240 | <!-- Job 定时任务相关 --> | 227 | <!-- Job 定时任务相关 --> |
| 241 | <dependency> | 228 | <dependency> |
| @@ -408,12 +395,6 @@ | @@ -408,12 +395,6 @@ | ||
| 408 | </dependency> | 395 | </dependency> |
| 409 | 396 | ||
| 410 | <dependency> | 397 | <dependency> |
| 411 | - <groupId>com.github.ulisesbocchio</groupId> | ||
| 412 | - <artifactId>jasypt-spring-boot-starter</artifactId> <!-- 加解密 --> | ||
| 413 | - <version>${jasypt-spring-boot-starter.version}</version> | ||
| 414 | - </dependency> | ||
| 415 | - | ||
| 416 | - <dependency> | ||
| 417 | <groupId>cn.iocoder.boot</groupId> | 398 | <groupId>cn.iocoder.boot</groupId> |
| 418 | <artifactId>yudao-spring-boot-starter-excel</artifactId> | 399 | <artifactId>yudao-spring-boot-starter-excel</artifactId> |
| 419 | <version>${revision}</version> | 400 | <version>${revision}</version> |
yudao-example/yudao-sso-demo-by-code/pom.xml
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | <maven.compiler.target>8</maven.compiler.target> | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | <!-- 统一依赖管理 --> | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.6.10</spring.boot.version> | 24 | + <spring.boot.version>2.6.13</spring.boot.version> |
| 25 | </properties> | 25 | </properties> |
| 26 | 26 | ||
| 27 | <dependencyManagement> | 27 | <dependencyManagement> |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <dependency> | 52 | <dependency> |
| 53 | <groupId>cn.hutool</groupId> | 53 | <groupId>cn.hutool</groupId> |
| 54 | <artifactId>hutool-all</artifactId> | 54 | <artifactId>hutool-all</artifactId> |
| 55 | - <version>5.8.8</version> | 55 | + <version>5.8.9</version> |
| 56 | </dependency> | 56 | </dependency> |
| 57 | 57 | ||
| 58 | <dependency> | 58 | <dependency> |
yudao-example/yudao-sso-demo-by-code/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java
| @@ -11,7 +11,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic | @@ -11,7 +11,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic | ||
| 11 | 11 | ||
| 12 | import javax.annotation.Resource; | 12 | import javax.annotation.Resource; |
| 13 | 13 | ||
| 14 | -@Configuration | 14 | +@Configuration(proxyBeanMethods = false) |
| 15 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | 15 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { |
| 16 | 16 | ||
| 17 | @Resource | 17 | @Resource |
yudao-example/yudao-sso-demo-by-password/pom.xml
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | <maven.compiler.target>8</maven.compiler.target> | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | <!-- 统一依赖管理 --> | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.6.10</spring.boot.version> | 24 | + <spring.boot.version>2.6.13</spring.boot.version> |
| 25 | </properties> | 25 | </properties> |
| 26 | 26 | ||
| 27 | <dependencyManagement> | 27 | <dependencyManagement> |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <dependency> | 52 | <dependency> |
| 53 | <groupId>cn.hutool</groupId> | 53 | <groupId>cn.hutool</groupId> |
| 54 | <artifactId>hutool-all</artifactId> | 54 | <artifactId>hutool-all</artifactId> |
| 55 | - <version>5.8.8</version> | 55 | + <version>5.8.9</version> |
| 56 | </dependency> | 56 | </dependency> |
| 57 | 57 | ||
| 58 | <dependency> | 58 | <dependency> |
yudao-example/yudao-sso-demo-by-password/src/main/java/cn/iocoder/yudao/ssodemo/framework/config/SecurityConfiguration.java
| @@ -11,7 +11,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic | @@ -11,7 +11,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic | ||
| 11 | 11 | ||
| 12 | import javax.annotation.Resource; | 12 | import javax.annotation.Resource; |
| 13 | 13 | ||
| 14 | -@Configuration | 14 | +@Configuration(proxyBeanMethods = false) |
| 15 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | 15 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { |
| 16 | 16 | ||
| 17 | @Resource | 17 | @Resource |
yudao-framework/pom.xml
| @@ -20,7 +20,6 @@ | @@ -20,7 +20,6 @@ | ||
| 20 | <module>yudao-spring-boot-starter-file</module> | 20 | <module>yudao-spring-boot-starter-file</module> |
| 21 | <module>yudao-spring-boot-starter-monitor</module> | 21 | <module>yudao-spring-boot-starter-monitor</module> |
| 22 | <module>yudao-spring-boot-starter-protection</module> | 22 | <module>yudao-spring-boot-starter-protection</module> |
| 23 | - <module>yudao-spring-boot-starter-config</module> | ||
| 24 | <module>yudao-spring-boot-starter-job</module> | 23 | <module>yudao-spring-boot-starter-job</module> |
| 25 | <module>yudao-spring-boot-starter-mq</module> | 24 | <module>yudao-spring-boot-starter-mq</module> |
| 26 | 25 |
yudao-framework/yudao-common/pom.xml
| @@ -105,6 +105,11 @@ | @@ -105,6 +105,11 @@ | ||
| 105 | <artifactId>jackson-core</artifactId> | 105 | <artifactId>jackson-core</artifactId> |
| 106 | <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 --> | 106 | <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 --> |
| 107 | </dependency> | 107 | </dependency> |
| 108 | + <dependency> | ||
| 109 | + <groupId>com.fasterxml.jackson.datatype</groupId> | ||
| 110 | + <artifactId>jackson-datatype-jsr310</artifactId> | ||
| 111 | + <scope>provided</scope> <!-- 设置为 provided,只有工具类需要使用到 --> | ||
| 112 | + </dependency> | ||
| 108 | 113 | ||
| 109 | <dependency> | 114 | <dependency> |
| 110 | <groupId>org.slf4j</groupId> | 115 | <groupId>org.slf4j</groupId> |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/exception/enums/GlobalErrorCodeConstants.java
| @@ -29,6 +29,7 @@ public interface GlobalErrorCodeConstants { | @@ -29,6 +29,7 @@ public interface GlobalErrorCodeConstants { | ||
| 29 | // ========== 服务端错误段 ========== | 29 | // ========== 服务端错误段 ========== |
| 30 | 30 | ||
| 31 | ErrorCode INTERNAL_SERVER_ERROR = new ErrorCode(500, "系统异常"); | 31 | ErrorCode INTERNAL_SERVER_ERROR = new ErrorCode(500, "系统异常"); |
| 32 | + ErrorCode NOT_IMPLEMENTED = new ErrorCode(501, "功能未实现/未开启"); | ||
| 32 | 33 | ||
| 33 | // ========== 自定义错误段 ========== | 34 | // ========== 自定义错误段 ========== |
| 34 | ErrorCode REPEATED_REQUESTS = new ErrorCode(900, "重复请求,请稍后重试"); // 重复请求 | 35 | ErrorCode REPEATED_REQUESTS = new ErrorCode(900, "重复请求,请稍后重试"); // 重复请求 |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java
| 1 | package cn.iocoder.yudao.framework.common.util.date; | 1 | package cn.iocoder.yudao.framework.common.util.date; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.date.DateUtil; | 3 | import cn.hutool.core.date.DateUtil; |
| 4 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 4 | 5 | ||
| 5 | import java.time.Duration; | 6 | import java.time.Duration; |
| 7 | +import java.time.Instant; | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | +import java.time.ZoneId; | ||
| 10 | +import java.time.ZonedDateTime; | ||
| 6 | import java.util.Calendar; | 11 | import java.util.Calendar; |
| 7 | import java.util.Date; | 12 | import java.util.Date; |
| 8 | 13 | ||
| @@ -25,6 +30,34 @@ public class DateUtils { | @@ -25,6 +30,34 @@ public class DateUtils { | ||
| 25 | 30 | ||
| 26 | public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss"; | 31 | public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss"; |
| 27 | 32 | ||
| 33 | + /** | ||
| 34 | + * 将 LocalDateTime 转换成 Date | ||
| 35 | + * | ||
| 36 | + * @param date LocalDateTime | ||
| 37 | + * @return LocalDateTime | ||
| 38 | + */ | ||
| 39 | + public static Date of(LocalDateTime date) { | ||
| 40 | + // 将此日期时间与时区相结合以创建 ZonedDateTime | ||
| 41 | + ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault()); | ||
| 42 | + // 本地时间线 LocalDateTime 到即时时间线 Instant 时间戳 | ||
| 43 | + Instant instant = zonedDateTime.toInstant(); | ||
| 44 | + // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间 | ||
| 45 | + return Date.from(instant); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 将 Date 转换成 LocalDateTime | ||
| 50 | + * | ||
| 51 | + * @param date Date | ||
| 52 | + * @return LocalDateTime | ||
| 53 | + */ | ||
| 54 | + public static LocalDateTime of(Date date) { | ||
| 55 | + // 转为时间戳 | ||
| 56 | + Instant instant = date.toInstant(); | ||
| 57 | + // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间 | ||
| 58 | + return LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); | ||
| 59 | + } | ||
| 60 | + | ||
| 28 | public static Date addTime(Duration duration) { | 61 | public static Date addTime(Duration duration) { |
| 29 | return new Date(System.currentTimeMillis() + duration.toMillis()); | 62 | return new Date(System.currentTimeMillis() + duration.toMillis()); |
| 30 | } | 63 | } |
| @@ -33,6 +66,11 @@ public class DateUtils { | @@ -33,6 +66,11 @@ public class DateUtils { | ||
| 33 | return System.currentTimeMillis() > time.getTime(); | 66 | return System.currentTimeMillis() > time.getTime(); |
| 34 | } | 67 | } |
| 35 | 68 | ||
| 69 | + public static boolean isExpired(LocalDateTime time) { | ||
| 70 | + LocalDateTime now = LocalDateTime.now(); | ||
| 71 | + return now.isAfter(time); | ||
| 72 | + } | ||
| 73 | + | ||
| 36 | public static long diff(Date endTime, Date startTime) { | 74 | public static long diff(Date endTime, Date startTime) { |
| 37 | return endTime.getTime() - startTime.getTime(); | 75 | return endTime.getTime() - startTime.getTime(); |
| 38 | } | 76 | } |
| @@ -40,24 +78,28 @@ public class DateUtils { | @@ -40,24 +78,28 @@ public class DateUtils { | ||
| 40 | /** | 78 | /** |
| 41 | * 创建指定时间 | 79 | * 创建指定时间 |
| 42 | * | 80 | * |
| 43 | - * @param year 年 | ||
| 44 | - * @param mouth 月 | ||
| 45 | - * @param day 日 | 81 | + * @param year 年 |
| 82 | + * @param mouth 月 | ||
| 83 | + * @param day 日 | ||
| 46 | * @return 指定时间 | 84 | * @return 指定时间 |
| 47 | */ | 85 | */ |
| 48 | public static Date buildTime(int year, int mouth, int day) { | 86 | public static Date buildTime(int year, int mouth, int day) { |
| 49 | return buildTime(year, mouth, day, 0, 0, 0); | 87 | return buildTime(year, mouth, day, 0, 0, 0); |
| 50 | } | 88 | } |
| 51 | 89 | ||
| 90 | + public static LocalDateTime buildLocalDateTime(int year, int mouth, int day) { | ||
| 91 | + return LocalDateTime.of(year, mouth, day, 0, 0, 0); | ||
| 92 | + } | ||
| 93 | + | ||
| 52 | /** | 94 | /** |
| 53 | * 创建指定时间 | 95 | * 创建指定时间 |
| 54 | * | 96 | * |
| 55 | - * @param year 年 | ||
| 56 | - * @param mouth 月 | ||
| 57 | - * @param day 日 | ||
| 58 | - * @param hour 小时 | ||
| 59 | - * @param minute 分钟 | ||
| 60 | - * @param second 秒 | 97 | + * @param year 年 |
| 98 | + * @param mouth 月 | ||
| 99 | + * @param day 日 | ||
| 100 | + * @param hour 小时 | ||
| 101 | + * @param minute 分钟 | ||
| 102 | + * @param second 秒 | ||
| 61 | * @return 指定时间 | 103 | * @return 指定时间 |
| 62 | */ | 104 | */ |
| 63 | public static Date buildTime(int year, int mouth, int day, | 105 | public static Date buildTime(int year, int mouth, int day, |
| @@ -83,6 +125,16 @@ public class DateUtils { | @@ -83,6 +125,16 @@ public class DateUtils { | ||
| 83 | return a.compareTo(b) > 0 ? a : b; | 125 | return a.compareTo(b) > 0 ? a : b; |
| 84 | } | 126 | } |
| 85 | 127 | ||
| 128 | + public static LocalDateTime max(LocalDateTime a, LocalDateTime b) { | ||
| 129 | + if (a == null) { | ||
| 130 | + return b; | ||
| 131 | + } | ||
| 132 | + if (b == null) { | ||
| 133 | + return a; | ||
| 134 | + } | ||
| 135 | + return a.isAfter(b) ? a : b; | ||
| 136 | + } | ||
| 137 | + | ||
| 86 | public static boolean beforeNow(Date date) { | 138 | public static boolean beforeNow(Date date) { |
| 87 | return date.getTime() < System.currentTimeMillis(); | 139 | return date.getTime() < System.currentTimeMillis(); |
| 88 | } | 140 | } |
| @@ -91,6 +143,10 @@ public class DateUtils { | @@ -91,6 +143,10 @@ public class DateUtils { | ||
| 91 | return date.getTime() >= System.currentTimeMillis(); | 143 | return date.getTime() >= System.currentTimeMillis(); |
| 92 | } | 144 | } |
| 93 | 145 | ||
| 146 | + public static boolean afterNow(LocalDateTime localDateTime) { | ||
| 147 | + return localDateTime.isAfter(LocalDateTime.now()); | ||
| 148 | + } | ||
| 149 | + | ||
| 94 | /** | 150 | /** |
| 95 | * 计算当期时间相差的日期 | 151 | * 计算当期时间相差的日期 |
| 96 | * | 152 | * |
| @@ -136,6 +192,16 @@ public class DateUtils { | @@ -136,6 +192,16 @@ public class DateUtils { | ||
| 136 | } | 192 | } |
| 137 | 193 | ||
| 138 | /** | 194 | /** |
| 195 | + * 是否今天 | ||
| 196 | + * | ||
| 197 | + * @param date 日期 | ||
| 198 | + * @return 是否 | ||
| 199 | + */ | ||
| 200 | + public static boolean isToday(LocalDateTime date) { | ||
| 201 | + return LocalDateTimeUtil.isSameDay(date, LocalDateTime.now()); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + /** | ||
| 139 | * 判断当前时间是否在该时间范围内 | 205 | * 判断当前时间是否在该时间范围内 |
| 140 | * | 206 | * |
| 141 | * @param startTime 开始时间 | 207 | * @param startTime 开始时间 |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java
| @@ -7,6 +7,7 @@ import com.fasterxml.jackson.core.type.TypeReference; | @@ -7,6 +7,7 @@ import com.fasterxml.jackson.core.type.TypeReference; | ||
| 7 | import com.fasterxml.jackson.databind.JsonNode; | 7 | import com.fasterxml.jackson.databind.JsonNode; |
| 8 | import com.fasterxml.jackson.databind.ObjectMapper; | 8 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 9 | import com.fasterxml.jackson.databind.SerializationFeature; | 9 | import com.fasterxml.jackson.databind.SerializationFeature; |
| 10 | +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | ||
| 10 | import lombok.SneakyThrows; | 11 | import lombok.SneakyThrows; |
| 11 | import lombok.experimental.UtilityClass; | 12 | import lombok.experimental.UtilityClass; |
| 12 | import lombok.extern.slf4j.Slf4j; | 13 | import lombok.extern.slf4j.Slf4j; |
| @@ -28,6 +29,7 @@ public class JsonUtils { | @@ -28,6 +29,7 @@ public class JsonUtils { | ||
| 28 | 29 | ||
| 29 | static { | 30 | static { |
| 30 | objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); | 31 | objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); |
| 32 | + objectMapper.registerModules(new JavaTimeModule()); // 解决 LocalDateTime 的序列化 | ||
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | /** | 35 | /** |
yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/config/YudaoBannerAutoConfiguration.java
| @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; | @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 9 | * | 9 | * |
| 10 | * @author 芋道源码 | 10 | * @author 芋道源码 |
| 11 | */ | 11 | */ |
| 12 | -@Configuration | 12 | +@Configuration(proxyBeanMethods = false) |
| 13 | public class YudaoBannerAutoConfiguration { | 13 | public class YudaoBannerAutoConfiguration { |
| 14 | 14 | ||
| 15 | @Bean | 15 | @Bean |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDataPermissionAutoConfiguration.java
| @@ -17,7 +17,7 @@ import java.util.List; | @@ -17,7 +17,7 @@ import java.util.List; | ||
| 17 | * | 17 | * |
| 18 | * @author 芋道源码 | 18 | * @author 芋道源码 |
| 19 | */ | 19 | */ |
| 20 | -@Configuration | 20 | +@Configuration(proxyBeanMethods = false) |
| 21 | public class YudaoDataPermissionAutoConfiguration { | 21 | public class YudaoDataPermissionAutoConfiguration { |
| 22 | 22 | ||
| 23 | @Bean | 23 | @Bean |
| @@ -27,9 +27,8 @@ public class YudaoDataPermissionAutoConfiguration { | @@ -27,9 +27,8 @@ public class YudaoDataPermissionAutoConfiguration { | ||
| 27 | 27 | ||
| 28 | @Bean | 28 | @Bean |
| 29 | public DataPermissionDatabaseInterceptor dataPermissionDatabaseInterceptor(MybatisPlusInterceptor interceptor, | 29 | public DataPermissionDatabaseInterceptor dataPermissionDatabaseInterceptor(MybatisPlusInterceptor interceptor, |
| 30 | - List<DataPermissionRule> rules) { | 30 | + DataPermissionRuleFactory ruleFactory) { |
| 31 | // 创建 DataPermissionDatabaseInterceptor 拦截器 | 31 | // 创建 DataPermissionDatabaseInterceptor 拦截器 |
| 32 | - DataPermissionRuleFactory ruleFactory = dataPermissionRuleFactory(rules); | ||
| 33 | DataPermissionDatabaseInterceptor inner = new DataPermissionDatabaseInterceptor(ruleFactory); | 32 | DataPermissionDatabaseInterceptor inner = new DataPermissionDatabaseInterceptor(ruleFactory); |
| 34 | // 添加到 interceptor 中 | 33 | // 添加到 interceptor 中 |
| 35 | // 需要加在首个,主要是为了在分页插件前面。这个是 MyBatis Plus 的规定 | 34 | // 需要加在首个,主要是为了在分页插件前面。这个是 MyBatis Plus 的规定 |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/config/YudaoDeptDataPermissionAutoConfiguration.java
| @@ -16,7 +16,7 @@ import java.util.List; | @@ -16,7 +16,7 @@ import java.util.List; | ||
| 16 | * | 16 | * |
| 17 | * @author 芋道源码 | 17 | * @author 芋道源码 |
| 18 | */ | 18 | */ |
| 19 | -@Configuration | 19 | +@Configuration(proxyBeanMethods = false) |
| 20 | @ConditionalOnClass(LoginUser.class) | 20 | @ConditionalOnClass(LoginUser.class) |
| 21 | @ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class}) | 21 | @ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class}) |
| 22 | public class YudaoDeptDataPermissionAutoConfiguration { | 22 | public class YudaoDeptDataPermissionAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java
| @@ -87,7 +87,7 @@ public class DataPermissionDatabaseInterceptorTest extends BaseMockitoUnitTest { | @@ -87,7 +87,7 @@ public class DataPermissionDatabaseInterceptorTest extends BaseMockitoUnitTest { | ||
| 87 | interceptor.beforeQuery(null, mappedStatement, null, null, null, boundSql); | 87 | interceptor.beforeQuery(null, mappedStatement, null, null, null, boundSql); |
| 88 | // 断言 | 88 | // 断言 |
| 89 | verify(mpBs, times(1)).sql( | 89 | verify(mpBs, times(1)).sql( |
| 90 | - eq("SELECT * FROM t_user WHERE id = 1 AND dept_id = 100")); | 90 | + eq("SELECT * FROM t_user WHERE id = 1 AND t_user.dept_id = 100")); |
| 91 | // 断言缓存 | 91 | // 断言缓存 |
| 92 | assertTrue(interceptor.getMappedStatementCache().getNoRewritableMappedStatements().isEmpty()); | 92 | assertTrue(interceptor.getMappedStatementCache().getNoRewritableMappedStatements().isEmpty()); |
| 93 | } | 93 | } |
yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.module.system.api.dict.DictDataApi; | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.module.system.api.dict.DictDataApi; | ||
| 5 | import org.springframework.context.annotation.Bean; | 5 | import org.springframework.context.annotation.Bean; |
| 6 | import org.springframework.context.annotation.Configuration; | 6 | import org.springframework.context.annotation.Configuration; |
| 7 | 7 | ||
| 8 | -@Configuration | 8 | +@Configuration(proxyBeanMethods = false) |
| 9 | public class YudaoDictAutoConfiguration { | 9 | public class YudaoDictAutoConfiguration { |
| 10 | 10 | ||
| 11 | @Bean | 11 | @Bean |
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeConfiguration.java
| @@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; | @@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; | ||
| 17 | * | 17 | * |
| 18 | * @author 芋道源码 | 18 | * @author 芋道源码 |
| 19 | */ | 19 | */ |
| 20 | -@Configuration | 20 | +@Configuration(proxyBeanMethods = false) |
| 21 | @ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志 | 21 | @ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志 |
| 22 | @EnableConfigurationProperties(ErrorCodeProperties.class) | 22 | @EnableConfigurationProperties(ErrorCodeProperties.class) |
| 23 | @EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码 | 23 | @EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码 |
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/loader/ErrorCodeLoaderImpl.java
| @@ -10,7 +10,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent; | @@ -10,7 +10,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent; | ||
| 10 | import org.springframework.context.event.EventListener; | 10 | import org.springframework.context.event.EventListener; |
| 11 | import org.springframework.scheduling.annotation.Scheduled; | 11 | import org.springframework.scheduling.annotation.Scheduled; |
| 12 | 12 | ||
| 13 | -import java.util.Date; | 13 | +import java.time.LocalDateTime; |
| 14 | import java.util.List; | 14 | import java.util.List; |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| @@ -41,7 +41,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader { | @@ -41,7 +41,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader { | ||
| 41 | /** | 41 | /** |
| 42 | * 缓存错误码的最大更新时间,用于后续的增量轮询,判断是否有更新 | 42 | * 缓存错误码的最大更新时间,用于后续的增量轮询,判断是否有更新 |
| 43 | */ | 43 | */ |
| 44 | - private Date maxUpdateTime; | 44 | + private LocalDateTime maxUpdateTime; |
| 45 | 45 | ||
| 46 | @EventListener(ApplicationReadyEvent.class) | 46 | @EventListener(ApplicationReadyEvent.class) |
| 47 | public void loadErrorCodes() { | 47 | public void loadErrorCodes() { |
yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/config/YudaoOperateLogAutoConfiguration.java
| @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.api.logger.OperateLogApi; | @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.system.api.logger.OperateLogApi; | ||
| 7 | import org.springframework.context.annotation.Bean; | 7 | import org.springframework.context.annotation.Bean; |
| 8 | import org.springframework.context.annotation.Configuration; | 8 | import org.springframework.context.annotation.Configuration; |
| 9 | 9 | ||
| 10 | -@Configuration | 10 | +@Configuration(proxyBeanMethods = false) |
| 11 | public class YudaoOperateLogAutoConfiguration { | 11 | public class YudaoOperateLogAutoConfiguration { |
| 12 | 12 | ||
| 13 | @Bean | 13 | @Bean |
yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java
| 1 | package cn.iocoder.yudao.framework.operatelog.core.aop; | 1 | package cn.iocoder.yudao.framework.operatelog.core.aop; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 3 | import cn.hutool.core.exceptions.ExceptionUtil; | 4 | import cn.hutool.core.exceptions.ExceptionUtil; |
| 4 | import cn.hutool.core.util.ArrayUtil; | 5 | import cn.hutool.core.util.ArrayUtil; |
| 5 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| @@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest; | @@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest; | ||
| 32 | import javax.servlet.http.HttpServletResponse; | 33 | import javax.servlet.http.HttpServletResponse; |
| 33 | import java.lang.annotation.Annotation; | 34 | import java.lang.annotation.Annotation; |
| 34 | import java.lang.reflect.Array; | 35 | import java.lang.reflect.Array; |
| 36 | +import java.time.LocalDateTime; | ||
| 35 | import java.util.*; | 37 | import java.util.*; |
| 36 | import java.util.function.Predicate; | 38 | import java.util.function.Predicate; |
| 37 | import java.util.stream.IntStream; | 39 | import java.util.stream.IntStream; |
| @@ -94,7 +96,7 @@ public class OperateLogAspect { | @@ -94,7 +96,7 @@ public class OperateLogAspect { | ||
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | // 记录开始时间 | 98 | // 记录开始时间 |
| 97 | - Date startTime = new Date(); | 99 | + LocalDateTime startTime = LocalDateTime.now(); |
| 98 | try { | 100 | try { |
| 99 | // 执行原有方法 | 101 | // 执行原有方法 |
| 100 | Object result = joinPoint.proceed(); | 102 | Object result = joinPoint.proceed(); |
| @@ -128,7 +130,7 @@ public class OperateLogAspect { | @@ -128,7 +130,7 @@ public class OperateLogAspect { | ||
| 128 | private void log(ProceedingJoinPoint joinPoint, | 130 | private void log(ProceedingJoinPoint joinPoint, |
| 129 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | 131 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, |
| 130 | ApiOperation apiOperation, | 132 | ApiOperation apiOperation, |
| 131 | - Date startTime, Object result, Throwable exception) { | 133 | + LocalDateTime startTime, Object result, Throwable exception) { |
| 132 | try { | 134 | try { |
| 133 | // 判断不记录的情况 | 135 | // 判断不记录的情况 |
| 134 | if (!isLogEnable(joinPoint, operateLog)) { | 136 | if (!isLogEnable(joinPoint, operateLog)) { |
| @@ -145,7 +147,7 @@ public class OperateLogAspect { | @@ -145,7 +147,7 @@ public class OperateLogAspect { | ||
| 145 | private void log0(ProceedingJoinPoint joinPoint, | 147 | private void log0(ProceedingJoinPoint joinPoint, |
| 146 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | 148 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, |
| 147 | ApiOperation apiOperation, | 149 | ApiOperation apiOperation, |
| 148 | - Date startTime, Object result, Throwable exception) { | 150 | + LocalDateTime startTime, Object result, Throwable exception) { |
| 149 | OperateLog operateLogObj = new OperateLog(); | 151 | OperateLog operateLogObj = new OperateLog(); |
| 150 | // 补全通用字段 | 152 | // 补全通用字段 |
| 151 | operateLogObj.setTraceId(TracerUtils.getTraceId()); | 153 | operateLogObj.setTraceId(TracerUtils.getTraceId()); |
| @@ -226,7 +228,7 @@ public class OperateLogAspect { | @@ -226,7 +228,7 @@ public class OperateLogAspect { | ||
| 226 | private static void fillMethodFields(OperateLog operateLogObj, | 228 | private static void fillMethodFields(OperateLog operateLogObj, |
| 227 | ProceedingJoinPoint joinPoint, | 229 | ProceedingJoinPoint joinPoint, |
| 228 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | 230 | cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, |
| 229 | - Date startTime, Object result, Throwable exception) { | 231 | + LocalDateTime startTime, Object result, Throwable exception) { |
| 230 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); | 232 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); |
| 231 | operateLogObj.setJavaMethod(methodSignature.toString()); | 233 | operateLogObj.setJavaMethod(methodSignature.toString()); |
| 232 | if (operateLog == null || operateLog.logArgs()) { | 234 | if (operateLog == null || operateLog.logArgs()) { |
| @@ -235,7 +237,7 @@ public class OperateLogAspect { | @@ -235,7 +237,7 @@ public class OperateLogAspect { | ||
| 235 | if (operateLog == null || operateLog.logResultData()) { | 237 | if (operateLog == null || operateLog.logResultData()) { |
| 236 | operateLogObj.setResultData(obtainResultData(result)); | 238 | operateLogObj.setResultData(obtainResultData(result)); |
| 237 | } | 239 | } |
| 238 | - operateLogObj.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); | 240 | + operateLogObj.setDuration((int) (LocalDateTimeUtil.between(startTime, LocalDateTime.now()).toMillis())); |
| 239 | // (正常)处理 resultCode 和 resultMsg 字段 | 241 | // (正常)处理 resultCode 和 resultMsg 字段 |
| 240 | if (result instanceof CommonResult) { | 242 | if (result instanceof CommonResult) { |
| 241 | CommonResult<?> commonResult = (CommonResult<?>) result; | 243 | CommonResult<?> commonResult = (CommonResult<?>) result; |
yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/service/OperateLog.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.operatelog.core.service; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.operatelog.core.service; | ||
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | -import java.util.Date; | 5 | +import java.time.LocalDateTime; |
| 6 | import java.util.Map; | 6 | import java.util.Map; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| @@ -85,7 +85,7 @@ public class OperateLog { | @@ -85,7 +85,7 @@ public class OperateLog { | ||
| 85 | /** | 85 | /** |
| 86 | * 开始时间 | 86 | * 开始时间 |
| 87 | */ | 87 | */ |
| 88 | - private Date startTime; | 88 | + private LocalDateTime startTime; |
| 89 | 89 | ||
| 90 | /** | 90 | /** |
| 91 | * 执行时长,单位:毫秒 | 91 | * 执行时长,单位:毫秒 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/YudaoPayAutoConfiguration.java
| @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; | @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 11 | * | 11 | * |
| 12 | * @author 芋道源码 | 12 | * @author 芋道源码 |
| 13 | */ | 13 | */ |
| 14 | -@Configuration | 14 | +@Configuration(proxyBeanMethods = false) |
| 15 | @EnableConfigurationProperties(PayProperties.class) | 15 | @EnableConfigurationProperties(PayProperties.class) |
| 16 | public class YudaoPayAutoConfiguration { | 16 | public class YudaoPayAutoConfiguration { |
| 17 | 17 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderNotifyRespDTO.java
| @@ -5,7 +5,7 @@ import lombok.Builder; | @@ -5,7 +5,7 @@ import lombok.Builder; | ||
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | import lombok.NoArgsConstructor; | 6 | import lombok.NoArgsConstructor; |
| 7 | 7 | ||
| 8 | -import java.util.Date; | 8 | +import java.time.LocalDateTime; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 支付通知 Response DTO | 11 | * 支付通知 Response DTO |
| @@ -33,7 +33,7 @@ public class PayOrderNotifyRespDTO { | @@ -33,7 +33,7 @@ public class PayOrderNotifyRespDTO { | ||
| 33 | /** | 33 | /** |
| 34 | * 支付成功时间 | 34 | * 支付成功时间 |
| 35 | */ | 35 | */ |
| 36 | - private Date successTime; | 36 | + private LocalDateTime successTime; |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * 通知的原始数据 | 39 | * 通知的原始数据 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayOrderUnifiedReqDTO.java
| @@ -7,7 +7,7 @@ import org.hibernate.validator.constraints.URL; | @@ -7,7 +7,7 @@ import org.hibernate.validator.constraints.URL; | ||
| 7 | import javax.validation.constraints.DecimalMin; | 7 | import javax.validation.constraints.DecimalMin; |
| 8 | import javax.validation.constraints.NotEmpty; | 8 | import javax.validation.constraints.NotEmpty; |
| 9 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 10 | -import java.util.Date; | 10 | +import java.time.LocalDateTime; |
| 11 | import java.util.Map; | 11 | import java.util.Map; |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| @@ -68,7 +68,7 @@ public class PayOrderUnifiedReqDTO { | @@ -68,7 +68,7 @@ public class PayOrderUnifiedReqDTO { | ||
| 68 | * 支付过期时间 | 68 | * 支付过期时间 |
| 69 | */ | 69 | */ |
| 70 | @NotNull(message = "支付过期时间不能为空") | 70 | @NotNull(message = "支付过期时间不能为空") |
| 71 | - private Date expireTime; | 71 | + private LocalDateTime expireTime; |
| 72 | 72 | ||
| 73 | // ========== 拓展参数 ========== | 73 | // ========== 拓展参数 ========== |
| 74 | /** | 74 | /** |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/PayRefundNotifyDTO.java
| @@ -5,7 +5,7 @@ import lombok.Builder; | @@ -5,7 +5,7 @@ import lombok.Builder; | ||
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | import lombok.ToString; | 6 | import lombok.ToString; |
| 7 | 7 | ||
| 8 | -import java.util.Date; | 8 | +import java.time.LocalDateTime; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 从渠道返回数据中解析得到的支付退款通知的Notify DTO | 11 | * 从渠道返回数据中解析得到的支付退款通知的Notify DTO |
| @@ -57,7 +57,7 @@ public class PayRefundNotifyDTO { | @@ -57,7 +57,7 @@ public class PayRefundNotifyDTO { | ||
| 57 | /** | 57 | /** |
| 58 | * 退款成功时间 | 58 | * 退款成功时间 |
| 59 | */ | 59 | */ |
| 60 | - private Date refundSuccessTime; | 60 | + private LocalDateTime refundSuccessTime; |
| 61 | 61 | ||
| 62 | 62 | ||
| 63 | } | 63 | } |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayClient.java
| 1 | package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; | 1 | package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | -import cn.hutool.core.date.DateUtil; | ||
| 5 | -import cn.hutool.http.HttpUtil; | 4 | +import cn.hutool.core.date.LocalDateTimeUtil; |
| 6 | import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping; | 5 | import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping; |
| 7 | import cn.iocoder.yudao.framework.pay.core.client.PayCommonResult; | 6 | import cn.iocoder.yudao.framework.pay.core.client.PayCommonResult; |
| 8 | import cn.iocoder.yudao.framework.pay.core.client.dto.*; | 7 | import cn.iocoder.yudao.framework.pay.core.client.dto.*; |
| @@ -61,7 +60,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl | @@ -61,7 +60,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl | ||
| 61 | return PayOrderNotifyRespDTO.builder().orderExtensionNo(params.get("out_trade_no")) | 60 | return PayOrderNotifyRespDTO.builder().orderExtensionNo(params.get("out_trade_no")) |
| 62 | .channelOrderNo(params.get("trade_no")).channelUserId(params.get("seller_id")) | 61 | .channelOrderNo(params.get("trade_no")).channelUserId(params.get("seller_id")) |
| 63 | .tradeStatus(params.get("trade_status")) | 62 | .tradeStatus(params.get("trade_status")) |
| 64 | - .successTime(DateUtil.parse(params.get("notify_time"), "yyyy-MM-dd HH:mm:ss")) | 63 | + .successTime(LocalDateTimeUtil.parse(params.get("notify_time"), "yyyy-MM-dd HH:mm:ss")) |
| 65 | .data(data.getBody()).build(); | 64 | .data(data.getBody()).build(); |
| 66 | } | 65 | } |
| 67 | 66 | ||
| @@ -72,7 +71,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl | @@ -72,7 +71,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl | ||
| 72 | .tradeNo(params.get("out_trade_no")) | 71 | .tradeNo(params.get("out_trade_no")) |
| 73 | .reqNo(params.get("out_biz_no")) | 72 | .reqNo(params.get("out_biz_no")) |
| 74 | .status(PayNotifyRefundStatusEnum.SUCCESS) | 73 | .status(PayNotifyRefundStatusEnum.SUCCESS) |
| 75 | - .refundSuccessTime(DateUtil.parse(params.get("gmt_refund"), "yyyy-MM-dd HH:mm:ss")) | 74 | + .refundSuccessTime(LocalDateTimeUtil.parse(params.get("gmt_refund"), "yyyy-MM-dd HH:mm:ss")) |
| 76 | .build(); | 75 | .build(); |
| 77 | return notifyDTO; | 76 | return notifyDTO; |
| 78 | } | 77 | } |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXLitePayClient.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.date.DateUtil; | 4 | import cn.hutool.core.date.DateUtil; |
| 5 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 5 | import cn.hutool.core.lang.Assert; | 6 | import cn.hutool.core.lang.Assert; |
| 6 | import cn.hutool.core.map.MapUtil; | 7 | import cn.hutool.core.map.MapUtil; |
| 7 | import cn.hutool.core.util.StrUtil; | 8 | import cn.hutool.core.util.StrUtil; |
| @@ -49,7 +50,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -49,7 +50,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 49 | @Override | 50 | @Override |
| 50 | protected void doInit() { | 51 | protected void doInit() { |
| 51 | WxPayConfig payConfig = new WxPayConfig(); | 52 | WxPayConfig payConfig = new WxPayConfig(); |
| 52 | - BeanUtil.copyProperties(config, payConfig, "keyContent"); | 53 | + BeanUtil.copyProperties(config, payConfig, "privateKeyContent","privateCertContent"); |
| 53 | payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // 设置使用 JS API 支付方式 | 54 | payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); // 设置使用 JS API 支付方式 |
| 54 | // if (StrUtil.isNotEmpty(config.getKeyContent())) { | 55 | // if (StrUtil.isNotEmpty(config.getKeyContent())) { |
| 55 | // payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8)); | 56 | // payConfig.setKeyContent(config.getKeyContent().getBytes(StandardCharsets.UTF_8)); |
| @@ -167,7 +168,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -167,7 +168,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 167 | .builder() | 168 | .builder() |
| 168 | .orderExtensionNo(result.getOutTradeNo()) | 169 | .orderExtensionNo(result.getOutTradeNo()) |
| 169 | .channelOrderNo(result.getTradeState()) | 170 | .channelOrderNo(result.getTradeState()) |
| 170 | - .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) | 171 | + .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 171 | .data(data.getBody()) | 172 | .data(data.getBody()) |
| 172 | .build(); | 173 | .build(); |
| 173 | } | 174 | } |
| @@ -181,7 +182,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -181,7 +182,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 181 | .orderExtensionNo(notifyResult.getOutTradeNo()) | 182 | .orderExtensionNo(notifyResult.getOutTradeNo()) |
| 182 | .channelOrderNo(notifyResult.getTransactionId()) | 183 | .channelOrderNo(notifyResult.getTransactionId()) |
| 183 | .channelUserId(notifyResult.getOpenid()) | 184 | .channelUserId(notifyResult.getOpenid()) |
| 184 | - .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) | 185 | + .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) |
| 185 | .data(data.getBody()) | 186 | .data(data.getBody()) |
| 186 | .build(); | 187 | .build(); |
| 187 | 188 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXNativePayClient.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.date.DateUtil; | 4 | import cn.hutool.core.date.DateUtil; |
| 5 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 5 | import cn.hutool.core.lang.Assert; | 6 | import cn.hutool.core.lang.Assert; |
| 6 | import cn.hutool.core.util.StrUtil; | 7 | import cn.hutool.core.util.StrUtil; |
| 7 | import cn.iocoder.yudao.framework.common.util.io.FileUtils; | 8 | import cn.iocoder.yudao.framework.common.util.io.FileUtils; |
| @@ -150,7 +151,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -150,7 +151,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 150 | .builder() | 151 | .builder() |
| 151 | .orderExtensionNo(result.getOutTradeNo()) | 152 | .orderExtensionNo(result.getOutTradeNo()) |
| 152 | .channelOrderNo(result.getTradeState()) | 153 | .channelOrderNo(result.getTradeState()) |
| 153 | - .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) | 154 | + .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 154 | .data(data.getBody()) | 155 | .data(data.getBody()) |
| 155 | .build(); | 156 | .build(); |
| 156 | } | 157 | } |
| @@ -164,7 +165,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -164,7 +165,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 164 | .orderExtensionNo(notifyResult.getOutTradeNo()) | 165 | .orderExtensionNo(notifyResult.getOutTradeNo()) |
| 165 | .channelOrderNo(notifyResult.getTransactionId()) | 166 | .channelOrderNo(notifyResult.getTransactionId()) |
| 166 | .channelUserId(notifyResult.getOpenid()) | 167 | .channelUserId(notifyResult.getOpenid()) |
| 167 | - .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) | 168 | + .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) |
| 168 | .data(data.getBody()) | 169 | .data(data.getBody()) |
| 169 | .build(); | 170 | .build(); |
| 170 | 171 |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/wx/WXPubPayClient.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.date.DateUtil; | 4 | import cn.hutool.core.date.DateUtil; |
| 5 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 5 | import cn.hutool.core.lang.Assert; | 6 | import cn.hutool.core.lang.Assert; |
| 6 | import cn.hutool.core.map.MapUtil; | 7 | import cn.hutool.core.map.MapUtil; |
| 7 | import cn.hutool.core.util.StrUtil; | 8 | import cn.hutool.core.util.StrUtil; |
| @@ -161,7 +162,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -161,7 +162,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 161 | .builder() | 162 | .builder() |
| 162 | .orderExtensionNo(result.getOutTradeNo()) | 163 | .orderExtensionNo(result.getOutTradeNo()) |
| 163 | .channelOrderNo(result.getTradeState()) | 164 | .channelOrderNo(result.getTradeState()) |
| 164 | - .successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) | 165 | + .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) |
| 165 | .data(data.getBody()) | 166 | .data(data.getBody()) |
| 166 | .build(); | 167 | .build(); |
| 167 | } | 168 | } |
| @@ -175,7 +176,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | @@ -175,7 +176,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> { | ||
| 175 | .orderExtensionNo(notifyResult.getOutTradeNo()) | 176 | .orderExtensionNo(notifyResult.getOutTradeNo()) |
| 176 | .channelOrderNo(notifyResult.getTransactionId()) | 177 | .channelOrderNo(notifyResult.getTransactionId()) |
| 177 | .channelUserId(notifyResult.getOpenid()) | 178 | .channelUserId(notifyResult.getOpenid()) |
| 178 | - .successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) | 179 | + .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) |
| 179 | .data(data.getBody()) | 180 | .data(data.getBody()) |
| 180 | .build(); | 181 | .build(); |
| 181 | 182 |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/config/YudaoSmsAutoConfiguration.java
| @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; | @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 10 | * | 10 | * |
| 11 | * @author 芋道源码 | 11 | * @author 芋道源码 |
| 12 | */ | 12 | */ |
| 13 | -@Configuration | 13 | +@Configuration(proxyBeanMethods = false) |
| 14 | public class YudaoSmsAutoConfiguration { | 14 | public class YudaoSmsAutoConfiguration { |
| 15 | 15 | ||
| 16 | @Bean | 16 | @Bean |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsReceiveRespDTO.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.sms.core.client.dto; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.sms.core.client.dto; | ||
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | -import java.util.Date; | 5 | +import java.time.LocalDateTime; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| 8 | * 消息接收 Response DTO | 8 | * 消息接收 Response DTO |
| @@ -32,7 +32,7 @@ public class SmsReceiveRespDTO { | @@ -32,7 +32,7 @@ public class SmsReceiveRespDTO { | ||
| 32 | /** | 32 | /** |
| 33 | * 用户接收时间 | 33 | * 用户接收时间 |
| 34 | */ | 34 | */ |
| 35 | - private Date receiveTime; | 35 | + private LocalDateTime receiveTime; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 短信 API 发送返回的序号 | 38 | * 短信 API 发送返回的序号 |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java
| @@ -28,7 +28,7 @@ import com.google.common.annotations.VisibleForTesting; | @@ -28,7 +28,7 @@ import com.google.common.annotations.VisibleForTesting; | ||
| 28 | import lombok.Data; | 28 | import lombok.Data; |
| 29 | import lombok.extern.slf4j.Slf4j; | 29 | import lombok.extern.slf4j.Slf4j; |
| 30 | 30 | ||
| 31 | -import java.util.Date; | 31 | +import java.time.LocalDateTime; |
| 32 | import java.util.List; | 32 | import java.util.List; |
| 33 | import java.util.Objects; | 33 | import java.util.Objects; |
| 34 | import java.util.function.Function; | 34 | import java.util.function.Function; |
| @@ -166,13 +166,13 @@ public class AliyunSmsClient extends AbstractSmsClient { | @@ -166,13 +166,13 @@ public class AliyunSmsClient extends AbstractSmsClient { | ||
| 166 | */ | 166 | */ |
| 167 | @JsonProperty("send_time") | 167 | @JsonProperty("send_time") |
| 168 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | 168 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) |
| 169 | - private Date sendTime; | 169 | + private LocalDateTime sendTime; |
| 170 | /** | 170 | /** |
| 171 | * 状态报告时间 | 171 | * 状态报告时间 |
| 172 | */ | 172 | */ |
| 173 | @JsonProperty("report_time") | 173 | @JsonProperty("report_time") |
| 174 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | 174 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) |
| 175 | - private Date reportTime; | 175 | + private LocalDateTime reportTime; |
| 176 | /** | 176 | /** |
| 177 | * 是否接收成功 | 177 | * 是否接收成功 |
| 178 | */ | 178 | */ |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/tencent/TencentSmsClient.java
| @@ -22,7 +22,7 @@ import com.tencentcloudapi.sms.v20210111.SmsClient; | @@ -22,7 +22,7 @@ import com.tencentcloudapi.sms.v20210111.SmsClient; | ||
| 22 | import com.tencentcloudapi.sms.v20210111.models.*; | 22 | import com.tencentcloudapi.sms.v20210111.models.*; |
| 23 | import lombok.Data; | 23 | import lombok.Data; |
| 24 | 24 | ||
| 25 | -import java.util.Date; | 25 | +import java.time.LocalDateTime; |
| 26 | import java.util.List; | 26 | import java.util.List; |
| 27 | import java.util.function.Function; | 27 | import java.util.function.Function; |
| 28 | import java.util.function.Supplier; | 28 | import java.util.function.Supplier; |
| @@ -240,7 +240,7 @@ public class TencentSmsClient extends AbstractSmsClient { | @@ -240,7 +240,7 @@ public class TencentSmsClient extends AbstractSmsClient { | ||
| 240 | */ | 240 | */ |
| 241 | @JsonProperty("user_receive_time") | 241 | @JsonProperty("user_receive_time") |
| 242 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | 242 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) |
| 243 | - private Date receiveTime; | 243 | + private LocalDateTime receiveTime; |
| 244 | 244 | ||
| 245 | /** | 245 | /** |
| 246 | * 国家(或地区)码 | 246 | * 国家(或地区)码 |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java
| @@ -2,9 +2,11 @@ package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; | @@ -2,9 +2,11 @@ package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.lang.Assert; | 4 | import cn.hutool.core.lang.Assert; |
| 5 | +import cn.hutool.core.util.NumberUtil; | ||
| 5 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| 6 | import cn.hutool.core.util.URLUtil; | 7 | import cn.hutool.core.util.URLUtil; |
| 7 | import cn.iocoder.yudao.framework.common.core.KeyValue; | 8 | import cn.iocoder.yudao.framework.common.core.KeyValue; |
| 9 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 8 | import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; | 10 | import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; |
| 9 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; | 11 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; |
| 10 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | 12 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; |
| @@ -12,7 +14,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | @@ -12,7 +14,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | ||
| 12 | import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient; | 14 | import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient; |
| 13 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; | 15 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; |
| 14 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | 16 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; |
| 15 | -import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
| 16 | import com.fasterxml.jackson.annotation.JsonFormat; | 17 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 17 | import com.fasterxml.jackson.annotation.JsonProperty; | 18 | import com.fasterxml.jackson.annotation.JsonProperty; |
| 18 | import com.google.common.annotations.VisibleForTesting; | 19 | import com.google.common.annotations.VisibleForTesting; |
| @@ -23,6 +24,7 @@ import com.yunpian.sdk.model.Template; | @@ -23,6 +24,7 @@ import com.yunpian.sdk.model.Template; | ||
| 23 | import lombok.Data; | 24 | import lombok.Data; |
| 24 | import lombok.extern.slf4j.Slf4j; | 25 | import lombok.extern.slf4j.Slf4j; |
| 25 | 26 | ||
| 27 | +import java.time.LocalDateTime; | ||
| 26 | import java.util.*; | 28 | import java.util.*; |
| 27 | import java.util.function.Function; | 29 | import java.util.function.Function; |
| 28 | import java.util.function.Supplier; | 30 | import java.util.function.Supplier; |
| @@ -104,6 +106,9 @@ public class YunpianSmsClient extends AbstractSmsClient { | @@ -104,6 +106,9 @@ public class YunpianSmsClient extends AbstractSmsClient { | ||
| 104 | @Override | 106 | @Override |
| 105 | protected SmsCommonResult<SmsTemplateRespDTO> doGetSmsTemplate(String apiTemplateId) throws Throwable { | 107 | protected SmsCommonResult<SmsTemplateRespDTO> doGetSmsTemplate(String apiTemplateId) throws Throwable { |
| 106 | return invoke(() -> { | 108 | return invoke(() -> { |
| 109 | + if (!NumberUtil.isNumber(apiTemplateId)) { | ||
| 110 | + throw new IllegalArgumentException("云片的 API 模板编号必须为整数"); | ||
| 111 | + } | ||
| 107 | Map<String, String> request = new HashMap<>(); | 112 | Map<String, String> request = new HashMap<>(); |
| 108 | request.put(YunpianConstant.APIKEY, properties.getApiKey()); | 113 | request.put(YunpianConstant.APIKEY, properties.getApiKey()); |
| 109 | request.put(YunpianConstant.TPL_ID, apiTemplateId); | 114 | request.put(YunpianConstant.TPL_ID, apiTemplateId); |
| @@ -198,7 +203,7 @@ public class YunpianSmsClient extends AbstractSmsClient { | @@ -198,7 +203,7 @@ public class YunpianSmsClient extends AbstractSmsClient { | ||
| 198 | */ | 203 | */ |
| 199 | @JsonProperty("user_receive_time") | 204 | @JsonProperty("user_receive_time") |
| 200 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | 205 | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) |
| 201 | - private Date userReceiveTime; | 206 | + private LocalDateTime userReceiveTime; |
| 202 | 207 | ||
| 203 | } | 208 | } |
| 204 | 209 |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java
| @@ -11,7 +11,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | @@ -11,7 +11,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | ||
| 11 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; | 11 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; |
| 12 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | 12 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; |
| 13 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 13 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 14 | -import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||
| 15 | import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; | 14 | import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; |
| 16 | import com.aliyuncs.AcsRequest; | 15 | import com.aliyuncs.AcsRequest; |
| 17 | import com.aliyuncs.IAcsClient; | 16 | import com.aliyuncs.IAcsClient; |
| @@ -27,6 +26,7 @@ import org.mockito.ArgumentMatcher; | @@ -27,6 +26,7 @@ import org.mockito.ArgumentMatcher; | ||
| 27 | import org.mockito.InjectMocks; | 26 | import org.mockito.InjectMocks; |
| 28 | import org.mockito.Mock; | 27 | import org.mockito.Mock; |
| 29 | 28 | ||
| 29 | +import java.time.LocalDateTime; | ||
| 30 | import java.util.List; | 30 | import java.util.List; |
| 31 | import java.util.function.Function; | 31 | import java.util.function.Function; |
| 32 | 32 | ||
| @@ -125,7 +125,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest { | @@ -125,7 +125,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest { | ||
| 125 | assertEquals("DELIVERED", statuses.get(0).getErrorCode()); | 125 | assertEquals("DELIVERED", statuses.get(0).getErrorCode()); |
| 126 | assertEquals("用户接收成功", statuses.get(0).getErrorMsg()); | 126 | assertEquals("用户接收成功", statuses.get(0).getErrorMsg()); |
| 127 | assertEquals("13900000001", statuses.get(0).getMobile()); | 127 | assertEquals("13900000001", statuses.get(0).getMobile()); |
| 128 | - assertEquals(DateUtils.buildTime(2017, 2, 2, 22, 23, 24), statuses.get(0).getReceiveTime()); | 128 | + assertEquals(LocalDateTime.of(2017, 2, 2, 22, 23, 24), statuses.get(0).getReceiveTime()); |
| 129 | assertEquals("12345", statuses.get(0).getSerialNo()); | 129 | assertEquals("12345", statuses.get(0).getSerialNo()); |
| 130 | assertEquals(67890L, statuses.get(0).getLogId()); | 130 | assertEquals(67890L, statuses.get(0).getLogId()); |
| 131 | } | 131 | } |
| @@ -181,7 +181,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest { | @@ -181,7 +181,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest { | ||
| 181 | when(client.getAcsResponse(any(AcsRequest.class))).thenThrow(ex); | 181 | when(client.getAcsResponse(any(AcsRequest.class))).thenThrow(ex); |
| 182 | 182 | ||
| 183 | // 调用,并断言异常 | 183 | // 调用,并断言异常 |
| 184 | - SmsCommonResult<?> result = smsClient.invoke(request,null); | 184 | + SmsCommonResult<?> result = smsClient.invoke(request, null); |
| 185 | // 断言 | 185 | // 断言 |
| 186 | assertEquals(ex.getErrCode(), result.getApiCode()); | 186 | assertEquals(ex.getErrCode(), result.getApiCode()); |
| 187 | assertEquals(ex.getErrMsg(), result.getApiMsg()); | 187 | assertEquals(ex.getErrMsg(), result.getApiMsg()); |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/tencent/TencentSmsClientTest.java
| @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.core.KeyValue; | ||
| 6 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; | 6 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; |
| 7 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; | 7 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 8 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 8 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 9 | -import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||
| 10 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 9 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 11 | import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; | 10 | import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; |
| 12 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; | 11 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; |
| @@ -25,6 +24,7 @@ import org.junit.jupiter.api.Test; | @@ -25,6 +24,7 @@ import org.junit.jupiter.api.Test; | ||
| 25 | import org.mockito.InjectMocks; | 24 | import org.mockito.InjectMocks; |
| 26 | import org.mockito.Mock; | 25 | import org.mockito.Mock; |
| 27 | 26 | ||
| 27 | +import java.time.LocalDateTime; | ||
| 28 | import java.util.ArrayList; | 28 | import java.util.ArrayList; |
| 29 | import java.util.List; | 29 | import java.util.List; |
| 30 | 30 | ||
| @@ -146,7 +146,7 @@ public class TencentSmsClientTest extends BaseMockitoUnitTest { | @@ -146,7 +146,7 @@ public class TencentSmsClientTest extends BaseMockitoUnitTest { | ||
| 146 | assertEquals("DELIVRD", statuses.get(0).getErrorCode()); | 146 | assertEquals("DELIVRD", statuses.get(0).getErrorCode()); |
| 147 | assertEquals("用户短信送达成功", statuses.get(0).getErrorMsg()); | 147 | assertEquals("用户短信送达成功", statuses.get(0).getErrorMsg()); |
| 148 | assertEquals("13900000001", statuses.get(0).getMobile()); | 148 | assertEquals("13900000001", statuses.get(0).getMobile()); |
| 149 | - assertEquals(DateUtils.buildTime(2015, 10, 17, 8, 3, 4), statuses.get(0).getReceiveTime()); | 149 | + assertEquals(LocalDateTime.of(2015, 10, 17, 8, 3, 4), statuses.get(0).getReceiveTime()); |
| 150 | assertEquals("12345", statuses.get(0).getSerialNo()); | 150 | assertEquals("12345", statuses.get(0).getSerialNo()); |
| 151 | assertEquals(67890L, statuses.get(0).getLogId()); | 151 | assertEquals(67890L, statuses.get(0).getLogId()); |
| 152 | } | 152 | } |
yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java
| @@ -10,7 +10,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | @@ -10,7 +10,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; | ||
| 10 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; | 10 | import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; |
| 11 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; | 11 | import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; |
| 12 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; | 12 | import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; |
| 13 | -import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||
| 14 | import com.google.common.collect.Lists; | 13 | import com.google.common.collect.Lists; |
| 15 | import com.yunpian.sdk.YunpianClient; | 14 | import com.yunpian.sdk.YunpianClient; |
| 16 | import com.yunpian.sdk.api.SmsApi; | 15 | import com.yunpian.sdk.api.SmsApi; |
| @@ -23,6 +22,7 @@ import org.junit.jupiter.api.Test; | @@ -23,6 +22,7 @@ import org.junit.jupiter.api.Test; | ||
| 23 | import org.mockito.InjectMocks; | 22 | import org.mockito.InjectMocks; |
| 24 | import org.mockito.Mock; | 23 | import org.mockito.Mock; |
| 25 | 24 | ||
| 25 | +import java.time.LocalDateTime; | ||
| 26 | import java.util.HashMap; | 26 | import java.util.HashMap; |
| 27 | import java.util.List; | 27 | import java.util.List; |
| 28 | import java.util.Map; | 28 | import java.util.Map; |
| @@ -115,7 +115,7 @@ public class YunpianSmsClientTest extends BaseMockitoUnitTest { | @@ -115,7 +115,7 @@ public class YunpianSmsClientTest extends BaseMockitoUnitTest { | ||
| 115 | assertEquals("", statuses.get(0).getErrorCode()); | 115 | assertEquals("", statuses.get(0).getErrorCode()); |
| 116 | assertNull(statuses.get(0).getErrorMsg()); | 116 | assertNull(statuses.get(0).getErrorMsg()); |
| 117 | assertEquals("15205201314", statuses.get(0).getMobile()); | 117 | assertEquals("15205201314", statuses.get(0).getMobile()); |
| 118 | - assertEquals(DateUtils.buildTime(2014, 3, 17, 22, 55, 21), statuses.get(0).getReceiveTime()); | 118 | + assertEquals(LocalDateTime.of(2014, 3, 17, 22, 55, 21), statuses.get(0).getReceiveTime()); |
| 119 | assertEquals("9527", statuses.get(0).getSerialNo()); | 119 | assertEquals("9527", statuses.get(0).getSerialNo()); |
| 120 | assertEquals(1024L, statuses.get(0).getLogId()); | 120 | assertEquals(1024L, statuses.get(0).getLogId()); |
| 121 | } | 121 | } |
yudao-framework/yudao-spring-boot-starter-biz-social/src/main/java/cn/iocoder/yudao/framework/social/config/YudaoSocialAutoConfiguration.java
| @@ -19,7 +19,7 @@ import org.springframework.context.annotation.Primary; | @@ -19,7 +19,7 @@ import org.springframework.context.annotation.Primary; | ||
| 19 | * @date 2021-10-30 | 19 | * @date 2021-10-30 |
| 20 | */ | 20 | */ |
| 21 | @Slf4j | 21 | @Slf4j |
| 22 | -@Configuration | 22 | +@Configuration(proxyBeanMethods = false) |
| 23 | @EnableConfigurationProperties(JustAuthProperties.class) | 23 | @EnableConfigurationProperties(JustAuthProperties.class) |
| 24 | public class YudaoSocialAutoConfiguration { | 24 | public class YudaoSocialAutoConfiguration { |
| 25 | 25 |
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/config/YudaoTenantAutoConfiguration.java
| @@ -35,7 +35,7 @@ import org.springframework.data.redis.core.RedisTemplate; | @@ -35,7 +35,7 @@ import org.springframework.data.redis.core.RedisTemplate; | ||
| 35 | 35 | ||
| 36 | import java.util.Objects; | 36 | import java.util.Objects; |
| 37 | 37 | ||
| 38 | -@Configuration | 38 | +@Configuration(proxyBeanMethods = false) |
| 39 | @ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) // 允许使用 yudao.tenant.enable=false 禁用多租户 | 39 | @ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) // 允许使用 yudao.tenant.enable=false 禁用多租户 |
| 40 | @EnableConfigurationProperties(TenantProperties.class) | 40 | @EnableConfigurationProperties(TenantProperties.class) |
| 41 | public class YudaoTenantAutoConfiguration { | 41 | public class YudaoTenantAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java
| @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Bean; | @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Bean; | ||
| 8 | import org.springframework.context.annotation.Configuration; | 8 | import org.springframework.context.annotation.Configuration; |
| 9 | import org.springframework.data.redis.core.StringRedisTemplate; | 9 | import org.springframework.data.redis.core.StringRedisTemplate; |
| 10 | 10 | ||
| 11 | -@Configuration | 11 | +@Configuration(proxyBeanMethods = false) |
| 12 | public class YudaoCaptchaConfiguration { | 12 | public class YudaoCaptchaConfiguration { |
| 13 | 13 | ||
| 14 | static { | 14 | static { |
yudao-framework/yudao-spring-boot-starter-config/pom.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | - <parent> | ||
| 6 | - <groupId>cn.iocoder.boot</groupId> | ||
| 7 | - <artifactId>yudao-framework</artifactId> | ||
| 8 | - <version>${revision}</version> | ||
| 9 | - </parent> | ||
| 10 | - <modelVersion>4.0.0</modelVersion> | ||
| 11 | - <artifactId>yudao-spring-boot-starter-config</artifactId> | ||
| 12 | - <packaging>jar</packaging> | ||
| 13 | - | ||
| 14 | - <name>${project.artifactId}</name> | ||
| 15 | - <description>配置中心,基于 Apollo 魔改实现</description> | ||
| 16 | - <url>https://github.com/YunaiV/ruoyi-vue-pro</url> | ||
| 17 | - | ||
| 18 | - <dependencies> | ||
| 19 | - <dependency> | ||
| 20 | - <groupId>cn.iocoder.boot</groupId> | ||
| 21 | - <artifactId>yudao-common</artifactId> | ||
| 22 | - </dependency> | ||
| 23 | - | ||
| 24 | - <!-- Spring 核心 --> | ||
| 25 | - <dependency> | ||
| 26 | - <groupId>org.springframework.boot</groupId> | ||
| 27 | - <artifactId>spring-boot-starter</artifactId> | ||
| 28 | - </dependency> | ||
| 29 | - | ||
| 30 | - <!-- Config 配置中心相关 --> | ||
| 31 | - <dependency> | ||
| 32 | - <groupId>com.ctrip.framework.apollo</groupId> | ||
| 33 | - <artifactId>apollo-client</artifactId> <!-- 引入 Apollo Client 库,实现内嵌的配置中心 --> | ||
| 34 | - </dependency> | ||
| 35 | - </dependencies> | ||
| 36 | - | ||
| 37 | -</project> |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/ConfigConsts.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.core; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.apollo.internals.ConfigFrameworkDAO; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * 针对 {@link com.ctrip.framework.apollo.core.ConfigConsts} 的补充,主要增加: | ||
| 7 | - * | ||
| 8 | - * 1. apollo.jdbc.* 配置项的枚举 | ||
| 9 | - * | ||
| 10 | - * @author 芋道源码 | ||
| 11 | - */ | ||
| 12 | -public class ConfigConsts { | ||
| 13 | - | ||
| 14 | - /** | ||
| 15 | - * {@link ConfigFrameworkDAO} 的实现类 | ||
| 16 | - */ | ||
| 17 | - public static final String APOLLO_JDBC_DAO = "apollo.jdbc.dao"; | ||
| 18 | - public static final String APOLLO_JDBC_URL = "apollo.jdbc.url"; | ||
| 19 | - public static final String APOLLO_JDBC_USERNAME = "apollo.jdbc.username"; | ||
| 20 | - public static final String APOLLO_JDBC_PASSWORD = "apollo.jdbc.password"; | ||
| 21 | - | ||
| 22 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/ConfigFrameworkDAO.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.internals; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; | ||
| 4 | - | ||
| 5 | -import java.util.Date; | ||
| 6 | -import java.util.List; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 配置 Framework DAO 接口 | ||
| 10 | - * | ||
| 11 | - * 注意,实现类必须提供 (String jdbcUrl, String username, String password) 构造方法 | ||
| 12 | - * | ||
| 13 | - * @author 芋道源码 | ||
| 14 | - */ | ||
| 15 | -public interface ConfigFrameworkDAO { | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * 查询是否存在比 maxUpdateTime 的更新记录数量 | ||
| 19 | - * | ||
| 20 | - * @param maxUpdateTime 最大更新时间 | ||
| 21 | - * @return 是否存在 | ||
| 22 | - */ | ||
| 23 | - int selectCountByUpdateTimeGt(Date maxUpdateTime); | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 查询配置列表 | ||
| 27 | - * | ||
| 28 | - * @return 配置列表 | ||
| 29 | - */ | ||
| 30 | - List<ConfigRespDTO> selectList(); | ||
| 31 | - | ||
| 32 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DBConfigRepository.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.internals; | ||
| 2 | - | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | -import cn.hutool.core.util.ClassUtil; | ||
| 5 | -import cn.hutool.core.util.ReflectUtil; | ||
| 6 | -import cn.iocoder.yudao.framework.apollo.core.ConfigConsts; | ||
| 7 | -import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; | ||
| 8 | -import com.ctrip.framework.apollo.Apollo; | ||
| 9 | -import com.ctrip.framework.apollo.build.ApolloInjector; | ||
| 10 | -import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; | ||
| 11 | -import com.ctrip.framework.apollo.enums.ConfigSourceType; | ||
| 12 | -import com.ctrip.framework.apollo.internals.AbstractConfigRepository; | ||
| 13 | -import com.ctrip.framework.apollo.internals.ConfigRepository; | ||
| 14 | -import com.ctrip.framework.apollo.tracer.Tracer; | ||
| 15 | -import com.ctrip.framework.apollo.util.ConfigUtil; | ||
| 16 | -import com.ctrip.framework.apollo.util.factory.PropertiesFactory; | ||
| 17 | -import lombok.SneakyThrows; | ||
| 18 | -import lombok.extern.slf4j.Slf4j; | ||
| 19 | - | ||
| 20 | -import java.lang.reflect.Constructor; | ||
| 21 | -import java.util.Comparator; | ||
| 22 | -import java.util.Date; | ||
| 23 | -import java.util.List; | ||
| 24 | -import java.util.Properties; | ||
| 25 | -import java.util.concurrent.Executors; | ||
| 26 | -import java.util.concurrent.ScheduledExecutorService; | ||
| 27 | - | ||
| 28 | -@Slf4j | ||
| 29 | -public class DBConfigRepository extends AbstractConfigRepository { | ||
| 30 | - | ||
| 31 | - private final static ScheduledExecutorService m_executorService; | ||
| 32 | - | ||
| 33 | - private static DBConfigRepository INSTANCE; | ||
| 34 | - | ||
| 35 | - static { | ||
| 36 | - m_executorService = Executors.newScheduledThreadPool(1, | ||
| 37 | - ApolloThreadFactory.create(DBConfigRepository.class.getSimpleName(), true)); | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - private final ConfigUtil m_configUtil; | ||
| 41 | - private final PropertiesFactory propertiesFactory; | ||
| 42 | - private final String m_namespace; | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * 配置缓存,使用 Properties 存储 | ||
| 46 | - */ | ||
| 47 | - private volatile Properties m_configCache; | ||
| 48 | - /** | ||
| 49 | - * 缓存配置的最大更新时间,用于后续的增量轮询,判断是否有更新 | ||
| 50 | - */ | ||
| 51 | - private volatile Date maxUpdateTime; | ||
| 52 | - | ||
| 53 | - /** | ||
| 54 | - * 配置读取 DAO | ||
| 55 | - */ | ||
| 56 | - private final ConfigFrameworkDAO configFrameworkDAO; | ||
| 57 | - | ||
| 58 | - public DBConfigRepository(String namespace) { | ||
| 59 | - // 初始化变量 | ||
| 60 | - this.m_namespace = namespace; | ||
| 61 | - this.propertiesFactory = ApolloInjector.getInstance(PropertiesFactory.class); | ||
| 62 | - this.m_configUtil = ApolloInjector.getInstance(ConfigUtil.class); | ||
| 63 | - // 初始化 DB | ||
| 64 | - this.configFrameworkDAO = createConfigFrameworkDAO(); | ||
| 65 | - | ||
| 66 | - // 初始化加载 | ||
| 67 | - this.trySync(); | ||
| 68 | - // 初始化定时任务 | ||
| 69 | - this.schedulePeriodicRefresh(); | ||
| 70 | - | ||
| 71 | - // 设置单例 | ||
| 72 | - INSTANCE = this; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - @SneakyThrows | ||
| 76 | - private static ConfigFrameworkDAO createConfigFrameworkDAO() { | ||
| 77 | - String dao = System.getProperty(ConfigConsts.APOLLO_JDBC_DAO); | ||
| 78 | - String url = System.getProperty(ConfigConsts.APOLLO_JDBC_URL); | ||
| 79 | - String username = System.getProperty(ConfigConsts.APOLLO_JDBC_USERNAME); | ||
| 80 | - String password = System.getProperty(ConfigConsts.APOLLO_JDBC_PASSWORD); | ||
| 81 | - // 创建 DBConfigRepository 对象 | ||
| 82 | - Class<? extends ConfigFrameworkDAO> clazz = ClassUtil.loadClass(dao); | ||
| 83 | - Constructor<? extends ConfigFrameworkDAO> constructor = ReflectUtil.getConstructor(clazz, String.class, String.class, String.class); | ||
| 84 | - return constructor.newInstance(url, username, password); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | - * 通知同步, | ||
| 89 | - */ | ||
| 90 | - public static void noticeSync() { | ||
| 91 | - // 提交到线程池中,避免和 schedulePeriodicRefresh 并发问题 | ||
| 92 | - m_executorService.submit(() -> { | ||
| 93 | - INSTANCE.trySync(); | ||
| 94 | - }); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - @Override | ||
| 98 | - protected void sync() { | ||
| 99 | - // 第一步,尝试获取配置 | ||
| 100 | - List<ConfigRespDTO> configs = this.loadConfigIfUpdate(this.maxUpdateTime); | ||
| 101 | - if (CollUtil.isEmpty(configs)) { // 如果没有更新,则返回 | ||
| 102 | - return; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - // 第二步,构建新的 Properties | ||
| 106 | - Properties newProperties = this.buildProperties(configs); | ||
| 107 | - this.m_configCache = newProperties; | ||
| 108 | - // 第三步,获取最大的配置时间 | ||
| 109 | - assert configs.size() > 0; // 断言,避免告警 | ||
| 110 | - this.maxUpdateTime = configs.stream().max(Comparator.comparing(ConfigRespDTO::getUpdateTime)).get().getUpdateTime(); | ||
| 111 | - // 第四部,触发配置刷新!重要!!!! | ||
| 112 | - super.fireRepositoryChange(m_namespace, newProperties); | ||
| 113 | - log.info("[sync][缓存配置,数量为:{}]", configs.size()); | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - @Override | ||
| 117 | - public Properties getConfig() { | ||
| 118 | - // 兜底,避免可能存在配置为 null 的情况 | ||
| 119 | - if (m_configCache == null) { | ||
| 120 | - this.trySync(); | ||
| 121 | - } | ||
| 122 | - // 返回配置 | ||
| 123 | - return m_configCache; | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - @Override | ||
| 127 | - public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) { | ||
| 128 | - // 啥事不做 | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - @Override | ||
| 132 | - public ConfigSourceType getSourceType() { | ||
| 133 | - return ConfigSourceType.REMOTE; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - private Properties buildProperties(List<ConfigRespDTO> configs) { | ||
| 137 | - Properties properties = propertiesFactory.getPropertiesInstance(); | ||
| 138 | - configs.stream().filter(config -> !config.getDeleted()) // 过滤掉被删除的配置 | ||
| 139 | - .forEach(config -> properties.put(config.getKey(), config.getValue())); | ||
| 140 | - return properties; | ||
| 141 | - } | ||
| 142 | - | ||
| 143 | - // ========== 定时器相关操作 ========== | ||
| 144 | - | ||
| 145 | - private void schedulePeriodicRefresh() { | ||
| 146 | - log.debug("Schedule periodic refresh with interval: {} {}", | ||
| 147 | - m_configUtil.getRefreshInterval(), m_configUtil.getRefreshIntervalTimeUnit()); | ||
| 148 | - m_executorService.scheduleAtFixedRate(() -> { | ||
| 149 | - Tracer.logEvent("Apollo.ConfigService", String.format("periodicRefresh: %s", m_namespace)); | ||
| 150 | - log.debug("refresh config for namespace: {}", m_namespace); | ||
| 151 | - | ||
| 152 | - // 执行同步. 内部已经 try catch 掉异常,无需在处理 | ||
| 153 | - trySync(); | ||
| 154 | - | ||
| 155 | - Tracer.logEvent("Apollo.Client.Version", Apollo.VERSION); | ||
| 156 | - }, m_configUtil.getRefreshInterval(), m_configUtil.getRefreshInterval(), | ||
| 157 | - m_configUtil.getRefreshIntervalTimeUnit()); | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - // ========== 数据库相关操作 ========== | ||
| 161 | - | ||
| 162 | - /** | ||
| 163 | - * 如果配置发生变化,从数据库中获取最新的全量配置。 | ||
| 164 | - * 如果未发生变化,则返回空 | ||
| 165 | - * | ||
| 166 | - * @param maxUpdateTime 当前配置的最大更新时间 | ||
| 167 | - * @return 配置列表 | ||
| 168 | - */ | ||
| 169 | - private List<ConfigRespDTO> loadConfigIfUpdate(Date maxUpdateTime) { | ||
| 170 | - // 第一步,判断是否要更新。 | ||
| 171 | - if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据 | ||
| 172 | - log.info("[loadConfigIfUpdate][首次加载全量配置]"); | ||
| 173 | - } else { // 判断数据库中是否有更新的配置 | ||
| 174 | - if (configFrameworkDAO.selectCountByUpdateTimeGt(maxUpdateTime) == 0) { | ||
| 175 | - return null; | ||
| 176 | - } | ||
| 177 | - log.info("[loadConfigIfUpdate][增量加载全量配置]"); | ||
| 178 | - } | ||
| 179 | - // 第二步,如果有更新,则从数据库加载所有配置 | ||
| 180 | - return configFrameworkDAO.selectList(); | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DefaultXInjector.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.internals; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.apollo.spi.DBConfigFactory; | ||
| 4 | -import com.ctrip.framework.apollo.exceptions.ApolloConfigException; | ||
| 5 | -import com.ctrip.framework.apollo.internals.*; | ||
| 6 | -import com.ctrip.framework.apollo.spi.*; | ||
| 7 | -import com.ctrip.framework.apollo.tracer.Tracer; | ||
| 8 | -import com.ctrip.framework.apollo.util.ConfigUtil; | ||
| 9 | -import com.ctrip.framework.apollo.util.factory.DefaultPropertiesFactory; | ||
| 10 | -import com.ctrip.framework.apollo.util.factory.PropertiesFactory; | ||
| 11 | -import com.ctrip.framework.apollo.util.http.DefaultHttpClient; | ||
| 12 | -import com.ctrip.framework.apollo.util.yaml.YamlParser; | ||
| 13 | -import com.google.inject.AbstractModule; | ||
| 14 | -import com.google.inject.Guice; | ||
| 15 | -import com.google.inject.Singleton; | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * Guice injector | ||
| 19 | - * | ||
| 20 | - * 基于 Guice 注入器实现类 | ||
| 21 | - * | ||
| 22 | - * @author Jason Song(song_s@ctrip.com) | ||
| 23 | - */ | ||
| 24 | -public class DefaultXInjector implements Injector { | ||
| 25 | - | ||
| 26 | - private final com.google.inject.Injector m_injector; | ||
| 27 | - | ||
| 28 | - public DefaultXInjector() { | ||
| 29 | - try { | ||
| 30 | - m_injector = Guice.createInjector(new ApolloModule()); | ||
| 31 | - } catch (Throwable ex) { | ||
| 32 | - ApolloConfigException exception = new ApolloConfigException("Unable to initialize Guice Injector!", ex); | ||
| 33 | - Tracer.logError(exception); | ||
| 34 | - throw exception; | ||
| 35 | - } | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - @Override | ||
| 39 | - public <T> T getInstance(Class<T> clazz) { | ||
| 40 | - try { | ||
| 41 | - return m_injector.getInstance(clazz); | ||
| 42 | - } catch (Throwable ex) { | ||
| 43 | - Tracer.logError(ex); | ||
| 44 | - throw new ApolloConfigException(String.format("Unable to load instance for %s!", clazz.getName()), ex); | ||
| 45 | - } | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @Override | ||
| 49 | - public <T> T getInstance(Class<T> clazz, String name) { | ||
| 50 | - // Guice does not support get instance by type and name | ||
| 51 | - return null; | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - private static class ApolloModule extends AbstractModule { | ||
| 55 | - | ||
| 56 | - @Override | ||
| 57 | - protected void configure() { | ||
| 58 | - bind(ConfigManager.class).to(DefaultConfigManager.class).in(Singleton.class); | ||
| 59 | - bind(ConfigFactoryManager.class).to(DefaultConfigFactoryManager.class).in(Singleton.class); | ||
| 60 | - bind(ConfigRegistry.class).to(DefaultConfigRegistry.class).in(Singleton.class); | ||
| 61 | - | ||
| 62 | - // 自定义 ConfigFactory 实现,使用 DB 作为数据源 | ||
| 63 | - bind(ConfigFactory.class).to(DBConfigFactory.class).in(Singleton.class); | ||
| 64 | - | ||
| 65 | - bind(ConfigUtil.class).in(Singleton.class); | ||
| 66 | - bind(DefaultHttpClient.class).in(Singleton.class); | ||
| 67 | - bind(ConfigServiceLocator.class).in(Singleton.class); | ||
| 68 | - bind(RemoteConfigLongPollService.class).in(Singleton.class); | ||
| 69 | - bind(YamlParser.class).in(Singleton.class); | ||
| 70 | - bind(PropertiesFactory.class).to(DefaultPropertiesFactory.class).in(Singleton.class); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/dto/ConfigRespDTO.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.internals.dto; | ||
| 2 | - | ||
| 3 | -import lombok.Data; | ||
| 4 | - | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 配置 Response DTO | ||
| 9 | - * | ||
| 10 | - * @author 芋道源码 | ||
| 11 | - */ | ||
| 12 | -@Data | ||
| 13 | -public class ConfigRespDTO { | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * 参数键名 | ||
| 17 | - */ | ||
| 18 | - private String key; | ||
| 19 | - /** | ||
| 20 | - * 参数键值 | ||
| 21 | - */ | ||
| 22 | - private String value; | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 是否删除 | ||
| 26 | - */ | ||
| 27 | - private Boolean deleted; | ||
| 28 | - /** | ||
| 29 | - * 更新时间 | ||
| 30 | - */ | ||
| 31 | - private Date updateTime; | ||
| 32 | - | ||
| 33 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/package-info.java deleted
| 1 | -/** | ||
| 2 | - * 配置中心客户端,基于 Apollo Client 进行简化 | ||
| 3 | - * | ||
| 4 | - * 差别在于,我们使用 cn.iocoder.yudao.modules.infra.dal.dataobject.config.InfConfigDO 表作为配置源。 | ||
| 5 | - * 当然,功能肯定也会相对少些,满足最小化诉求。 | ||
| 6 | - * | ||
| 7 | - * 1. 项目初始化时,可以使用 SysConfigDO 表的配置 | ||
| 8 | - * 2. 使用 Spring @Value 可以注入属性 | ||
| 9 | - * 3. SysConfigDO 表的配置修改时,注入到 @Value 的属性可以刷新 | ||
| 10 | - * | ||
| 11 | - * 另外,整个包结构会参考 Apollo 为主,方便维护与理解 | ||
| 12 | - */ | ||
| 13 | -package cn.iocoder.yudao.framework.apollo; |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spi/DBConfigFactory.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.spi; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.apollo.internals.DBConfigRepository; | ||
| 4 | -import com.ctrip.framework.apollo.Config; | ||
| 5 | -import com.ctrip.framework.apollo.ConfigFile; | ||
| 6 | -import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; | ||
| 7 | -import com.ctrip.framework.apollo.internals.ConfigRepository; | ||
| 8 | -import com.ctrip.framework.apollo.internals.DefaultConfig; | ||
| 9 | -import com.ctrip.framework.apollo.spi.ConfigFactory; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 基于 DB 的 ConfigFactory 实现类 | ||
| 13 | - * | ||
| 14 | - * @author 芋道源码 | ||
| 15 | - */ | ||
| 16 | -public class DBConfigFactory implements ConfigFactory { | ||
| 17 | - | ||
| 18 | - @Override | ||
| 19 | - public Config create(String namespace) { | ||
| 20 | - return new DefaultConfig(namespace, this.createDBConfigRepository(namespace)); | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - @Override | ||
| 24 | - public ConfigFile createConfigFile(String namespace, ConfigFileFormat configFileFormat) { | ||
| 25 | - throw new UnsupportedOperationException("暂不支持 Apollo 配置文件"); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - private ConfigRepository createDBConfigRepository(String namespace) { | ||
| 29 | - return new DBConfigRepository(namespace); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java deleted
| 1 | -package cn.iocoder.yudao.framework.apollo.spring.boot; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.apollo.core.ConfigConsts; | ||
| 4 | -import com.google.common.base.Strings; | ||
| 5 | -import org.springframework.boot.SpringApplication; | ||
| 6 | -import org.springframework.boot.env.EnvironmentPostProcessor; | ||
| 7 | -import org.springframework.core.Ordered; | ||
| 8 | -import org.springframework.core.env.ConfigurableEnvironment; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 对 {@link com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer} 的补充,目前的目的有: | ||
| 12 | - * | ||
| 13 | - * 1. 将自定义的 apollo.jdbc 设置到 System 变量中 | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -public class ApolloApplicationContextInitializer implements EnvironmentPostProcessor, Ordered { | ||
| 18 | - | ||
| 19 | - /** | ||
| 20 | - * 优先级更高,要早于 Apollo 的 ApolloApplicationContextInitializer 的初始化 | ||
| 21 | - */ | ||
| 22 | - public static final int DEFAULT_ORDER = -1; | ||
| 23 | - | ||
| 24 | - private int order = DEFAULT_ORDER; | ||
| 25 | - | ||
| 26 | - private static final String[] APOLLO_SYSTEM_PROPERTIES = {ConfigConsts.APOLLO_JDBC_DAO, | ||
| 27 | - ConfigConsts.APOLLO_JDBC_URL, ConfigConsts.APOLLO_JDBC_USERNAME, ConfigConsts.APOLLO_JDBC_PASSWORD}; | ||
| 28 | - | ||
| 29 | - @Override | ||
| 30 | - public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { | ||
| 31 | - initializeSystemProperty(environment); | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * To fill system properties from environment config | ||
| 36 | - */ | ||
| 37 | - void initializeSystemProperty(ConfigurableEnvironment environment) { | ||
| 38 | - for (String propertyName : APOLLO_SYSTEM_PROPERTIES) { | ||
| 39 | - fillSystemPropertyFromEnvironment(environment, propertyName); | ||
| 40 | - } | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - private void fillSystemPropertyFromEnvironment(ConfigurableEnvironment environment, String propertyName) { | ||
| 44 | - if (System.getProperty(propertyName) != null) { | ||
| 45 | - return; | ||
| 46 | - } | ||
| 47 | - String propertyValue = environment.getProperty(propertyName); | ||
| 48 | - if (Strings.isNullOrEmpty(propertyValue)) { | ||
| 49 | - return; | ||
| 50 | - } | ||
| 51 | - System.setProperty(propertyName, propertyValue); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - @Override | ||
| 55 | - public int getOrder() { | ||
| 56 | - return order; | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - public void setOrder(int order) { | ||
| 60 | - this.order = order; | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | -} |
yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector deleted
| 1 | -cn.iocoder.yudao.framework.apollo.internals.DefaultXInjector |
yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/spring.factories deleted
yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/config/YudaoFileAutoConfiguration.java
| @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; | @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 10 | * | 10 | * |
| 11 | * @author 芋道源码 | 11 | * @author 芋道源码 |
| 12 | */ | 12 | */ |
| 13 | -@Configuration | 13 | +@Configuration(proxyBeanMethods = false) |
| 14 | public class YudaoFileAutoConfiguration { | 14 | public class YudaoFileAutoConfiguration { |
| 15 | 15 | ||
| 16 | @Bean | 16 | @Bean |
yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java
| @@ -75,7 +75,8 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> { | @@ -75,7 +75,8 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> { | ||
| 75 | // 阿里云必须有 region,否则会报错 | 75 | // 阿里云必须有 region,否则会报错 |
| 76 | if (config.getEndpoint().contains(ENDPOINT_ALIYUN)) { | 76 | if (config.getEndpoint().contains(ENDPOINT_ALIYUN)) { |
| 77 | return StrUtil.subBefore(config.getEndpoint(), '.', false) | 77 | return StrUtil.subBefore(config.getEndpoint(), '.', false) |
| 78 | - .replaceAll("-internal", ""); // 去除内网 Endpoint 的后缀 | 78 | + .replaceAll("-internal", "")// 去除内网 Endpoint 的后缀 |
| 79 | + .replaceAll("https://", ""); | ||
| 79 | } | 80 | } |
| 80 | return null; | 81 | return null; |
| 81 | } | 82 | } |
yudao-framework/yudao-spring-boot-starter-flowable/src/main/java/cn/iocoder/yudao/framework/flowable/config/YudaoFlowableConfiguration.java
| @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; | @@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 8 | import org.springframework.core.task.AsyncListenableTaskExecutor; | 8 | import org.springframework.core.task.AsyncListenableTaskExecutor; |
| 9 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 9 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| 10 | 10 | ||
| 11 | -@Configuration | 11 | +@Configuration(proxyBeanMethods = false) |
| 12 | public class YudaoFlowableConfiguration { | 12 | public class YudaoFlowableConfiguration { |
| 13 | 13 | ||
| 14 | /** | 14 | /** |
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoAsyncAutoConfiguration.java
| @@ -11,7 +11,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | @@ -11,7 +11,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
| 11 | /** | 11 | /** |
| 12 | * 异步任务 Configuration | 12 | * 异步任务 Configuration |
| 13 | */ | 13 | */ |
| 14 | -@Configuration | 14 | +@Configuration(proxyBeanMethods = false) |
| 15 | @EnableAsync | 15 | @EnableAsync |
| 16 | public class YudaoAsyncAutoConfiguration { | 16 | public class YudaoAsyncAutoConfiguration { |
| 17 | 17 |
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoQuartzAutoConfiguration.java
| @@ -9,7 +9,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; | @@ -9,7 +9,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; | ||
| 9 | /** | 9 | /** |
| 10 | * 定时任务 Configuration | 10 | * 定时任务 Configuration |
| 11 | */ | 11 | */ |
| 12 | -@Configuration | 12 | +@Configuration(proxyBeanMethods = false) |
| 13 | @EnableScheduling // 开启 Spring 自带的定时任务 | 13 | @EnableScheduling // 开启 Spring 自带的定时任务 |
| 14 | public class YudaoQuartzAutoConfiguration { | 14 | public class YudaoQuartzAutoConfiguration { |
| 15 | 15 |
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java
| 1 | package cn.iocoder.yudao.framework.quartz.core.handler; | 1 | package cn.iocoder.yudao.framework.quartz.core.handler; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 3 | import cn.hutool.core.lang.Assert; | 4 | import cn.hutool.core.lang.Assert; |
| 4 | import cn.hutool.core.thread.ThreadUtil; | 5 | import cn.hutool.core.thread.ThreadUtil; |
| 5 | import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum; | 6 | import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum; |
| @@ -13,10 +14,10 @@ import org.springframework.context.ApplicationContext; | @@ -13,10 +14,10 @@ import org.springframework.context.ApplicationContext; | ||
| 13 | import org.springframework.scheduling.quartz.QuartzJobBean; | 14 | import org.springframework.scheduling.quartz.QuartzJobBean; |
| 14 | 15 | ||
| 15 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
| 16 | -import java.util.Date; | 17 | +import java.time.LocalDateTime; |
| 18 | +import java.time.temporal.ChronoUnit; | ||
| 17 | 19 | ||
| 18 | import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage; | 20 | import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage; |
| 19 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.diff; | ||
| 20 | 21 | ||
| 21 | /** | 22 | /** |
| 22 | * 基础 Job 调用者,负责调用 {@link JobHandler#execute(String)} 执行任务 | 23 | * 基础 Job 调用者,负责调用 {@link JobHandler#execute(String)} 执行任务 |
| @@ -46,7 +47,7 @@ public class JobHandlerInvoker extends QuartzJobBean { | @@ -46,7 +47,7 @@ public class JobHandlerInvoker extends QuartzJobBean { | ||
| 46 | 47 | ||
| 47 | // 第二步,执行任务 | 48 | // 第二步,执行任务 |
| 48 | Long jobLogId = null; | 49 | Long jobLogId = null; |
| 49 | - Date startTime = new Date(); | 50 | + LocalDateTime startTime = LocalDateTime.now(); |
| 50 | String data = null; | 51 | String data = null; |
| 51 | Throwable exception = null; | 52 | Throwable exception = null; |
| 52 | try { | 53 | try { |
| @@ -73,9 +74,9 @@ public class JobHandlerInvoker extends QuartzJobBean { | @@ -73,9 +74,9 @@ public class JobHandlerInvoker extends QuartzJobBean { | ||
| 73 | return jobHandler.execute(jobHandlerParam); | 74 | return jobHandler.execute(jobHandlerParam); |
| 74 | } | 75 | } |
| 75 | 76 | ||
| 76 | - private void updateJobLogResultAsync(Long jobLogId, Date startTime, String data, Throwable exception, | 77 | + private void updateJobLogResultAsync(Long jobLogId, LocalDateTime startTime, String data, Throwable exception, |
| 77 | JobExecutionContext executionContext) { | 78 | JobExecutionContext executionContext) { |
| 78 | - Date endTime = new Date(); | 79 | + LocalDateTime endTime = LocalDateTime.now(); |
| 79 | // 处理是否成功 | 80 | // 处理是否成功 |
| 80 | boolean success = exception == null; | 81 | boolean success = exception == null; |
| 81 | if (!success) { | 82 | if (!success) { |
| @@ -83,7 +84,7 @@ public class JobHandlerInvoker extends QuartzJobBean { | @@ -83,7 +84,7 @@ public class JobHandlerInvoker extends QuartzJobBean { | ||
| 83 | } | 84 | } |
| 84 | // 更新日志 | 85 | // 更新日志 |
| 85 | try { | 86 | try { |
| 86 | - jobLogFrameworkService.updateJobLogResultAsync(jobLogId, endTime, (int) diff(endTime, startTime), success, data); | 87 | + jobLogFrameworkService.updateJobLogResultAsync(jobLogId, endTime, (int) LocalDateTimeUtil.between(startTime, endTime).toMillis(), success, data); |
| 87 | } catch (Exception ex) { | 88 | } catch (Exception ex) { |
| 88 | log.error("[executeInternal][Job({}) logId({}) 记录执行日志失败({}/{})]", | 89 | log.error("[executeInternal][Job({}) logId({}) 记录执行日志失败({}/{})]", |
| 89 | executionContext.getJobDetail().getKey(), jobLogId, success, data); | 90 | executionContext.getJobDetail().getKey(), jobLogId, success, data); |
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/service/JobLogFrameworkService.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.quartz.core.service; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.quartz.core.service; | ||
| 2 | 2 | ||
| 3 | import javax.validation.constraints.NotEmpty; | 3 | import javax.validation.constraints.NotEmpty; |
| 4 | import javax.validation.constraints.NotNull; | 4 | import javax.validation.constraints.NotNull; |
| 5 | -import java.util.Date; | 5 | +import java.time.LocalDateTime; |
| 6 | 6 | ||
| 7 | /** | 7 | /** |
| 8 | * Job 日志 Framework Service 接口 | 8 | * Job 日志 Framework Service 接口 |
| @@ -22,7 +22,7 @@ public interface JobLogFrameworkService { | @@ -22,7 +22,7 @@ public interface JobLogFrameworkService { | ||
| 22 | * @return Job 日志的编号 | 22 | * @return Job 日志的编号 |
| 23 | */ | 23 | */ |
| 24 | Long createJobLog(@NotNull(message = "任务编号不能为空") Long jobId, | 24 | Long createJobLog(@NotNull(message = "任务编号不能为空") Long jobId, |
| 25 | - @NotNull(message = "开始时间") Date beginTime, | 25 | + @NotNull(message = "开始时间") LocalDateTime beginTime, |
| 26 | @NotEmpty(message = "Job 处理器的名字不能为空") String jobHandlerName, | 26 | @NotEmpty(message = "Job 处理器的名字不能为空") String jobHandlerName, |
| 27 | String jobHandlerParam, | 27 | String jobHandlerParam, |
| 28 | @NotNull(message = "第几次执行不能为空") Integer executeIndex); | 28 | @NotNull(message = "第几次执行不能为空") Integer executeIndex); |
| @@ -37,7 +37,7 @@ public interface JobLogFrameworkService { | @@ -37,7 +37,7 @@ public interface JobLogFrameworkService { | ||
| 37 | * @param result 成功数据 | 37 | * @param result 成功数据 |
| 38 | */ | 38 | */ |
| 39 | void updateJobLogResultAsync(@NotNull(message = "日志编号不能为空") Long logId, | 39 | void updateJobLogResultAsync(@NotNull(message = "日志编号不能为空") Long logId, |
| 40 | - @NotNull(message = "结束时间不能为空") Date endTime, | 40 | + @NotNull(message = "结束时间不能为空") LocalDateTime endTime, |
| 41 | @NotNull(message = "运行时长不能为空") Integer duration, | 41 | @NotNull(message = "运行时长不能为空") Integer duration, |
| 42 | boolean success, String result); | 42 | boolean success, String result); |
| 43 | 43 |
yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java
| 1 | package cn.iocoder.yudao.framework.quartz.core.util; | 1 | package cn.iocoder.yudao.framework.quartz.core.util; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 3 | import org.quartz.CronExpression; | 4 | import org.quartz.CronExpression; |
| 4 | 5 | ||
| 5 | import java.text.ParseException; | 6 | import java.text.ParseException; |
| 7 | +import java.time.LocalDateTime; | ||
| 6 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| 7 | import java.util.Date; | 9 | import java.util.Date; |
| 8 | import java.util.List; | 10 | import java.util.List; |
| @@ -31,7 +33,7 @@ public class CronUtils { | @@ -31,7 +33,7 @@ public class CronUtils { | ||
| 31 | * @param n 数量 | 33 | * @param n 数量 |
| 32 | * @return 满足条件的执行时间 | 34 | * @return 满足条件的执行时间 |
| 33 | */ | 35 | */ |
| 34 | - public static List<Date> getNextTimes(String cronExpression, int n) { | 36 | + public static List<LocalDateTime> getNextTimes(String cronExpression, int n) { |
| 35 | // 获得 CronExpression 对象 | 37 | // 获得 CronExpression 对象 |
| 36 | CronExpression cron; | 38 | CronExpression cron; |
| 37 | try { | 39 | try { |
| @@ -41,10 +43,10 @@ public class CronUtils { | @@ -41,10 +43,10 @@ public class CronUtils { | ||
| 41 | } | 43 | } |
| 42 | // 从当前开始计算,n 个满足条件的 | 44 | // 从当前开始计算,n 个满足条件的 |
| 43 | Date now = new Date(); | 45 | Date now = new Date(); |
| 44 | - List<Date> nextTimes = new ArrayList<>(n); | 46 | + List<LocalDateTime> nextTimes = new ArrayList<>(n); |
| 45 | for (int i = 0; i < n; i++) { | 47 | for (int i = 0; i < n; i++) { |
| 46 | Date nextTime = cron.getNextValidTimeAfter(now); | 48 | Date nextTime = cron.getNextValidTimeAfter(now); |
| 47 | - nextTimes.add(nextTime); | 49 | + nextTimes.add(LocalDateTimeUtil.of(nextTime)); |
| 48 | // 切换现在,为下一个触发时间; | 50 | // 切换现在,为下一个触发时间; |
| 49 | now = nextTime; | 51 | now = nextTime; |
| 50 | } | 52 | } |
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoMetricsAutoConfiguration.java
| @@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration; | @@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 13 | * | 13 | * |
| 14 | * @author 芋道源码 | 14 | * @author 芋道源码 |
| 15 | */ | 15 | */ |
| 16 | -@Configuration | 16 | +@Configuration(proxyBeanMethods = false) |
| 17 | @ConditionalOnClass({MeterRegistryCustomizer.class}) | 17 | @ConditionalOnClass({MeterRegistryCustomizer.class}) |
| 18 | @ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics | 18 | @ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics |
| 19 | public class YudaoMetricsAutoConfiguration { | 19 | public class YudaoMetricsAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java
| @@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration; | @@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 15 | * | 15 | * |
| 16 | * @author mashu | 16 | * @author mashu |
| 17 | */ | 17 | */ |
| 18 | -@Configuration | 18 | +@Configuration(proxyBeanMethods = false) |
| 19 | @ConditionalOnClass({BizTraceAspect.class}) | 19 | @ConditionalOnClass({BizTraceAspect.class}) |
| 20 | @EnableConfigurationProperties(TracerProperties.class) | 20 | @EnableConfigurationProperties(TracerProperties.class) |
| 21 | @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) | 21 | @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) |
yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java
| @@ -25,6 +25,7 @@ import org.springframework.data.redis.listener.ChannelTopic; | @@ -25,6 +25,7 @@ import org.springframework.data.redis.listener.ChannelTopic; | ||
| 25 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; | 25 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| 26 | import org.springframework.data.redis.stream.DefaultStreamMessageListenerContainerX; | 26 | import org.springframework.data.redis.stream.DefaultStreamMessageListenerContainerX; |
| 27 | import org.springframework.data.redis.stream.StreamMessageListenerContainer; | 27 | import org.springframework.data.redis.stream.StreamMessageListenerContainer; |
| 28 | +import org.springframework.scheduling.annotation.Async; | ||
| 28 | 29 | ||
| 29 | import java.util.List; | 30 | import java.util.List; |
| 30 | import java.util.Properties; | 31 | import java.util.Properties; |
| @@ -34,7 +35,7 @@ import java.util.Properties; | @@ -34,7 +35,7 @@ import java.util.Properties; | ||
| 34 | * | 35 | * |
| 35 | * @author 芋道源码 | 36 | * @author 芋道源码 |
| 36 | */ | 37 | */ |
| 37 | -@Configuration | 38 | +@Configuration(proxyBeanMethods = false) |
| 38 | @AutoConfigureAfter(YudaoRedisAutoConfiguration.class) | 39 | @AutoConfigureAfter(YudaoRedisAutoConfiguration.class) |
| 39 | @Slf4j | 40 | @Slf4j |
| 40 | public class YudaoMQAutoConfiguration { | 41 | public class YudaoMQAutoConfiguration { |
| @@ -54,6 +55,7 @@ public class YudaoMQAutoConfiguration { | @@ -54,6 +55,7 @@ public class YudaoMQAutoConfiguration { | ||
| 54 | * 创建 Redis Pub/Sub 广播消费的容器 | 55 | * 创建 Redis Pub/Sub 广播消费的容器 |
| 55 | */ | 56 | */ |
| 56 | @Bean | 57 | @Bean |
| 58 | + @Async // 异步化,可降低 2 秒左右的启动时间 | ||
| 57 | public RedisMessageListenerContainer redisMessageListenerContainer( | 59 | public RedisMessageListenerContainer redisMessageListenerContainer( |
| 58 | RedisMQTemplate redisMQTemplate, List<AbstractChannelMessageListener<?>> listeners) { | 60 | RedisMQTemplate redisMQTemplate, List<AbstractChannelMessageListener<?>> listeners) { |
| 59 | // 创建 RedisMessageListenerContainer 对象 | 61 | // 创建 RedisMessageListenerContainer 对象 |
| @@ -76,6 +78,7 @@ public class YudaoMQAutoConfiguration { | @@ -76,6 +78,7 @@ public class YudaoMQAutoConfiguration { | ||
| 76 | * Redis Stream 的 xreadgroup 命令:https://www.geek-book.com/src/docs/redis/redis/redis.io/commands/xreadgroup.html | 78 | * Redis Stream 的 xreadgroup 命令:https://www.geek-book.com/src/docs/redis/redis/redis.io/commands/xreadgroup.html |
| 77 | */ | 79 | */ |
| 78 | @Bean(initMethod = "start", destroyMethod = "stop") | 80 | @Bean(initMethod = "start", destroyMethod = "stop") |
| 81 | + @Async // 异步化,可降低 5 秒左右的启动时间 | ||
| 79 | public StreamMessageListenerContainer<String, ObjectRecord<String, String>> redisStreamMessageListenerContainer( | 82 | public StreamMessageListenerContainer<String, ObjectRecord<String, String>> redisStreamMessageListenerContainer( |
| 80 | RedisMQTemplate redisMQTemplate, List<AbstractStreamMessageListener<?>> listeners) { | 83 | RedisMQTemplate redisMQTemplate, List<AbstractStreamMessageListener<?>> listeners) { |
| 81 | RedisTemplate<String, ?> redisTemplate = redisMQTemplate.getRedisTemplate(); | 84 | RedisTemplate<String, ?> redisTemplate = redisMQTemplate.getRedisTemplate(); |
| @@ -95,6 +98,8 @@ public class YudaoMQAutoConfiguration { | @@ -95,6 +98,8 @@ public class YudaoMQAutoConfiguration { | ||
| 95 | // 第二步,注册监听器,消费对应的 Stream 主题 | 98 | // 第二步,注册监听器,消费对应的 Stream 主题 |
| 96 | String consumerName = buildConsumerName(); | 99 | String consumerName = buildConsumerName(); |
| 97 | listeners.parallelStream().forEach(listener -> { | 100 | listeners.parallelStream().forEach(listener -> { |
| 101 | + log.info("[redisStreamMessageListenerContainer][开始注册 StreamKey({}) 对应的监听器({})]", | ||
| 102 | + listener.getStreamKey(), listener.getClass().getName()); | ||
| 98 | // 创建 listener 对应的消费者分组 | 103 | // 创建 listener 对应的消费者分组 |
| 99 | try { | 104 | try { |
| 100 | redisTemplate.opsForStream().createGroup(listener.getStreamKey(), listener.getGroup()); | 105 | redisTemplate.opsForStream().createGroup(listener.getStreamKey(), listener.getGroup()); |
| @@ -111,6 +116,8 @@ public class YudaoMQAutoConfiguration { | @@ -111,6 +116,8 @@ public class YudaoMQAutoConfiguration { | ||
| 111 | .autoAcknowledge(false) // 不自动 ack | 116 | .autoAcknowledge(false) // 不自动 ack |
| 112 | .cancelOnError(throwable -> false); // 默认配置,发生异常就取消消费,显然不符合预期;因此,我们设置为 false | 117 | .cancelOnError(throwable -> false); // 默认配置,发生异常就取消消费,显然不符合预期;因此,我们设置为 false |
| 113 | container.register(builder.build(), listener); | 118 | container.register(builder.build(), listener); |
| 119 | + log.info("[redisStreamMessageListenerContainer][完成注册 StreamKey({}) 对应的监听器({})]", | ||
| 120 | + listener.getStreamKey(), listener.getClass().getName()); | ||
| 114 | }); | 121 | }); |
| 115 | return container; | 122 | return container; |
| 116 | } | 123 | } |
yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml
| @@ -59,13 +59,6 @@ | @@ -59,13 +59,6 @@ | ||
| 59 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 --> | 59 | <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <!-- 多数据源 --> |
| 60 | </dependency> | 60 | </dependency> |
| 61 | 61 | ||
| 62 | - <!-- 工具类相关 --> | ||
| 63 | - <dependency> | ||
| 64 | - <groupId>com.github.ulisesbocchio</groupId> | ||
| 65 | - <artifactId>jasypt-spring-boot-starter</artifactId> <!-- 加解密 --> | ||
| 66 | - <optional>true</optional> | ||
| 67 | - </dependency> | ||
| 68 | - | ||
| 69 | </dependencies> | 62 | </dependencies> |
| 70 | 63 | ||
| 71 | </project> | 64 | </project> |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/datasource/config/YudaoDataSourceAutoConfiguration.java
| @@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; | @@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
| 14 | * | 14 | * |
| 15 | * @author 芋道源码 | 15 | * @author 芋道源码 |
| 16 | */ | 16 | */ |
| 17 | -@Configuration | 17 | +@Configuration(proxyBeanMethods = false) |
| 18 | @EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理 | 18 | @EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理 |
| 19 | @EnableConfigurationProperties(DruidStatProperties.class) | 19 | @EnableConfigurationProperties(DruidStatProperties.class) |
| 20 | public class YudaoDataSourceAutoConfiguration { | 20 | public class YudaoDataSourceAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/YudaoMybatisAutoConfiguration.java
| @@ -23,7 +23,7 @@ import org.springframework.core.env.ConfigurableEnvironment; | @@ -23,7 +23,7 @@ import org.springframework.core.env.ConfigurableEnvironment; | ||
| 23 | * | 23 | * |
| 24 | * @author 芋道源码 | 24 | * @author 芋道源码 |
| 25 | */ | 25 | */ |
| 26 | -@Configuration | 26 | +@Configuration(proxyBeanMethods = false) |
| 27 | @MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class, | 27 | @MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class, |
| 28 | lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试 | 28 | lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试 |
| 29 | public class YudaoMybatisAutoConfiguration { | 29 | public class YudaoMybatisAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java
| @@ -7,7 +7,7 @@ import lombok.Data; | @@ -7,7 +7,7 @@ import lombok.Data; | ||
| 7 | import org.apache.ibatis.type.JdbcType; | 7 | import org.apache.ibatis.type.JdbcType; |
| 8 | 8 | ||
| 9 | import java.io.Serializable; | 9 | import java.io.Serializable; |
| 10 | -import java.util.Date; | 10 | +import java.time.LocalDateTime; |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 基础实体对象 | 13 | * 基础实体对象 |
| @@ -21,12 +21,12 @@ public abstract class BaseDO implements Serializable { | @@ -21,12 +21,12 @@ public abstract class BaseDO implements Serializable { | ||
| 21 | * 创建时间 | 21 | * 创建时间 |
| 22 | */ | 22 | */ |
| 23 | @TableField(fill = FieldFill.INSERT) | 23 | @TableField(fill = FieldFill.INSERT) |
| 24 | - private Date createTime; | 24 | + private LocalDateTime createTime; |
| 25 | /** | 25 | /** |
| 26 | * 最后更新时间 | 26 | * 最后更新时间 |
| 27 | */ | 27 | */ |
| 28 | @TableField(fill = FieldFill.INSERT_UPDATE) | 28 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 29 | - private Date updateTime; | 29 | + private LocalDateTime updateTime; |
| 30 | /** | 30 | /** |
| 31 | * 创建者,目前使用 SysUser 的 id 编号 | 31 | * 创建者,目前使用 SysUser 的 id 编号 |
| 32 | * | 32 | * |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/handler/DefaultDBFieldHandler.java
| @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; | @@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; | ||
| 5 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; | 5 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| 6 | import org.apache.ibatis.reflection.MetaObject; | 6 | import org.apache.ibatis.reflection.MetaObject; |
| 7 | 7 | ||
| 8 | -import java.util.Date; | 8 | +import java.time.LocalDateTime; |
| 9 | import java.util.Objects; | 9 | import java.util.Objects; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| @@ -22,7 +22,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler { | @@ -22,7 +22,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler { | ||
| 22 | if (Objects.nonNull(metaObject) && metaObject.getOriginalObject() instanceof BaseDO) { | 22 | if (Objects.nonNull(metaObject) && metaObject.getOriginalObject() instanceof BaseDO) { |
| 23 | BaseDO baseDO = (BaseDO) metaObject.getOriginalObject(); | 23 | BaseDO baseDO = (BaseDO) metaObject.getOriginalObject(); |
| 24 | 24 | ||
| 25 | - Date current = new Date(); | 25 | + LocalDateTime current = LocalDateTime.now(); |
| 26 | // 创建时间为空,则以当前时间为插入时间 | 26 | // 创建时间为空,则以当前时间为插入时间 |
| 27 | if (Objects.isNull(baseDO.getCreateTime())) { | 27 | if (Objects.isNull(baseDO.getCreateTime())) { |
| 28 | baseDO.setCreateTime(current); | 28 | baseDO.setCreateTime(current); |
| @@ -49,7 +49,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler { | @@ -49,7 +49,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler { | ||
| 49 | // 更新时间为空,则以当前时间为更新时间 | 49 | // 更新时间为空,则以当前时间为更新时间 |
| 50 | Object modifyTime = getFieldValByName("updateTime", metaObject); | 50 | Object modifyTime = getFieldValByName("updateTime", metaObject); |
| 51 | if (Objects.isNull(modifyTime)) { | 51 | if (Objects.isNull(modifyTime)) { |
| 52 | - setFieldValByName("updateTime", new Date(), metaObject); | 52 | + setFieldValByName("updateTime", LocalDateTime.now(), metaObject); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | // 当前登录用户不为空,更新人为空,则当前登录用户为更新人 | 55 | // 当前登录用户不为空,更新人为空,则当前登录用户为更新人 |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/type/EncryptTypeHandler.java
| 1 | package cn.iocoder.yudao.framework.mybatis.core.type; | 1 | package cn.iocoder.yudao.framework.mybatis.core.type; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.lang.Assert; | 3 | import cn.hutool.core.lang.Assert; |
| 4 | +import cn.hutool.crypto.SecureUtil; | ||
| 5 | +import cn.hutool.crypto.symmetric.AES; | ||
| 4 | import cn.hutool.extra.spring.SpringUtil; | 6 | import cn.hutool.extra.spring.SpringUtil; |
| 5 | import org.apache.ibatis.type.BaseTypeHandler; | 7 | import org.apache.ibatis.type.BaseTypeHandler; |
| 6 | import org.apache.ibatis.type.JdbcType; | 8 | import org.apache.ibatis.type.JdbcType; |
| 7 | -import org.jasypt.encryption.StringEncryptor; | ||
| 8 | 9 | ||
| 9 | import java.sql.CallableStatement; | 10 | import java.sql.CallableStatement; |
| 10 | import java.sql.PreparedStatement; | 11 | import java.sql.PreparedStatement; |
| @@ -12,18 +13,20 @@ import java.sql.ResultSet; | @@ -12,18 +13,20 @@ import java.sql.ResultSet; | ||
| 12 | import java.sql.SQLException; | 13 | import java.sql.SQLException; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | - * 字段字段的 TypeHandler 实现类,基于 {@link StringEncryptor} 实现 | 16 | + * 字段字段的 TypeHandler 实现类,基于 {@link cn.hutool.crypto.symmetric.AES} 实现 |
| 16 | * 可通过 jasypt.encryptor.password 配置项,设置密钥 | 17 | * 可通过 jasypt.encryptor.password 配置项,设置密钥 |
| 17 | * | 18 | * |
| 18 | * @author 芋道源码 | 19 | * @author 芋道源码 |
| 19 | */ | 20 | */ |
| 20 | public class EncryptTypeHandler extends BaseTypeHandler<String> { | 21 | public class EncryptTypeHandler extends BaseTypeHandler<String> { |
| 21 | 22 | ||
| 22 | - private static StringEncryptor encryptor; | 23 | + private static final String ENCRYPTOR_PROPERTY_NAME = "mybatis-plus.encryptor.password"; |
| 24 | + | ||
| 25 | + private static AES aes; | ||
| 23 | 26 | ||
| 24 | @Override | 27 | @Override |
| 25 | public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException { | 28 | public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException { |
| 26 | - ps.setString(i, getEncryptor().encrypt(parameter)); | 29 | + ps.setString(i, encrypt(parameter)); |
| 27 | } | 30 | } |
| 28 | 31 | ||
| 29 | @Override | 32 | @Override |
| @@ -48,23 +51,25 @@ public class EncryptTypeHandler extends BaseTypeHandler<String> { | @@ -48,23 +51,25 @@ public class EncryptTypeHandler extends BaseTypeHandler<String> { | ||
| 48 | if (value == null) { | 51 | if (value == null) { |
| 49 | return null; | 52 | return null; |
| 50 | } | 53 | } |
| 51 | - return getEncryptor().decrypt(value); | 54 | + return getEncryptor().decryptStr(value); |
| 52 | } | 55 | } |
| 53 | 56 | ||
| 54 | public static String encrypt(String rawValue) { | 57 | public static String encrypt(String rawValue) { |
| 55 | if (rawValue == null) { | 58 | if (rawValue == null) { |
| 56 | return null; | 59 | return null; |
| 57 | } | 60 | } |
| 58 | - return getEncryptor().encrypt(rawValue); | 61 | + return getEncryptor().encryptBase64(rawValue); |
| 59 | } | 62 | } |
| 60 | 63 | ||
| 61 | - private static StringEncryptor getEncryptor() { | ||
| 62 | - if (encryptor != null) { | ||
| 63 | - return encryptor; | 64 | + private static AES getEncryptor() { |
| 65 | + if (aes != null) { | ||
| 66 | + return aes; | ||
| 64 | } | 67 | } |
| 65 | - encryptor = SpringUtil.getBean(StringEncryptor.class); | ||
| 66 | - Assert.notNull(encryptor, "StringEncryptor 不能为空"); | ||
| 67 | - return encryptor; | 68 | + // 构建 AES |
| 69 | + String password = SpringUtil.getProperty(ENCRYPTOR_PROPERTY_NAME); | ||
| 70 | + Assert.notEmpty(password, "配置项({}) 不能为空", ENCRYPTOR_PROPERTY_NAME); | ||
| 71 | + aes = SecureUtil.aes(password.getBytes()); | ||
| 72 | + return aes; | ||
| 68 | } | 73 | } |
| 69 | 74 | ||
| 70 | } | 75 | } |
yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java
| @@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore; | @@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore; | ||
| 8 | import org.springframework.context.annotation.Bean; | 8 | import org.springframework.context.annotation.Bean; |
| 9 | import org.springframework.context.annotation.Configuration; | 9 | import org.springframework.context.annotation.Configuration; |
| 10 | 10 | ||
| 11 | -@Configuration | 11 | +@Configuration(proxyBeanMethods = false) |
| 12 | @AutoConfigureBefore(LockAutoConfiguration.class) | 12 | @AutoConfigureBefore(LockAutoConfiguration.class) |
| 13 | public class YudaoLock4jConfiguration { | 13 | public class YudaoLock4jConfiguration { |
| 14 | 14 |
yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/YudaoCacheAutoConfiguration.java
| @@ -13,7 +13,7 @@ import org.springframework.data.redis.serializer.RedisSerializer; | @@ -13,7 +13,7 @@ import org.springframework.data.redis.serializer.RedisSerializer; | ||
| 13 | /** | 13 | /** |
| 14 | * Cache 配置类,基于 Redis 实现 | 14 | * Cache 配置类,基于 Redis 实现 |
| 15 | */ | 15 | */ |
| 16 | -@Configuration | 16 | +@Configuration(proxyBeanMethods = false) |
| 17 | @EnableConfigurationProperties({CacheProperties.class}) | 17 | @EnableConfigurationProperties({CacheProperties.class}) |
| 18 | @EnableCaching | 18 | @EnableCaching |
| 19 | public class YudaoCacheAutoConfiguration { | 19 | public class YudaoCacheAutoConfiguration { |
yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/YudaoRedisAutoConfiguration.java
| @@ -9,7 +9,7 @@ import org.springframework.data.redis.serializer.RedisSerializer; | @@ -9,7 +9,7 @@ import org.springframework.data.redis.serializer.RedisSerializer; | ||
| 9 | /** | 9 | /** |
| 10 | * Redis 配置类 | 10 | * Redis 配置类 |
| 11 | */ | 11 | */ |
| 12 | -@Configuration | 12 | +@Configuration(proxyBeanMethods = false) |
| 13 | public class YudaoRedisAutoConfiguration { | 13 | public class YudaoRedisAutoConfiguration { |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java
| @@ -32,7 +32,7 @@ import java.util.Set; | @@ -32,7 +32,7 @@ import java.util.Set; | ||
| 32 | * | 32 | * |
| 33 | * @author 芋道源码 | 33 | * @author 芋道源码 |
| 34 | */ | 34 | */ |
| 35 | -@Configuration | 35 | +@Configuration(proxyBeanMethods = false) |
| 36 | @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) | 36 | @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) |
| 37 | public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { | 37 | public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { |
| 38 | 38 |
yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java
| 1 | package cn.iocoder.yudao.framework.test.core.util; | 1 | package cn.iocoder.yudao.framework.test.core.util; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 3 | import cn.hutool.core.util.ArrayUtil; | 4 | import cn.hutool.core.util.ArrayUtil; |
| 4 | import cn.hutool.core.util.RandomUtil; | 5 | import cn.hutool.core.util.RandomUtil; |
| 5 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| @@ -8,6 +9,7 @@ import uk.co.jemos.podam.api.PodamFactory; | @@ -8,6 +9,7 @@ import uk.co.jemos.podam.api.PodamFactory; | ||
| 8 | import uk.co.jemos.podam.api.PodamFactoryImpl; | 9 | import uk.co.jemos.podam.api.PodamFactoryImpl; |
| 9 | 10 | ||
| 10 | import java.lang.reflect.Type; | 11 | import java.lang.reflect.Type; |
| 12 | +import java.time.LocalDateTime; | ||
| 11 | import java.util.Arrays; | 13 | import java.util.Arrays; |
| 12 | import java.util.Date; | 14 | import java.util.Date; |
| 13 | import java.util.List; | 15 | import java.util.List; |
| @@ -76,6 +78,10 @@ public class RandomUtils { | @@ -76,6 +78,10 @@ public class RandomUtils { | ||
| 76 | return RandomUtil.randomDay(0, RANDOM_DATE_MAX); | 78 | return RandomUtil.randomDay(0, RANDOM_DATE_MAX); |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 81 | + public static LocalDateTime randomLocalDateTime() { | ||
| 82 | + return LocalDateTimeUtil.of(randomDate()); | ||
| 83 | + } | ||
| 84 | + | ||
| 79 | public static Short randomShort() { | 85 | public static Short randomShort() { |
| 80 | return (short) RandomUtil.randomInt(0, Short.MAX_VALUE); | 86 | return (short) RandomUtil.randomInt(0, Short.MAX_VALUE); |
| 81 | } | 87 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/config/YudaoApiLogAutoConfiguration.java
| @@ -19,7 +19,7 @@ import org.springframework.context.annotation.Configuration; | @@ -19,7 +19,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 19 | 19 | ||
| 20 | import javax.servlet.Filter; | 20 | import javax.servlet.Filter; |
| 21 | 21 | ||
| 22 | -@Configuration | 22 | +@Configuration(proxyBeanMethods = false) |
| 23 | @AutoConfigureAfter(YudaoWebAutoConfiguration.class) | 23 | @AutoConfigureAfter(YudaoWebAutoConfiguration.class) |
| 24 | public class YudaoApiLogAutoConfiguration { | 24 | public class YudaoApiLogAutoConfiguration { |
| 25 | 25 |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/filter/ApiAccessLogFilter.java
| 1 | package cn.iocoder.yudao.framework.apilog.core.filter; | 1 | package cn.iocoder.yudao.framework.apilog.core.filter; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.date.LocalDateTimeUtil; | ||
| 3 | import cn.hutool.core.exceptions.ExceptionUtil; | 4 | import cn.hutool.core.exceptions.ExceptionUtil; |
| 4 | import cn.hutool.core.map.MapUtil; | 5 | import cn.hutool.core.map.MapUtil; |
| 5 | import cn.hutool.extra.servlet.ServletUtil; | 6 | import cn.hutool.extra.servlet.ServletUtil; |
| @@ -7,7 +8,6 @@ import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLog; | @@ -7,7 +8,6 @@ import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLog; | ||
| 7 | import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; | 8 | import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; |
| 8 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; | 9 | import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; |
| 9 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 10 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 10 | -import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||
| 11 | import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; | 11 | import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
| 12 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; | 12 | import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
| 13 | import cn.iocoder.yudao.framework.web.config.WebProperties; | 13 | import cn.iocoder.yudao.framework.web.config.WebProperties; |
| @@ -20,7 +20,8 @@ import javax.servlet.ServletException; | @@ -20,7 +20,8 @@ import javax.servlet.ServletException; | ||
| 20 | import javax.servlet.http.HttpServletRequest; | 20 | import javax.servlet.http.HttpServletRequest; |
| 21 | import javax.servlet.http.HttpServletResponse; | 21 | import javax.servlet.http.HttpServletResponse; |
| 22 | import java.io.IOException; | 22 | import java.io.IOException; |
| 23 | -import java.util.Date; | 23 | +import java.time.LocalDateTime; |
| 24 | +import java.time.temporal.ChronoUnit; | ||
| 24 | import java.util.Map; | 25 | import java.util.Map; |
| 25 | 26 | ||
| 26 | import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; | 27 | import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; |
| @@ -47,7 +48,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | @@ -47,7 +48,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | ||
| 47 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) | 48 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) |
| 48 | throws ServletException, IOException { | 49 | throws ServletException, IOException { |
| 49 | // 获得开始时间 | 50 | // 获得开始时间 |
| 50 | - Date beginTim = new Date(); | 51 | + LocalDateTime beginTime = LocalDateTime.now(); |
| 51 | // 提前获得参数,避免 XssFilter 过滤处理 | 52 | // 提前获得参数,避免 XssFilter 过滤处理 |
| 52 | Map<String, String> queryString = ServletUtil.getParamMap(request); | 53 | Map<String, String> queryString = ServletUtil.getParamMap(request); |
| 53 | String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtil.getBody(request) : null; | 54 | String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtil.getBody(request) : null; |
| @@ -56,15 +57,15 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | @@ -56,15 +57,15 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | ||
| 56 | // 继续过滤器 | 57 | // 继续过滤器 |
| 57 | filterChain.doFilter(request, response); | 58 | filterChain.doFilter(request, response); |
| 58 | // 正常执行,记录日志 | 59 | // 正常执行,记录日志 |
| 59 | - createApiAccessLog(request, beginTim, queryString, requestBody, null); | 60 | + createApiAccessLog(request, beginTime, queryString, requestBody, null); |
| 60 | } catch (Exception ex) { | 61 | } catch (Exception ex) { |
| 61 | // 异常执行,记录日志 | 62 | // 异常执行,记录日志 |
| 62 | - createApiAccessLog(request, beginTim, queryString, requestBody, ex); | 63 | + createApiAccessLog(request, beginTime, queryString, requestBody, ex); |
| 63 | throw ex; | 64 | throw ex; |
| 64 | } | 65 | } |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | - private void createApiAccessLog(HttpServletRequest request, Date beginTime, | 68 | + private void createApiAccessLog(HttpServletRequest request, LocalDateTime beginTime, |
| 68 | Map<String, String> queryString, String requestBody, Exception ex) { | 69 | Map<String, String> queryString, String requestBody, Exception ex) { |
| 69 | ApiAccessLog accessLog = new ApiAccessLog(); | 70 | ApiAccessLog accessLog = new ApiAccessLog(); |
| 70 | try { | 71 | try { |
| @@ -75,7 +76,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | @@ -75,7 +76,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | ||
| 75 | } | 76 | } |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | - private void buildApiAccessLogDTO(ApiAccessLog accessLog, HttpServletRequest request, Date beginTime, | 79 | + private void buildApiAccessLogDTO(ApiAccessLog accessLog, HttpServletRequest request, LocalDateTime beginTime, |
| 79 | Map<String, String> queryString, String requestBody, Exception ex) { | 80 | Map<String, String> queryString, String requestBody, Exception ex) { |
| 80 | // 处理用户信息 | 81 | // 处理用户信息 |
| 81 | accessLog.setUserId(WebFrameworkUtils.getLoginUserId(request)); | 82 | accessLog.setUserId(WebFrameworkUtils.getLoginUserId(request)); |
| @@ -103,8 +104,8 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | @@ -103,8 +104,8 @@ public class ApiAccessLogFilter extends ApiRequestFilter { | ||
| 103 | accessLog.setUserIp(ServletUtil.getClientIP(request)); | 104 | accessLog.setUserIp(ServletUtil.getClientIP(request)); |
| 104 | // 持续时间 | 105 | // 持续时间 |
| 105 | accessLog.setBeginTime(beginTime); | 106 | accessLog.setBeginTime(beginTime); |
| 106 | - accessLog.setEndTime(new Date()); | ||
| 107 | - accessLog.setDuration((int) DateUtils.diff(accessLog.getEndTime(), accessLog.getBeginTime())); | 107 | + accessLog.setEndTime(LocalDateTime.now()); |
| 108 | + accessLog.setDuration((int) LocalDateTimeUtil.between(accessLog.getBeginTime(), accessLog.getEndTime(), ChronoUnit.SECONDS)); | ||
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | } | 111 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiAccessLog.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service; | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import javax.validation.constraints.NotNull; | 5 | import javax.validation.constraints.NotNull; |
| 6 | -import java.util.Date; | 6 | +import java.time.LocalDateTime; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * API 访问日志 | 9 | * API 访问日志 |
| @@ -61,12 +61,12 @@ public class ApiAccessLog { | @@ -61,12 +61,12 @@ public class ApiAccessLog { | ||
| 61 | * 开始请求时间 | 61 | * 开始请求时间 |
| 62 | */ | 62 | */ |
| 63 | @NotNull(message = "开始请求时间不能为空") | 63 | @NotNull(message = "开始请求时间不能为空") |
| 64 | - private Date beginTime; | 64 | + private LocalDateTime beginTime; |
| 65 | /** | 65 | /** |
| 66 | * 结束请求时间 | 66 | * 结束请求时间 |
| 67 | */ | 67 | */ |
| 68 | @NotNull(message = "结束请求时间不能为空") | 68 | @NotNull(message = "结束请求时间不能为空") |
| 69 | - private Date endTime; | 69 | + private LocalDateTime endTime; |
| 70 | /** | 70 | /** |
| 71 | * 执行时长,单位:毫秒 | 71 | * 执行时长,单位:毫秒 |
| 72 | */ | 72 | */ |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/apilog/core/service/ApiErrorLog.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service; | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import javax.validation.constraints.NotNull; | 5 | import javax.validation.constraints.NotNull; |
| 6 | -import java.util.Date; | 6 | +import java.time.LocalDateTime; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * API 错误日志 | 9 | * API 错误日志 |
| @@ -61,7 +61,7 @@ public class ApiErrorLog { | @@ -61,7 +61,7 @@ public class ApiErrorLog { | ||
| 61 | * 异常时间 | 61 | * 异常时间 |
| 62 | */ | 62 | */ |
| 63 | @NotNull(message = "异常时间不能为空") | 63 | @NotNull(message = "异常时间不能为空") |
| 64 | - private Date exceptionTime; | 64 | + private LocalDateTime exceptionTime; |
| 65 | /** | 65 | /** |
| 66 | * 异常名 | 66 | * 异常名 |
| 67 | */ | 67 | */ |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/jackson/config/YudaoJacksonAutoConfiguration.java
| @@ -13,8 +13,8 @@ import org.springframework.context.annotation.Configuration; | @@ -13,8 +13,8 @@ import org.springframework.context.annotation.Configuration; | ||
| 13 | 13 | ||
| 14 | import java.time.LocalDateTime; | 14 | import java.time.LocalDateTime; |
| 15 | 15 | ||
| 16 | +@Configuration(proxyBeanMethods = false) | ||
| 16 | @Slf4j | 17 | @Slf4j |
| 17 | -@Configuration | ||
| 18 | public class YudaoJacksonAutoConfiguration { | 18 | public class YudaoJacksonAutoConfiguration { |
| 19 | 19 | ||
| 20 | @Bean | 20 | @Bean |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java
| @@ -29,7 +29,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka | @@ -29,7 +29,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka | ||
| 29 | * | 29 | * |
| 30 | * @author 芋道源码 | 30 | * @author 芋道源码 |
| 31 | */ | 31 | */ |
| 32 | -@Configuration | 32 | +@Configuration(proxyBeanMethods = false) |
| 33 | @EnableSwagger2 | 33 | @EnableSwagger2 |
| 34 | @EnableKnife4j | 34 | @EnableKnife4j |
| 35 | @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) | 35 | @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
| @@ -26,7 +26,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | @@ -26,7 +26,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
| 26 | import javax.annotation.Resource; | 26 | import javax.annotation.Resource; |
| 27 | import javax.servlet.Filter; | 27 | import javax.servlet.Filter; |
| 28 | 28 | ||
| 29 | -@Configuration | 29 | +@Configuration(proxyBeanMethods = false) |
| 30 | @EnableConfigurationProperties({WebProperties.class, XssProperties.class}) | 30 | @EnableConfigurationProperties({WebProperties.class, XssProperties.class}) |
| 31 | public class YudaoWebAutoConfiguration implements WebMvcConfigurer { | 31 | public class YudaoWebAutoConfiguration implements WebMvcConfigurer { |
| 32 | 32 |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java
| @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRequest; | @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRequest; | ||
| 31 | import javax.validation.ConstraintViolation; | 31 | import javax.validation.ConstraintViolation; |
| 32 | import javax.validation.ConstraintViolationException; | 32 | import javax.validation.ConstraintViolationException; |
| 33 | import javax.validation.ValidationException; | 33 | import javax.validation.ValidationException; |
| 34 | -import java.util.Date; | 34 | +import java.time.LocalDateTime; |
| 35 | import java.util.Map; | 35 | import java.util.Map; |
| 36 | 36 | ||
| 37 | import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.*; | 37 | import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.*; |
| @@ -78,7 +78,7 @@ public class GlobalExceptionHandler { | @@ -78,7 +78,7 @@ public class GlobalExceptionHandler { | ||
| 78 | return validationException((ValidationException) ex); | 78 | return validationException((ValidationException) ex); |
| 79 | } | 79 | } |
| 80 | if (ex instanceof NoHandlerFoundException) { | 80 | if (ex instanceof NoHandlerFoundException) { |
| 81 | - return noHandlerFoundExceptionHandler((NoHandlerFoundException) ex); | 81 | + return noHandlerFoundExceptionHandler(request, (NoHandlerFoundException) ex); |
| 82 | } | 82 | } |
| 83 | if (ex instanceof HttpRequestMethodNotSupportedException) { | 83 | if (ex instanceof HttpRequestMethodNotSupportedException) { |
| 84 | return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex); | 84 | return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex); |
| @@ -167,7 +167,13 @@ public class GlobalExceptionHandler { | @@ -167,7 +167,13 @@ public class GlobalExceptionHandler { | ||
| 167 | * 2. spring.mvc.static-path-pattern 为 /statics/** | 167 | * 2. spring.mvc.static-path-pattern 为 /statics/** |
| 168 | */ | 168 | */ |
| 169 | @ExceptionHandler(NoHandlerFoundException.class) | 169 | @ExceptionHandler(NoHandlerFoundException.class) |
| 170 | - public CommonResult<?> noHandlerFoundExceptionHandler(NoHandlerFoundException ex) { | 170 | + public CommonResult<?> noHandlerFoundExceptionHandler(HttpServletRequest req, NoHandlerFoundException ex) { |
| 171 | + // 情况一:部分功能未开启 | ||
| 172 | + if (req.getRequestURI().contains("/bpm/")) { | ||
| 173 | + return CommonResult.error(NOT_IMPLEMENTED.getCode(), "[工作流模块 yudao-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]"); | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + // 情况二:正常情况下的 404 | ||
| 171 | log.warn("[noHandlerFoundExceptionHandler]", ex); | 177 | log.warn("[noHandlerFoundExceptionHandler]", ex); |
| 172 | return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getRequestURL())); | 178 | return CommonResult.error(NOT_FOUND.getCode(), String.format("请求地址不存在:%s", ex.getRequestURL())); |
| 173 | } | 179 | } |
| @@ -267,7 +273,7 @@ public class GlobalExceptionHandler { | @@ -267,7 +273,7 @@ public class GlobalExceptionHandler { | ||
| 267 | errorLog.setRequestMethod(request.getMethod()); | 273 | errorLog.setRequestMethod(request.getMethod()); |
| 268 | errorLog.setUserAgent(ServletUtils.getUserAgent(request)); | 274 | errorLog.setUserAgent(ServletUtils.getUserAgent(request)); |
| 269 | errorLog.setUserIp(ServletUtil.getClientIP(request)); | 275 | errorLog.setUserIp(ServletUtil.getClientIP(request)); |
| 270 | - errorLog.setExceptionTime(new Date()); | 276 | + errorLog.setExceptionTime(LocalDateTime.now()); |
| 271 | } | 277 | } |
| 272 | 278 | ||
| 273 | } | 279 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java
| @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | @@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode; | ||
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | import javax.validation.constraints.NotNull; | 9 | import javax.validation.constraints.NotNull; |
| 10 | -import java.util.Date; | 10 | +import java.time.LocalDateTime; |
| 11 | import java.util.List; | 11 | import java.util.List; |
| 12 | 12 | ||
| 13 | @ApiModel("管理后台 - 动态表单 Response VO") | 13 | @ApiModel("管理后台 - 动态表单 Response VO") |
| @@ -28,6 +28,6 @@ public class BpmFormRespVO extends BpmFormBaseVO { | @@ -28,6 +28,6 @@ public class BpmFormRespVO extends BpmFormBaseVO { | ||
| 28 | private List<String> fields; | 28 | private List<String> fields; |
| 29 | 29 | ||
| 30 | @ApiModelProperty(value = "创建时间", required = true) | 30 | @ApiModelProperty(value = "创建时间", required = true) |
| 31 | - private Date createTime; | 31 | + private LocalDateTime createTime; |
| 32 | 32 | ||
| 33 | } | 33 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java
| @@ -9,7 +9,7 @@ import lombok.EqualsAndHashCode; | @@ -9,7 +9,7 @@ import lombok.EqualsAndHashCode; | ||
| 9 | import lombok.ToString; | 9 | import lombok.ToString; |
| 10 | import org.springframework.format.annotation.DateTimeFormat; | 10 | import org.springframework.format.annotation.DateTimeFormat; |
| 11 | 11 | ||
| 12 | -import java.util.Date; | 12 | +import java.time.LocalDateTime; |
| 13 | 13 | ||
| 14 | @ApiModel("管理后台 - 用户组分页 Request VO") | 14 | @ApiModel("管理后台 - 用户组分页 Request VO") |
| 15 | @Data | 15 | @Data |
| @@ -25,6 +25,6 @@ public class BpmUserGroupPageReqVO extends PageParam { | @@ -25,6 +25,6 @@ public class BpmUserGroupPageReqVO extends PageParam { | ||
| 25 | 25 | ||
| 26 | @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 26 | @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 27 | @ApiModelProperty(value = "创建时间") | 27 | @ApiModelProperty(value = "创建时间") |
| 28 | - private Date[] createTime; | 28 | + private LocalDateTime[] createTime; |
| 29 | 29 | ||
| 30 | } | 30 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java
| 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | 1 | package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | 4 | + |
| 5 | +import java.time.LocalDateTime; | ||
| 6 | + | ||
| 5 | import io.swagger.annotations.*; | 7 | import io.swagger.annotations.*; |
| 6 | 8 | ||
| 7 | @ApiModel("管理后台 - 用户组 Response VO") | 9 | @ApiModel("管理后台 - 用户组 Response VO") |
| @@ -14,6 +16,6 @@ public class BpmUserGroupRespVO extends BpmUserGroupBaseVO { | @@ -14,6 +16,6 @@ public class BpmUserGroupRespVO extends BpmUserGroupBaseVO { | ||
| 14 | private Long id; | 16 | private Long id; |
| 15 | 17 | ||
| 16 | @ApiModelProperty(value = "创建时间", required = true) | 18 | @ApiModelProperty(value = "创建时间", required = true) |
| 17 | - private Date createTime; | 19 | + private LocalDateTime createTime; |
| 18 | 20 | ||
| 19 | } | 21 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java
| @@ -6,7 +6,7 @@ import lombok.Data; | @@ -6,7 +6,7 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | -import java.util.Date; | 9 | +import java.time.LocalDateTime; |
| 10 | 10 | ||
| 11 | @ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") | 11 | @ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") |
| 12 | @Data | 12 | @Data |
| @@ -21,7 +21,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { | @@ -21,7 +21,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { | ||
| 21 | private String formName; | 21 | private String formName; |
| 22 | 22 | ||
| 23 | @ApiModelProperty(value = "创建时间", required = true) | 23 | @ApiModelProperty(value = "创建时间", required = true) |
| 24 | - private Date createTime; | 24 | + private LocalDateTime createTime; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 最新部署的流程定义 | 27 | * 最新部署的流程定义 |
| @@ -39,7 +39,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { | @@ -39,7 +39,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { | ||
| 39 | private Integer version; | 39 | private Integer version; |
| 40 | 40 | ||
| 41 | @ApiModelProperty(value = "部署时间", required = true) | 41 | @ApiModelProperty(value = "部署时间", required = true) |
| 42 | - private Date deploymentTime; | 42 | + private LocalDateTime deploymentTime; |
| 43 | 43 | ||
| 44 | @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") | 44 | @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") |
| 45 | private Integer suspensionState; | 45 | private Integer suspensionState; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java
| @@ -6,7 +6,7 @@ import lombok.Data; | @@ -6,7 +6,7 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | -import java.util.Date; | 9 | +import java.time.LocalDateTime; |
| 10 | 10 | ||
| 11 | @ApiModel("管理后台 - 流程模型的创建 Request VO") | 11 | @ApiModel("管理后台 - 流程模型的创建 Request VO") |
| 12 | @Data | 12 | @Data |
| @@ -21,6 +21,6 @@ public class BpmModelRespVO extends BpmModelBaseVO { | @@ -21,6 +21,6 @@ public class BpmModelRespVO extends BpmModelBaseVO { | ||
| 21 | private String bpmnXml; | 21 | private String bpmnXml; |
| 22 | 22 | ||
| 23 | @ApiModelProperty(value = "创建时间", required = true) | 23 | @ApiModelProperty(value = "创建时间", required = true) |
| 24 | - private Date createTime; | 24 | + private LocalDateTime createTime; |
| 25 | 25 | ||
| 26 | } | 26 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java
| @@ -6,7 +6,7 @@ import lombok.Data; | @@ -6,7 +6,7 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | -import java.util.Date; | 9 | +import java.time.LocalDateTime; |
| 10 | 10 | ||
| 11 | @ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") | 11 | @ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") |
| 12 | @Data | 12 | @Data |
| @@ -18,6 +18,6 @@ public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionResp | @@ -18,6 +18,6 @@ public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionResp | ||
| 18 | private String formName; | 18 | private String formName; |
| 19 | 19 | ||
| 20 | @ApiModelProperty(value = "部署时间", required = true) | 20 | @ApiModelProperty(value = "部署时间", required = true) |
| 21 | - private Date deploymentTime; | 21 | + private LocalDateTime deploymentTime; |
| 22 | 22 | ||
| 23 | } | 23 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java
| 1 | package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | 1 | package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | 4 | +import java.time.LocalDateTime; |
| 5 | import io.swagger.annotations.*; | 5 | import io.swagger.annotations.*; |
| 6 | import javax.validation.constraints.*; | 6 | import javax.validation.constraints.*; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 7 | import org.springframework.format.annotation.DateTimeFormat; |
| @@ -18,11 +18,11 @@ public class BpmOALeaveBaseVO { | @@ -18,11 +18,11 @@ public class BpmOALeaveBaseVO { | ||
| 18 | @ApiModelProperty(value = "请假的开始时间", required = true) | 18 | @ApiModelProperty(value = "请假的开始时间", required = true) |
| 19 | @NotNull(message = "开始时间不能为空") | 19 | @NotNull(message = "开始时间不能为空") |
| 20 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 20 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 21 | - private Date startTime; | 21 | + private LocalDateTime startTime; |
| 22 | @ApiModelProperty(value = "请假的结束时间", required = true) | 22 | @ApiModelProperty(value = "请假的结束时间", required = true) |
| 23 | @NotNull(message = "结束时间不能为空") | 23 | @NotNull(message = "结束时间不能为空") |
| 24 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 24 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 25 | - private Date endTime; | 25 | + private LocalDateTime endTime; |
| 26 | 26 | ||
| 27 | @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") | 27 | @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") |
| 28 | private Integer type; | 28 | private Integer type; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java
| @@ -15,7 +15,7 @@ public class BpmOALeaveCreateReqVO extends BpmOALeaveBaseVO { | @@ -15,7 +15,7 @@ public class BpmOALeaveCreateReqVO extends BpmOALeaveBaseVO { | ||
| 15 | 15 | ||
| 16 | @AssertTrue(message = "结束时间,需要在开始时间之后") | 16 | @AssertTrue(message = "结束时间,需要在开始时间之后") |
| 17 | public boolean isEndTimeValid() { | 17 | public boolean isEndTimeValid() { |
| 18 | - return !getEndTime().before(getStartTime()); | 18 | + return !getEndTime().isBefore(getStartTime()); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | } | 21 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java
| 1 | package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | 1 | package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | 4 | +import java.time.LocalDateTime; |
| 5 | import io.swagger.annotations.*; | 5 | import io.swagger.annotations.*; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 7 | import org.springframework.format.annotation.DateTimeFormat; |
| @@ -25,6 +25,6 @@ public class BpmOALeavePageReqVO extends PageParam { | @@ -25,6 +25,6 @@ public class BpmOALeavePageReqVO extends PageParam { | ||
| 25 | 25 | ||
| 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 27 | @ApiModelProperty(value = "申请时间") | 27 | @ApiModelProperty(value = "申请时间") |
| 28 | - private Date[] createTime; | 28 | + private LocalDateTime[] createTime; |
| 29 | 29 | ||
| 30 | } | 30 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java
| @@ -5,7 +5,7 @@ import io.swagger.annotations.*; | @@ -5,7 +5,7 @@ import io.swagger.annotations.*; | ||
| 5 | import org.springframework.format.annotation.DateTimeFormat; | 5 | import org.springframework.format.annotation.DateTimeFormat; |
| 6 | 6 | ||
| 7 | import javax.validation.constraints.NotNull; | 7 | import javax.validation.constraints.NotNull; |
| 8 | -import java.util.Date; | 8 | +import java.time.LocalDateTime; |
| 9 | 9 | ||
| 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 11 | 11 | ||
| @@ -24,7 +24,7 @@ public class BpmOALeaveRespVO extends BpmOALeaveBaseVO { | @@ -24,7 +24,7 @@ public class BpmOALeaveRespVO extends BpmOALeaveBaseVO { | ||
| 24 | @ApiModelProperty(value = "申请时间", required = true) | 24 | @ApiModelProperty(value = "申请时间", required = true) |
| 25 | @NotNull(message = "申请时间不能为空") | 25 | @NotNull(message = "申请时间不能为空") |
| 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 27 | - private Date createTime; | 27 | + private LocalDateTime createTime; |
| 28 | 28 | ||
| 29 | @ApiModelProperty(value = "流程id") | 29 | @ApiModelProperty(value = "流程id") |
| 30 | private String processInstanceId; | 30 | private String processInstanceId; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java
| @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 | ||
| 7 | -import java.util.Date; | 7 | +import java.time.LocalDateTime; |
| 8 | 8 | ||
| 9 | @ApiModel("管理后台 - 流程活动的 Response VO") | 9 | @ApiModel("管理后台 - 流程活动的 Response VO") |
| 10 | @Data | 10 | @Data |
| @@ -16,9 +16,9 @@ public class BpmActivityRespVO { | @@ -16,9 +16,9 @@ public class BpmActivityRespVO { | ||
| 16 | private String type; | 16 | private String type; |
| 17 | 17 | ||
| 18 | @ApiModelProperty(value = "流程活动的开始时间", required = true) | 18 | @ApiModelProperty(value = "流程活动的开始时间", required = true) |
| 19 | - private Date startTime; | 19 | + private LocalDateTime startTime; |
| 20 | @ApiModelProperty(value = "流程活动的结束时间", required = true) | 20 | @ApiModelProperty(value = "流程活动的结束时间", required = true) |
| 21 | - private Date endTime; | 21 | + private LocalDateTime endTime; |
| 22 | 22 | ||
| 23 | @ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") | 23 | @ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") |
| 24 | private String taskId; | 24 | private String taskId; |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java
| @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; | ||
| 8 | import lombok.ToString; | 8 | import lombok.ToString; |
| 9 | import org.springframework.format.annotation.DateTimeFormat; | 9 | import org.springframework.format.annotation.DateTimeFormat; |
| 10 | 10 | ||
| 11 | -import java.util.Date; | 11 | +import java.time.LocalDateTime; |
| 12 | 12 | ||
| 13 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 13 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 14 | 14 | ||
| @@ -35,6 +35,6 @@ public class BpmProcessInstanceMyPageReqVO extends PageParam { | @@ -35,6 +35,6 @@ public class BpmProcessInstanceMyPageReqVO extends PageParam { | ||
| 35 | 35 | ||
| 36 | @ApiModelProperty(value = "创建时间") | 36 | @ApiModelProperty(value = "创建时间") |
| 37 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 37 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 38 | - private Date[] createTime; | 38 | + private LocalDateTime[] createTime; |
| 39 | 39 | ||
| 40 | } | 40 | } |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java
| @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 | ||
| 7 | -import java.util.Date; | 7 | +import java.time.LocalDateTime; |
| 8 | import java.util.List; | 8 | import java.util.List; |
| 9 | 9 | ||
| 10 | @ApiModel("管理后台 - 流程实例的分页 Item Response VO") | 10 | @ApiModel("管理后台 - 流程实例的分页 Item Response VO") |
| @@ -30,10 +30,10 @@ public class BpmProcessInstancePageItemRespVO { | @@ -30,10 +30,10 @@ public class BpmProcessInstancePageItemRespVO { | ||
| 30 | private Integer result; | 30 | private Integer result; |
| 31 | 31 | ||
| 32 | @ApiModelProperty(value = "提交时间", required = true) | 32 | @ApiModelProperty(value = "提交时间", required = true) |
| 33 | - private Date createTime; | 33 | + private LocalDateTime createTime; |
| 34 | 34 | ||
| 35 | @ApiModelProperty(value = "结束时间", required = true) | 35 | @ApiModelProperty(value = "结束时间", required = true) |
| 36 | - private Date endTime; | 36 | + private LocalDateTime endTime; |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * 当前任务 | 39 | * 当前任务 |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java
| @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | 6 | ||
| 7 | -import java.util.Date; | 7 | +import java.time.LocalDateTime; |
| 8 | import java.util.List; | 8 | import java.util.List; |
| 9 | import java.util.Map; | 9 | import java.util.Map; |
| 10 | 10 | ||
| @@ -28,10 +28,10 @@ public class BpmProcessInstanceRespVO { | @@ -28,10 +28,10 @@ public class BpmProcessInstanceRespVO { | ||
| 28 | private Integer result; | 28 | private Integer result; |
| 29 | 29 | ||
| 30 | @ApiModelProperty(value = "提交时间", required = true) | 30 | @ApiModelProperty(value = "提交时间", required = true) |
| 31 | - private Date createTime; | 31 | + private LocalDateTime createTime; |
| 32 | 32 | ||
| 33 | @ApiModelProperty(value = "结束时间", required = true) | 33 | @ApiModelProperty(value = "结束时间", required = true) |
| 34 | - private Date endTime; | 34 | + private LocalDateTime endTime; |
| 35 | 35 | ||
| 36 | @ApiModelProperty(value = "提交的表单值", required = true) | 36 | @ApiModelProperty(value = "提交的表单值", required = true) |
| 37 | private Map<String, Object> formVariables; | 37 | private Map<String, Object> formVariables; |