From a927dd059eb94c28316ac3cdde71359d8ab73e8d Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 May 2021 23:23:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20x=2018=20:=20=E8=A7=A3=E5=86=B3=E6=8B=86=E5=88=86?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/job/InfJobController.java | 2 +- .../infra/dal/dataobject/job/InfJobLogDO.java | 2 +- .../dal/mysql/config/InfConfigDAOImpl.java | 5 +- .../config/InfConfigRefreshConsumer.java | 2 +- .../infra/service/job/InfJobLogService.java | 2 +- .../service/job/impl/InfJobServiceImpl.java | 4 +- .../controller/sms/SmsCallbackController.java | 2 +- .../convert/sms/SysSmsChannelConvert.java | 2 +- .../dal/dataobject/sms/SysSmsChannelDO.java | 2 +- .../dal/dataobject/sms/SysSmsLogDO.java | 2 +- .../job/auth/SysUserSessionTimeoutJob.java | 2 +- .../service/auth/impl/SysAuthServiceImpl.java | 2 + .../sms/impl/SysSmsChannelServiceImpl.java | 4 +- .../service/sms/impl/SysSmsServiceImpl.java | 10 +-- .../sms/impl/SysSmsTemplateServiceImpl.java | 8 +- ....ctrip.framework.apollo.internals.Injector | 1 - .../main/resources/META-INF/spring.factories | 2 - .../src/main/resources/application.yaml | 2 + ...1logback-spring.xml => logback-spring.xml} | 0 .../BaseDbAndRedisIntegrationTest.java | 2 +- .../dashboard/BaseRedisIntegrationTest.java | 2 +- .../dashboard/BaseDbAndRedisUnitTest.java | 4 +- .../iocoder/dashboard/BaseRedisUnitTest.java | 5 +- .../service/config/InfConfigServiceTest.java | 6 +- .../service/file/InfFileServiceTest.java | 8 +- .../service/job/InfJobLogServiceTest.java | 8 +- .../infra/service/job/InfJobServiceTest.java | 10 +-- .../InfApiAccessLogServiceImplTest.java | 4 +- .../logger/InfApiErrorLogServiceImplTest.java | 6 +- .../service/auth/SysAuthServiceImplTest.java | 6 +- .../auth/SysUserSessionServiceImplTest.java | 14 +-- .../service/common/SysCaptchaServiceTest.java | 2 +- .../service/dept/SysDeptServiceTest.java | 6 +- .../service/dept/SysPostServiceTest.java | 8 +- .../service/dict/SysDictDataServiceTest.java | 6 +- .../service/dict/SysDictTypeServiceTest.java | 6 +- .../errorcode/SysErrorCodeServiceTest.java | 6 +- .../logger/SysLoginLogServiceImplTest.java | 4 +- .../logger/SysOperateLogServiceImplTest.java | 6 +- .../notice/SysNoticeServiceImplTest.java | 8 +- .../permission/SysMenuServiceTest.java | 14 +-- .../permission/SysPermissionServiceTest.java | 6 +- .../permission/SysRoleServiceTest.java | 6 +- .../service/sms/SysSmsChannelServiceTest.java | 6 +- .../service/sms/SysSmsLogServiceTest.java | 4 +- .../system/service/sms/SysSmsServiceTest.java | 14 +-- .../sms/SysSmsTemplateServiceTest.java | 14 +-- .../service/user/SysUserServiceImplTest.java | 6 +- ...n.java => YudaoDictAutoConfiguration.java} | 10 +-- ...DictUtils.java => DictFrameworkUtils.java} | 6 +- .../yudao/framework/dict/package-info.java | 2 +- .../main/resources/META-INF/spring.factories | 2 + .../core/dto/OperateLogCreateReqDTO.java | 2 +- .../main/resources/META-INF/spring.factories | 2 + .../impl/aliyun/AliyunSmsCodeMapping.java | 43 ---------- .../impl/yunpian/YunpianSmsCodeMapping.java | 45 ---------- .../config/YudaoSmsAutoConfiguration.java} | 8 +- .../framework/sms/core/client/SmsClient.java | 8 +- .../sms/core/client/SmsClientFactory.java | 4 +- .../sms/core/client/SmsCodeMapping.java | 4 +- .../sms/core/client/SmsCommonResult.java | 4 +- .../core/client/dto/SmsReceiveRespDTO.java | 2 +- .../sms/core/client/dto/SmsSendRespDTO.java | 2 +- .../core/client/dto/SmsTemplateRespDTO.java | 4 +- .../core/client/impl/AbstractSmsClient.java | 16 ++-- .../client/impl/SmsClientFactoryImpl.java | 16 ++-- .../client/impl/aliyun/AliyunSmsClient.java | 16 ++-- .../impl/aliyun/AliyunSmsCodeMapping.java | 42 +++++++++ .../impl/debug/DebugDingTalkCodeMapping.java | 9 +- .../impl/debug/DebugDingTalkSmsClient.java | 16 ++-- .../client/impl/yunpian/YunpianSmsClient.java | 16 ++-- .../impl/yunpian/YunpianSmsCodeMapping.java | 45 ++++++++++ .../sms/core/enums/SmsChannelEnum.java | 2 +- .../enums/SmsFrameworkErrorCodeConstants.java | 2 +- .../enums/SmsTemplateAuditStatusEnum.java | 2 +- .../core/property/SmsChannelProperties.java | 4 +- .../main/resources/META-INF/spring.factories | 2 + .../impl/aliyun/AliyunSmsClientTest.java | 25 +++--- .../impl/aliyun/AliyunSmsCodeMappingTest.java | 6 +- .../impl/yunpian/YunpianSmsClientTest.java | 18 ++-- .../yunpian/YunpianSmsCodeMappingTest.java | 9 +- .../framework/apollo/core/ConfigConsts.java | 6 +- .../apollo/internals/ConfigFrameworkDAO.java | 4 +- .../apollo/internals/DBConfigRepository.java | 6 +- .../apollo/internals/DefaultXInjector.java | 4 +- .../apollo/internals/dto/ConfigRespDTO.java | 2 +- .../framework/apollo/package-info.java | 4 +- .../framework/apollo/spi/DBConfigFactory.java | 4 +- .../ApolloApplicationContextInitializer.java | 4 +- ....ctrip.framework.apollo.internals.Injector | 1 + .../main/resources/META-INF/spring.factories | 2 + .../excel/core/convert/DictConvert.java | 6 +- .../config/YudaoQuartzAutoConfiguration.java} | 6 +- .../quartz/core/enums/JobDataKeyEnum.java | 2 +- .../quartz/core/handler/JobHandler.java | 2 +- .../core/handler/JobHandlerInvoker.java | 6 +- .../core/scheduler/SchedulerManager.java | 6 +- .../core/service/JobLogFrameworkService.java | 2 +- .../framework/quartz/core/util/CronUtils.java | 2 +- .../framework/quartz/package-info.java | 2 +- .../main/resources/META-INF/spring.factories | 2 + ...java => YudaoTracerAutoConfiguration.java} | 2 +- .../main/resources/META-INF/spring.factories | 2 + ...芋道 Spring Boot 监控工具 Admin 入门》.md | 1 + ...道 Spring Boot 监控端点 Actuator 入门》.md | 1 + ...道 Spring Boot 链路追踪 SkyWalking 入门》.md | 0 .../yudao-spring-boot-starter-mybatis/pom.xml | 6 -- .../pom.xml | 1 - ...java => YudaoIdempotentConfiguration.java} | 2 +- ...ion.java => YudaoLock4jConfiguration.java} | 2 +- .../resources/META-INF/spring.factories | 3 + ....java => YudaoRedisAutoConfiguration.java} | 2 +- .../main/resources/META-INF/spring.factories | 2 + .../YudaoSecurityAutoConfiguration.java | 79 +++++++++++++++++ ...=> YudaoWebSecurityConfigurerAdapter.java} | 86 +++++++++---------- .../filter/JwtAuthenticationTokenFilter.java | 14 +-- .../core/handler/AccessDeniedHandlerImpl.java | 3 +- .../handler/AuthenticationEntryPointImpl.java | 2 - .../handler/LogoutSuccessHandlerImpl.java | 9 +- .../main/resources/META-INF/spring.factories | 3 + .../framework/test/core/ut/package-info.java | 4 - .../test/core/ut/BaseMockitoUnitTest.java | 2 +- .../framework/test/core/ut/package-info.java | 4 + .../framework/test/core/util/AssertUtils.java | 2 +- .../framework/test/core/util/RandomUtils.java | 2 +- .../framework/test/package-info.java | 2 +- .../framework/web/config/WebProperties.java | 2 +- .../web/config/YudaoWebAutoConfiguration.java | 19 ++++ .../core/handler/GlobalExceptionHandler.java | 8 +- .../main/resources/META-INF/spring.factories | 5 ++ 130 files changed, 553 insertions(+), 437 deletions(-) delete mode 100644 yudao-admin-server/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector delete mode 100644 yudao-admin-server/src/main/resources/META-INF/spring.factories rename yudao-admin-server/src/main/resources/{1logback-spring.xml => logback-spring.xml} (100%) rename yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/{DictConfiguration.java => YudaoDictAutoConfiguration.java} (54%) rename yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/{DictUtils.java => DictFrameworkUtils.java} (82%) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/resources/META-INF/spring.factories delete mode 100644 yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard/framework/sms/config/SmsConfiguration.java => yudao/framework/sms/config/YudaoSmsAutoConfiguration.java} (55%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/SmsClient.java (81%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/SmsClientFactory.java (81%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/SmsCodeMapping.java (69%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/SmsCommonResult.java (94%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/dto/SmsReceiveRespDTO.java (92%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/dto/SmsSendRespDTO.java (77%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/dto/SmsTemplateRespDTO.java (76%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/AbstractSmsClient.java (85%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/SmsClientFactoryImpl.java (83%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java (92%) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java (62%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java (85%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java (92%) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/enums/SmsChannelEnum.java (92%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java (97%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java (83%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/property/SmsChannelProperties.java (89%) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/resources/META-INF/spring.factories rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java (90%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java (92%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java (92%) rename yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/{dashboard => yudao}/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java (86%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/core/ConfigConsts.java (75%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/internals/ConfigFrameworkDAO.java (82%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/internals/DBConfigRepository.java (97%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/internals/DefaultXInjector.java (95%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/internals/dto/ConfigRespDTO.java (86%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/package-info.java (70%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/spi/DBConfigFactory.java (88%) rename yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/{dashboard => yudao}/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java (94%) create mode 100644 yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector create mode 100644 yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/spring.factories rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard/framework/quartz/config/QuartzConfig.java => yudao/framework/quartz/config/YudaoQuartzAutoConfiguration.java} (71%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/enums/JobDataKeyEnum.java (79%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/handler/JobHandler.java (81%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/handler/JobHandlerInvoker.java (95%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/scheduler/SchedulerManager.java (95%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/service/JobLogFrameworkService.java (96%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/core/util/CronUtils.java (96%) rename yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/{dashboard => yudao}/framework/quartz/package-info.java (75%) create mode 100644 yudao-framework/yudao-spring-boot-starter-job/src/main/resources/META-INF/spring.factories rename yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/{TracerAutoConfiguration.java => YudaoTracerAutoConfiguration.java} (97%) create mode 100644 yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories create mode 100644 yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md create mode 100644 yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控端点 Actuator 入门》.md rename yudao-framework/yudao-spring-boot-starter-monitor/{src/main/java/cn/iocoder/yudao/framework/tracer => }/《芋道 Spring Boot 链路追踪 SkyWalking 入门》.md (100%) rename yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/{IdempotentConfiguration.java => YudaoIdempotentConfiguration.java} (97%) rename yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/{Lock4jConfiguration.java => YudaoLock4jConfiguration.java} (94%) create mode 100644 yudao-framework/yudao-spring-boot-starter-protection/src/main/resources/resources/META-INF/spring.factories rename yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/{RedisConfig.java => YudaoRedisAutoConfiguration.java} (99%) create mode 100644 yudao-framework/yudao-spring-boot-starter-redis/src/main/resources/META-INF/spring.factories create mode 100644 yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java rename yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/{YudaoSecurityConfiguration.java => YudaoWebSecurityConfigurerAdapter.java} (85%) create mode 100644 yudao-framework/yudao-spring-boot-starter-security/src/main/resources/META-INF/spring.factories delete mode 100644 yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/package-info.java rename yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/{dashboard => yudao}/framework/test/core/ut/BaseMockitoUnitTest.java (82%) create mode 100644 yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/package-info.java rename yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/{dashboard => yudao}/framework/test/core/util/AssertUtils.java (98%) rename yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/{dashboard => yudao}/framework/test/core/util/RandomUtils.java (98%) rename yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/{dashboard => yudao}/framework/test/package-info.java (59%) create mode 100644 yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring.factories diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java index c9df9a541..83af689e0 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.dashboard.framework.quartz.core.util.CronUtils; +import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.*; import cn.iocoder.dashboard.modules.infra.convert.job.InfJobConvert; import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobDO; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobLogDO.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobLogDO.java index 46745440c..49d76e0e8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobLogDO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobLogDO.java @@ -1,7 +1,7 @@ package cn.iocoder.dashboard.modules.infra.dal.dataobject.job; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.dashboard.framework.quartz.core.handler.JobHandler; +import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; import cn.iocoder.dashboard.modules.infra.enums.job.InfJobLogStatusEnum; import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/config/InfConfigDAOImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/config/InfConfigDAOImpl.java index 48f44bd2f..d6a5019b7 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/config/InfConfigDAOImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/config/InfConfigDAOImpl.java @@ -1,8 +1,7 @@ package cn.iocoder.dashboard.modules.infra.dal.mysql.config; -import cn.iocoder.dashboard.framework.apollo.internals.ConfigFrameworkDAO; -import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; -import cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO; +import cn.iocoder.yudao.framework.apollo.internals.ConfigFrameworkDAO; +import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/mq/consumer/config/InfConfigRefreshConsumer.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/mq/consumer/config/InfConfigRefreshConsumer.java index 9ad56529d..a47493ca4 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/mq/consumer/config/InfConfigRefreshConsumer.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/mq/consumer/config/InfConfigRefreshConsumer.java @@ -1,6 +1,6 @@ package cn.iocoder.dashboard.modules.infra.mq.consumer.config; -import cn.iocoder.dashboard.framework.apollo.internals.DBConfigRepository; +import cn.iocoder.yudao.framework.apollo.internals.DBConfigRepository; import cn.iocoder.yudao.framework.redis.core.pubsub.AbstractChannelMessageListener; import cn.iocoder.dashboard.modules.infra.mq.message.config.InfConfigRefreshMessage; import lombok.extern.slf4j.Slf4j; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java index 9ffefbe8f..97fb19a63 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java @@ -1,7 +1,7 @@ package cn.iocoder.dashboard.modules.infra.service.job; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.quartz.core.service.JobLogFrameworkService; +import cn.iocoder.yudao.framework.quartz.core.service.JobLogFrameworkService; import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExportReqVO; import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogPageReqVO; import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobServiceImpl.java index cc534c9b3..055d7efe1 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobServiceImpl.java @@ -1,8 +1,8 @@ package cn.iocoder.dashboard.modules.infra.service.job.impl; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.quartz.core.scheduler.SchedulerManager; -import cn.iocoder.dashboard.framework.quartz.core.util.CronUtils; +import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager; +import cn.iocoder.yudao.framework.quartz.core.util.CronUtils; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobCreateReqVO; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobExportReqVO; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobPageReqVO; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/controller/sms/SmsCallbackController.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/controller/sms/SmsCallbackController.java index 3f70116d5..3562621e8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/controller/sms/SmsCallbackController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/controller/sms/SmsCallbackController.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.URLUtil; import cn.hutool.extra.servlet.ServletUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsChannelEnum; +import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; import cn.iocoder.dashboard.modules.system.service.sms.SysSmsService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/sms/SysSmsChannelConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/sms/SysSmsChannelConvert.java index 88541afe5..4236565c9 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/sms/SysSmsChannelConvert.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/convert/sms/SysSmsChannelConvert.java @@ -1,7 +1,7 @@ package cn.iocoder.dashboard.modules.system.convert.sms; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelRespVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelSimpleRespVO; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsChannelDO.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsChannelDO.java index dc36cc5e1..befc9b9bd 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsChannelDO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsChannelDO.java @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.dal.dataobject.sms; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsChannelEnum; +import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsLogDO.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsLogDO.java index 9506ad330..782d004bd 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsLogDO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/dal/dataobject/sms/SysSmsLogDO.java @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.dal.dataobject.sms; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import cn.iocoder.dashboard.modules.system.enums.sms.SysSmsReceiveStatusEnum; import cn.iocoder.dashboard.modules.system.enums.sms.SysSmsSendStatusEnum; import com.baomidou.mybatisplus.annotation.TableField; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java index 96ec74b62..0d028ee30 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java @@ -1,6 +1,6 @@ package cn.iocoder.dashboard.modules.system.job.auth; -import cn.iocoder.dashboard.framework.quartz.core.handler.JobHandler; +import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; import cn.iocoder.dashboard.modules.system.service.auth.SysUserSessionService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/auth/impl/SysAuthServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/auth/impl/SysAuthServiceImpl.java index fddd14b52..11d6f5fc5 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/auth/impl/SysAuthServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/auth/impl/SysAuthServiceImpl.java @@ -18,6 +18,7 @@ import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionServi import cn.iocoder.dashboard.modules.system.service.user.SysUserService; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.DisabledException; @@ -46,6 +47,7 @@ import static java.util.Collections.singleton; public class SysAuthServiceImpl implements SysAuthService { @Resource + @Lazy // 延迟加载,因为存在相互依赖的问题 private AuthenticationManager authenticationManager; @Resource private SysUserService userService; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsChannelServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsChannelServiceImpl.java index 307ad1607..f0fe411ba 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsChannelServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsChannelServiceImpl.java @@ -3,8 +3,8 @@ package cn.iocoder.dashboard.modules.system.service.sms.impl; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelPageReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelUpdateReqVO; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsServiceImpl.java index df0e9dc3e..7e2f350ee 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsServiceImpl.java @@ -5,11 +5,11 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; import cn.iocoder.dashboard.modules.system.dal.dataobject.sms.SysSmsTemplateDO; import cn.iocoder.dashboard.modules.system.dal.dataobject.user.SysUserDO; import cn.iocoder.dashboard.modules.system.mq.message.sms.SysSmsSendMessage; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsTemplateServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsTemplateServiceImpl.java index 8a561da85..2e046932f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsTemplateServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/dashboard/modules/system/service/sms/impl/SysSmsTemplateServiceImpl.java @@ -6,10 +6,10 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplateCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplateExportReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplatePageReqVO; diff --git a/yudao-admin-server/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector b/yudao-admin-server/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector deleted file mode 100644 index a52f206f2..000000000 --- a/yudao-admin-server/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector +++ /dev/null @@ -1 +0,0 @@ -cn.iocoder.dashboard.framework.apollo.internals.DefaultXInjector diff --git a/yudao-admin-server/src/main/resources/META-INF/spring.factories b/yudao-admin-server/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 8a5fa5488..000000000 --- a/yudao-admin-server/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.env.EnvironmentPostProcessor=\ - cn.iocoder.dashboard.framework.apollo.spring.boot.ApolloApplicationContextInitializer diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index 9e9f9400b..ff50a8940 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -40,3 +40,5 @@ yudao: constants-class-list: - cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants - cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants + +debug: false diff --git a/yudao-admin-server/src/main/resources/1logback-spring.xml b/yudao-admin-server/src/main/resources/logback-spring.xml similarity index 100% rename from yudao-admin-server/src/main/resources/1logback-spring.xml rename to yudao-admin-server/src/main/resources/logback-spring.xml diff --git a/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java b/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java index 72216d2cf..6694db71f 100644 --- a/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java +++ b/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java @@ -2,7 +2,7 @@ package cn.iocoder.dashboard; import cn.iocoder.yudao.framework.datasource.config.DataSourceConfiguration; import cn.iocoder.yudao.framework.mybatis.config.MybatisConfiguration; -import cn.iocoder.yudao.framework.redis.config.RedisConfig; +import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration; import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; import org.redisson.spring.starter.RedissonAutoConfiguration; diff --git a/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseRedisIntegrationTest.java b/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseRedisIntegrationTest.java index 287a5f3fd..469efa5e8 100644 --- a/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseRedisIntegrationTest.java +++ b/yudao-admin-server/src/test-integration/java/cn/iocoder/dashboard/BaseRedisIntegrationTest.java @@ -1,6 +1,6 @@ package cn.iocoder.dashboard; -import cn.iocoder.yudao.framework.redis.config.RedisConfig; +import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; import org.redisson.spring.starter.RedissonAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseDbAndRedisUnitTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseDbAndRedisUnitTest.java index 5a6493c80..1a3b8549d 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseDbAndRedisUnitTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseDbAndRedisUnitTest.java @@ -1,7 +1,7 @@ package cn.iocoder.dashboard; import cn.iocoder.dashboard.config.RedisTestConfiguration; -import cn.iocoder.yudao.framework.redis.config.RedisConfig; +import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; @@ -39,7 +39,7 @@ public class BaseDbAndRedisUnitTest { // Redis 配置类 RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer RedisAutoConfiguration.class, // Spring Redis 自动配置类 - RedisConfig.class, // 自己的 Redis 配置类 + YudaoRedisAutoConfiguration.class, // 自己的 Redis 配置类 RedissonAutoConfiguration.class, // Redisson 自动高配置类 }) public static class Application { diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseRedisUnitTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseRedisUnitTest.java index 93affa2d1..ce9ac1b8b 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseRedisUnitTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/BaseRedisUnitTest.java @@ -1,7 +1,8 @@ package cn.iocoder.dashboard; import cn.iocoder.dashboard.config.RedisTestConfiguration; -import cn.iocoder.yudao.framework.redis.config.RedisConfig; +import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; +import cn.iocoder.yudao.framework.tracer.config.YudaoTracerAutoConfiguration; import org.redisson.spring.starter.RedissonAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; @@ -23,7 +24,7 @@ public class BaseRedisUnitTest { // Redis 配置类 RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer RedisAutoConfiguration.class, // Spring Redis 自动配置类 - RedisConfig.class, // 自己的 Redis 配置类 + YudaoTracerAutoConfiguration.class, // 自己的 Redis 配置类 RedissonAutoConfiguration.class, // Redisson 自动高配置类 }) public static class Application { diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/config/InfConfigServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/config/InfConfigServiceTest.java index 1d60143e1..f6cc3d9be 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/config/InfConfigServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/config/InfConfigServiceTest.java @@ -23,10 +23,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/file/InfFileServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/file/InfFileServiceTest.java index 348abc8bf..9a1b565e5 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/file/InfFileServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/file/InfFileServiceTest.java @@ -14,12 +14,12 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.FILE_NOT_EXISTS; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.FILE_PATH_EXISTS; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.*; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogServiceTest.java index a7e94dce4..f02882531 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogServiceTest.java @@ -1,10 +1,10 @@ package cn.iocoder.dashboard.modules.infra.service.job; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobServiceTest.java index d426a1e5c..dde36004f 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobServiceTest.java @@ -7,10 +7,10 @@ import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.JOB import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.JOB_HANDLER_EXISTS; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.JOB_NOT_EXISTS; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.JOB_UPDATE_ONLY_NORMAL_STATUS; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -30,7 +30,7 @@ import org.springframework.context.annotation.Import; import cn.iocoder.dashboard.BaseDbUnitTest; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.quartz.core.scheduler.SchedulerManager; +import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobCreateReqVO; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobExportReqVO; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.InfJobPageReqVO; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiAccessLogServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiAccessLogServiceImplTest.java index 89bcef328..11a00cdae 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiAccessLogServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiAccessLogServiceImplTest.java @@ -11,7 +11,7 @@ import cn.iocoder.dashboard.modules.infra.controller.logger.vo.apiaccesslog.InfA import cn.iocoder.dashboard.modules.infra.dal.dataobject.logger.InfApiAccessLogDO; import cn.iocoder.dashboard.modules.infra.dal.mysql.logger.InfApiAccessLogMapper; import cn.iocoder.dashboard.modules.infra.service.logger.impl.InfApiAccessLogServiceImpl; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -21,7 +21,7 @@ import java.util.Date; import java.util.List; import java.util.concurrent.Future; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiErrorLogServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiErrorLogServiceImplTest.java index 442724456..d82afaddb 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiErrorLogServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/infra/service/logger/InfApiErrorLogServiceImplTest.java @@ -11,7 +11,7 @@ import cn.iocoder.dashboard.modules.infra.dal.dataobject.logger.InfApiErrorLogDO import cn.iocoder.dashboard.modules.infra.dal.mysql.logger.InfApiErrorLogMapper; import cn.iocoder.dashboard.modules.infra.enums.logger.InfApiErrorLogProcessStatusEnum; import cn.iocoder.dashboard.modules.infra.service.logger.impl.InfApiErrorLogServiceImpl; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -23,8 +23,8 @@ import java.util.concurrent.Future; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.API_ERROR_LOG_NOT_FOUND; import static cn.iocoder.dashboard.modules.infra.enums.InfErrorCodeConstants.API_ERROR_LOG_PROCESSED; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysAuthServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysAuthServiceImplTest.java index 9be405a77..5e621d092 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysAuthServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysAuthServiceImplTest.java @@ -12,7 +12,7 @@ import cn.iocoder.dashboard.modules.system.service.common.SysCaptchaService; import cn.iocoder.dashboard.modules.system.service.logger.SysLoginLogService; import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionService; import cn.iocoder.dashboard.modules.system.service.user.SysUserService; -import cn.iocoder.dashboard.framework.test.core.util.AssertUtils; +import cn.iocoder.yudao.framework.test.core.util.AssertUtils; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; @@ -28,8 +28,8 @@ import javax.annotation.Resource; import java.util.Set; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysUserSessionServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysUserSessionServiceImplTest.java index 8302cf0fc..aa782d9bb 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysUserSessionServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/auth/SysUserSessionServiceImplTest.java @@ -1,11 +1,11 @@ package cn.iocoder.dashboard.modules.system.service.auth; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomDate; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomDate; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.addTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -42,8 +42,8 @@ import cn.iocoder.dashboard.modules.system.service.auth.impl.SysUserSessionServi import cn.iocoder.dashboard.modules.system.service.dept.impl.SysDeptServiceImpl; import cn.iocoder.dashboard.modules.system.service.logger.impl.SysLoginLogServiceImpl; import cn.iocoder.dashboard.modules.system.service.user.SysUserServiceImpl; -import cn.iocoder.dashboard.framework.test.core.util.AssertUtils; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.AssertUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; /** diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/common/SysCaptchaServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/common/SysCaptchaServiceTest.java index d397ef16f..dadd68a89 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/common/SysCaptchaServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/common/SysCaptchaServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomString; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static org.junit.jupiter.api.Assertions.*; @Import({SysCaptchaServiceImpl.class, CaptchaProperties.class, SysCaptchaRedisDAO.class}) diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysDeptServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysDeptServiceTest.java index 72300ecf6..4913f6ac6 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysDeptServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysDeptServiceTest.java @@ -26,9 +26,9 @@ import java.util.function.Consumer; import static cn.hutool.core.bean.BeanUtil.getFieldValue; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysPostServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysPostServiceTest.java index 641ad2d3b..97fe19936 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysPostServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dept/SysPostServiceTest.java @@ -21,10 +21,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.*; /** diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictDataServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictDataServiceTest.java index 60b0c8756..1ed2bb268 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictDataServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictDataServiceTest.java @@ -26,9 +26,9 @@ import java.util.function.Consumer; import static cn.hutool.core.bean.BeanUtil.getFieldValue; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeServiceTest.java index a0c116c13..5e9de9540 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeServiceTest.java @@ -22,10 +22,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/errorcode/SysErrorCodeServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/errorcode/SysErrorCodeServiceTest.java index 3dd14ba69..ee5518555 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/errorcode/SysErrorCodeServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/errorcode/SysErrorCodeServiceTest.java @@ -27,10 +27,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.ERROR_CODE_DUPLICATE; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.ERROR_CODE_NOT_EXISTS; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; /** diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysLoginLogServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysLoginLogServiceImplTest.java index e3ad2fb90..715e99e6a 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysLoginLogServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysLoginLogServiceImplTest.java @@ -12,7 +12,7 @@ import cn.iocoder.dashboard.modules.system.dal.mysql.logger.SysLoginLogMapper; import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginLogTypeEnum; import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginResultEnum; import cn.iocoder.dashboard.modules.system.service.logger.impl.SysLoginLogServiceImpl; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -20,7 +20,7 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.List; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysOperateLogServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysOperateLogServiceImplTest.java index ac34034ec..3407cafa0 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysOperateLogServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/logger/SysOperateLogServiceImplTest.java @@ -16,7 +16,7 @@ import cn.iocoder.dashboard.modules.system.dal.mysql.logger.SysOperateLogMapper; import cn.iocoder.dashboard.modules.system.enums.common.SysSexEnum; import cn.iocoder.dashboard.modules.system.service.logger.impl.SysOperateLogServiceImpl; import cn.iocoder.dashboard.modules.system.service.user.SysUserService; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; @@ -27,8 +27,8 @@ import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/notice/SysNoticeServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/notice/SysNoticeServiceImplTest.java index f3dab91eb..b680ecab2 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/notice/SysNoticeServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/notice/SysNoticeServiceImplTest.java @@ -20,10 +20,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.NOTICE_NOT_FOUND; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.*; @Import(SysNoticeServiceImpl.class) diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysMenuServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysMenuServiceTest.java index a804d462b..deda173ad 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysMenuServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysMenuServiceTest.java @@ -13,7 +13,7 @@ import cn.iocoder.dashboard.modules.system.enums.permission.MenuTypeEnum; import cn.iocoder.dashboard.modules.system.mq.producer.permission.SysMenuProducer; import cn.iocoder.dashboard.modules.system.service.permission.impl.SysMenuServiceImpl; import cn.iocoder.yudao.framework.common.util.sping.SpringAopUtils; -import cn.iocoder.dashboard.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import com.google.common.collect.Multimap; import org.junit.jupiter.api.Assertions; @@ -25,9 +25,9 @@ import javax.annotation.Resource; import java.util.*; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.verify; @@ -108,7 +108,7 @@ public class SysMenuServiceTest extends BaseDbUnitTest { Long parentId = sonMenuDO.getParentId(); //调用 - SysMenuUpdateReqVO vo = RandomUtils.randomPojo(SysMenuUpdateReqVO.class, o -> { + SysMenuUpdateReqVO vo = randomPojo(SysMenuUpdateReqVO.class, o -> { o.setId(sonId); o.setParentId(parentId); o.setType(MenuTypeEnum.MENU.getType()); @@ -131,7 +131,7 @@ public class SysMenuServiceTest extends BaseDbUnitTest { Long parentId = 10000L; //调用 - SysMenuUpdateReqVO vo = RandomUtils.randomPojo(SysMenuUpdateReqVO.class, o -> { + SysMenuUpdateReqVO vo = randomPojo(SysMenuUpdateReqVO.class, o -> { o.setId(sonId); o.setParentId(parentId); o.setType(MenuTypeEnum.MENU.getType()); @@ -354,7 +354,7 @@ public class SysMenuServiceTest extends BaseDbUnitTest { } private SysMenuDO createMenuDO(Long id, MenuTypeEnum typeEnum, String menuName, Long parentId, Integer status) { - return RandomUtils.randomPojo(SysMenuDO.class, o -> { + return randomPojo(SysMenuDO.class, o -> { o.setId(id); o.setParentId(parentId); o.setType(typeEnum.getType()); diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysPermissionServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysPermissionServiceTest.java index 591e08b68..1091d58a9 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysPermissionServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysPermissionServiceTest.java @@ -14,9 +14,9 @@ import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.util.List; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.verify; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysRoleServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysRoleServiceTest.java index fd2936e2d..41696df05 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysRoleServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/permission/SysRoleServiceTest.java @@ -23,10 +23,10 @@ import java.util.*; import java.util.stream.Collectors; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.verify; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsChannelServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsChannelServiceTest.java index f233d6012..252c31d59 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsChannelServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsChannelServiceTest.java @@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.iocoder.dashboard.BaseDbUnitTest; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelPageReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.channel.SysSmsChannelUpdateReqVO; @@ -25,10 +25,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.SMS_CHANNEL_HAS_CHILDREN; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.SMS_CHANNEL_NOT_EXISTS; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsLogServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsLogServiceTest.java index ec778b4ac..aa59bf574 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsLogServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsLogServiceTest.java @@ -27,9 +27,9 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomBoolean; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; /** diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsServiceTest.java index 39db4becd..c07f08b63 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsServiceTest.java @@ -5,11 +5,11 @@ import cn.iocoder.dashboard.BaseMockitoUnitTest; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; import cn.iocoder.dashboard.modules.system.dal.dataobject.sms.SysSmsTemplateDO; import cn.iocoder.dashboard.modules.system.mq.message.sms.SysSmsSendMessage; import cn.iocoder.dashboard.modules.system.mq.producer.sms.SysSmsProducer; @@ -25,8 +25,8 @@ import java.util.Map; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsTemplateServiceTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsTemplateServiceTest.java index fb5cbd520..295e9de75 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsTemplateServiceTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/sms/SysSmsTemplateServiceTest.java @@ -4,10 +4,10 @@ import cn.iocoder.dashboard.BaseDbUnitTest; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplateCreateReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplateExportReqVO; import cn.iocoder.dashboard.modules.system.controller.sms.vo.template.SysSmsTemplatePageReqVO; @@ -34,11 +34,11 @@ import java.util.function.Consumer; import static cn.hutool.core.bean.BeanUtil.getFieldValue; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; diff --git a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/user/SysUserServiceImplTest.java b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/user/SysUserServiceImplTest.java index 88aaf5108..9d5505081 100644 --- a/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/user/SysUserServiceImplTest.java +++ b/yudao-admin-server/src/test/java/cn/iocoder/dashboard/modules/system/service/user/SysUserServiceImplTest.java @@ -35,10 +35,10 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomBytes; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.dashboard.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.assertj.core.util.Lists.newArrayList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/DictConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java similarity index 54% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/DictConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java index 551872fd8..1828585c0 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/DictConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/config/YudaoDictAutoConfiguration.java @@ -1,18 +1,18 @@ package cn.iocoder.yudao.framework.dict.config; import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; -import cn.iocoder.yudao.framework.dict.core.util.DictUtils; +import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration -public class DictConfiguration { +public class YudaoDictAutoConfiguration { @Bean @SuppressWarnings("InstantiationOfUtilityClass") - public DictUtils dictUtils(DictDataFrameworkService service) { - DictUtils.init(service); - return new DictUtils(); + public DictFrameworkUtils dictUtils(DictDataFrameworkService service) { + DictFrameworkUtils.init(service); + return new DictFrameworkUtils(); } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java similarity index 82% rename from yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictUtils.java rename to yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java index 1e2ce436a..ee1de88f2 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtils.java @@ -8,13 +8,13 @@ import lombok.extern.slf4j.Slf4j; * 字典工具类 */ @Slf4j -public class DictUtils { +public class DictFrameworkUtils { private static DictDataFrameworkService service; public static void init(DictDataFrameworkService service) { - DictUtils.service = service; - log.info("[init][初始化 DictUtils 成功]"); + DictFrameworkUtils.service = service; + log.info("[init][初始化 DictFrameworkUtils 成功]"); } public static DictDataRespDTO getDictDataFromCache(String type, String value) { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java index a3226af1d..94a787e9d 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/java/cn/iocoder/yudao/framework/dict/package-info.java @@ -1,5 +1,5 @@ /** - * 字典数据模块,提供 {@link cn.iocoder.yudao.framework.dict.core.util.DictUtils} 工具类 + * 字典数据模块,提供 {@link cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils} 工具类 * * 通过将字典缓存在内存中,保证性能 */ diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..529a47663 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.operatelog.config.YudaoOperateLogAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java index 8dd98d49a..1c8f49a26 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/dto/OperateLogCreateReqDTO.java @@ -56,7 +56,7 @@ public class OperateLogCreateReqDTO { @NotEmpty(message = "浏览器 UserAgent 不能为空") private String userAgent; - @ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.dashboard.UserController.save(...)") + @ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.yudao.UserController.save(...)") @NotEmpty(message = "Java 方法名不能为空") private String javaMethod; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..529a47663 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.operatelog.config.YudaoOperateLogAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java deleted file mode 100644 index 18ab0e702..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.aliyun; - -import cn.iocoder.yudao.framework.common.exception.ErrorCode; -import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCodeMapping; - -import static cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants.*; - -/** - * 阿里云的 SmsCodeMapping 实现类 - * - * 参见 https://help.aliyun.com/document_detail/101346.htm 文档 - * - * @author 芋道源码 - */ -public class AliyunSmsCodeMapping implements SmsCodeMapping { - - @Override - public ErrorCode apply(String apiCode) { - switch (apiCode) { - case "OK": return GlobalErrorCodeConstants.SUCCESS; - case "isv.ACCOUNT_NOT_EXISTS": - case "isv.ACCOUNT_ABNORMAL": - case "MissingAccessKeyId": return SMS_ACCOUNT_INVALID; - case "isp.RAM_PERMISSION_DENY": return SMS_PERMISSION_DENY; - case "isv.INVALID_JSON_PARAM": - case "isv.INVALID_PARAMETERS": return SMS_API_PARAM_ERROR; - case "isv.BUSINESS_LIMIT_CONTROL": return SMS_SEND_BUSINESS_LIMIT_CONTROL; - case "isv.DAY_LIMIT_CONTROL": return SMS_SEND_DAY_LIMIT_CONTROL; - case "isv.SMS_CONTENT_ILLEGAL": return SMS_SEND_CONTENT_INVALID; - case "isv.SMS_TEMPLATE_ILLEGAL": return SMS_TEMPLATE_INVALID; - case "isv.SMS_SIGNATURE_ILLEGAL": - case "isv.SIGN_NAME_ILLEGAL": - case "isv.SMS_SIGN_ILLEGAL": return SMS_SIGN_INVALID; - case "isv.AMOUNT_NOT_ENOUGH": - case "isv.OUT_OF_SERVICE": return SMS_ACCOUNT_MONEY_NOT_ENOUGH; - case "isv.MOBILE_NUMBER_ILLEGAL": return SMS_MOBILE_INVALID; - case "isv.TEMPLATE_MISSING_PARAMETERS": return SMS_TEMPLATE_PARAM_ERROR; - } - return SMS_UNKNOWN; - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java deleted file mode 100644 index 9261684b7..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.yunpian; - -import cn.iocoder.yudao.framework.common.exception.ErrorCode; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCodeMapping; - -import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS; -import static cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants.*; -import static com.yunpian.sdk.constant.Code.*; - -/** - * 云片的 SmsCodeMapping 实现类 - * - * 参见 https://www.yunpian.com/official/document/sms/zh_CN/returnvalue_common 文档 - * - * @author 芋道源码 - */ -public class YunpianSmsCodeMapping implements SmsCodeMapping { - - @Override - public ErrorCode apply(String apiCode) { - int code = Integer.parseInt(apiCode); - switch (code) { - case OK: return SUCCESS; - case ARGUMENT_MISSING: return SMS_API_PARAM_ERROR; - case BAD_ARGUMENT_FORMAT: return SMS_TEMPLATE_PARAM_ERROR; - case TPL_NOT_FOUND: - case TPL_NOT_VALID: return SMS_TEMPLATE_INVALID; - case MONEY_NOT_ENOUGH: return SMS_ACCOUNT_MONEY_NOT_ENOUGH; - case BLACK_WORD: return SMS_SEND_CONTENT_INVALID; - case DUP_IN_SHORT_TIME: - case TOO_MANY_TIME_IN_5: - case DAY_LIMIT_PER_MOBILE: - case HOUR_LIMIT_PER_MOBILE: return SMS_SEND_BUSINESS_LIMIT_CONTROL; - case BLACK_PHONE_FILTER: return SMS_MOBILE_BLACK; - case SIGN_NOT_MATCH: - case BAD_SIGN_FORMAT: - case SIGN_NOT_VALID: return SMS_SIGN_INVALID; - case BAD_API_KEY: return SMS_ACCOUNT_INVALID; - case API_NOT_ALLOWED: return SMS_PERMISSION_DENY; - case IP_NOT_ALLOWED: return SMS_IP_DENY; - } - return SMS_UNKNOWN; - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/config/SmsConfiguration.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/config/YudaoSmsAutoConfiguration.java similarity index 55% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/config/SmsConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/config/YudaoSmsAutoConfiguration.java index e5441c91f..e6be48377 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/config/SmsConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/config/YudaoSmsAutoConfiguration.java @@ -1,7 +1,7 @@ -package cn.iocoder.dashboard.framework.sms.config; +package cn.iocoder.yudao.framework.sms.config; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.impl.SmsClientFactoryImpl; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.impl.SmsClientFactoryImpl; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; * @author 芋道源码 */ @Configuration -public class SmsConfiguration { +public class YudaoSmsAutoConfiguration { @Bean public SmsClientFactory smsClientFactory() { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClient.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClient.java similarity index 81% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClient.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClient.java index ee7bbc192..2f936de8c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClient.java @@ -1,9 +1,9 @@ -package cn.iocoder.dashboard.framework.sms.core.client; +package cn.iocoder.yudao.framework.sms.core.client; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; import java.util.List; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClientFactory.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClientFactory.java similarity index 81% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClientFactory.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClientFactory.java index 83fb88c24..d880b4ebd 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsClientFactory.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsClientFactory.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.sms.core.client; +package cn.iocoder.yudao.framework.sms.core.client; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; /** * 短信客户端工厂接口 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCodeMapping.java similarity index 69% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCodeMapping.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCodeMapping.java index d2a726b2e..826306fde 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCodeMapping.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCodeMapping.java @@ -1,7 +1,7 @@ -package cn.iocoder.dashboard.framework.sms.core.client; +package cn.iocoder.yudao.framework.sms.core.client; import cn.iocoder.yudao.framework.common.exception.ErrorCode; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import java.util.function.Function; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCommonResult.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCommonResult.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCommonResult.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCommonResult.java index 2780c8dd6..d314de2cd 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/SmsCommonResult.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/SmsCommonResult.java @@ -1,10 +1,10 @@ -package cn.iocoder.dashboard.framework.sms.core.client; +package cn.iocoder.yudao.framework.sms.core.client; import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.lang.Assert; import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsReceiveRespDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsReceiveRespDTO.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsReceiveRespDTO.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsReceiveRespDTO.java index ecfdb045c..8c841ebea 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsReceiveRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsReceiveRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.client.dto; +package cn.iocoder.yudao.framework.sms.core.client.dto; import lombok.Data; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsSendRespDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsSendRespDTO.java similarity index 77% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsSendRespDTO.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsSendRespDTO.java index c3f6b51ae..9d320d57b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsSendRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsSendRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.client.dto; +package cn.iocoder.yudao.framework.sms.core.client.dto; import lombok.Data; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsTemplateRespDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsTemplateRespDTO.java similarity index 76% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsTemplateRespDTO.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsTemplateRespDTO.java index 938310e71..70e8df400 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/dto/SmsTemplateRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/dto/SmsTemplateRespDTO.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.sms.core.client.dto; +package cn.iocoder.yudao.framework.sms.core.client.dto; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; import lombok.Data; /** diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/AbstractSmsClient.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/AbstractSmsClient.java similarity index 85% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/AbstractSmsClient.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/AbstractSmsClient.java index bad40fd0d..a96038059 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/AbstractSmsClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/AbstractSmsClient.java @@ -1,13 +1,13 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl; +package cn.iocoder.yudao.framework.sms.core.client.impl; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCodeMapping; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsCodeMapping; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import lombok.extern.slf4j.Slf4j; import java.util.List; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/SmsClientFactoryImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java similarity index 83% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/SmsClientFactoryImpl.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java index 44f87d7df..365196afb 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/SmsClientFactoryImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/SmsClientFactoryImpl.java @@ -1,12 +1,12 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl; +package cn.iocoder.yudao.framework.sms.core.client.impl; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.SmsClientFactory; -import cn.iocoder.dashboard.framework.sms.core.client.impl.aliyun.AliyunSmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.impl.debug.DebugDingTalkSmsClient; -import cn.iocoder.dashboard.framework.sms.core.client.impl.yunpian.YunpianSmsClient; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsChannelEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsClient; +import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; +import cn.iocoder.yudao.framework.sms.core.client.impl.aliyun.AliyunSmsClient; +import cn.iocoder.yudao.framework.sms.core.client.impl.debug.DebugDingTalkSmsClient; +import cn.iocoder.yudao.framework.sms.core.client.impl.yunpian.YunpianSmsClient; +import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.util.Assert; import org.springframework.validation.annotation.Validated; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java index b47406b87..9c206e97f 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClient.java @@ -1,16 +1,16 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.aliyun; +package cn.iocoder.yudao.framework.sms.core.client.impl.aliyun; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.impl.AbstractSmsClient; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import com.aliyuncs.AcsRequest; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java new file mode 100644 index 000000000..549bf8b0b --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMapping.java @@ -0,0 +1,42 @@ +package cn.iocoder.yudao.framework.sms.core.client.impl.aliyun; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.client.SmsCodeMapping; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; + +/** + * 阿里云的 SmsCodeMapping 实现类 + * + * 参见 https://help.aliyun.com/document_detail/101346.htm 文档 + * + * @author 芋道源码 + */ +public class AliyunSmsCodeMapping implements SmsCodeMapping { + + @Override + public ErrorCode apply(String apiCode) { + switch (apiCode) { + case "OK": return GlobalErrorCodeConstants.SUCCESS; + case "isv.ACCOUNT_NOT_EXISTS": + case "isv.ACCOUNT_ABNORMAL": + case "MissingAccessKeyId": return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_INVALID; + case "isp.RAM_PERMISSION_DENY": return SmsFrameworkErrorCodeConstants.SMS_PERMISSION_DENY; + case "isv.INVALID_JSON_PARAM": + case "isv.INVALID_PARAMETERS": return SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR; + case "isv.BUSINESS_LIMIT_CONTROL": return SmsFrameworkErrorCodeConstants.SMS_SEND_BUSINESS_LIMIT_CONTROL; + case "isv.DAY_LIMIT_CONTROL": return SmsFrameworkErrorCodeConstants.SMS_SEND_DAY_LIMIT_CONTROL; + case "isv.SMS_CONTENT_ILLEGAL": return SmsFrameworkErrorCodeConstants.SMS_SEND_CONTENT_INVALID; + case "isv.SMS_TEMPLATE_ILLEGAL": return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_INVALID; + case "isv.SMS_SIGNATURE_ILLEGAL": + case "isv.SIGN_NAME_ILLEGAL": + case "isv.SMS_SIGN_ILLEGAL": return SmsFrameworkErrorCodeConstants.SMS_SIGN_INVALID; + case "isv.AMOUNT_NOT_ENOUGH": + case "isv.OUT_OF_SERVICE": return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH; + case "isv.MOBILE_NUMBER_ILLEGAL": return SmsFrameworkErrorCodeConstants.SMS_MOBILE_INVALID; + case "isv.TEMPLATE_MISSING_PARAMETERS": return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR; + } + return SmsFrameworkErrorCodeConstants.SMS_UNKNOWN; + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java similarity index 62% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java index efd50a4c8..0a7e48bfc 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkCodeMapping.java @@ -1,13 +1,12 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.debug; +package cn.iocoder.yudao.framework.sms.core.client.impl.debug; import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCodeMapping; +import cn.iocoder.yudao.framework.sms.core.client.SmsCodeMapping; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import java.util.Objects; -import static cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants.SMS_UNKNOWN; - /** * 钉钉的 SmsCodeMapping 实现类 * @@ -17,7 +16,7 @@ public class DebugDingTalkCodeMapping implements SmsCodeMapping { @Override public ErrorCode apply(String apiCode) { - return Objects.equals(apiCode, "0") ? GlobalErrorCodeConstants.SUCCESS : SMS_UNKNOWN; + return Objects.equals(apiCode, "0") ? GlobalErrorCodeConstants.SUCCESS : SmsFrameworkErrorCodeConstants.SMS_UNKNOWN; } } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java similarity index 85% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java index aff2e67c1..cedcfb6dc 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/debug/DebugDingTalkSmsClient.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.debug; +package cn.iocoder.yudao.framework.sms.core.client.impl.debug; import cn.hutool.core.codec.Base64; import cn.hutool.core.lang.Assert; @@ -8,13 +8,13 @@ import cn.hutool.crypto.digest.DigestUtil; import cn.hutool.crypto.digest.HmacAlgorithm; import cn.hutool.http.HttpUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.impl.AbstractSmsClient; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java index 7ed31c2f7..8adff8f60 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClient.java @@ -1,17 +1,17 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.yunpian; +package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.URLUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.impl.AbstractSmsClient; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java new file mode 100644 index 000000000..d6ecdce92 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMapping.java @@ -0,0 +1,45 @@ +package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; +import cn.iocoder.yudao.framework.sms.core.client.SmsCodeMapping; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; + +import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.SUCCESS; +import static com.yunpian.sdk.constant.Code.*; + +/** + * 云片的 SmsCodeMapping 实现类 + * + * 参见 https://www.yunpian.com/official/document/sms/zh_CN/returnvalue_common 文档 + * + * @author 芋道源码 + */ +public class YunpianSmsCodeMapping implements SmsCodeMapping { + + @Override + public ErrorCode apply(String apiCode) { + int code = Integer.parseInt(apiCode); + switch (code) { + case OK: return SUCCESS; + case ARGUMENT_MISSING: return SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR; + case BAD_ARGUMENT_FORMAT: return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR; + case TPL_NOT_FOUND: + case TPL_NOT_VALID: return SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_INVALID; + case MONEY_NOT_ENOUGH: return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH; + case BLACK_WORD: return SmsFrameworkErrorCodeConstants.SMS_SEND_CONTENT_INVALID; + case DUP_IN_SHORT_TIME: + case TOO_MANY_TIME_IN_5: + case DAY_LIMIT_PER_MOBILE: + case HOUR_LIMIT_PER_MOBILE: return SmsFrameworkErrorCodeConstants.SMS_SEND_BUSINESS_LIMIT_CONTROL; + case BLACK_PHONE_FILTER: return SmsFrameworkErrorCodeConstants.SMS_MOBILE_BLACK; + case SIGN_NOT_MATCH: + case BAD_SIGN_FORMAT: + case SIGN_NOT_VALID: return SmsFrameworkErrorCodeConstants.SMS_SIGN_INVALID; + case BAD_API_KEY: return SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_INVALID; + case API_NOT_ALLOWED: return SmsFrameworkErrorCodeConstants.SMS_PERMISSION_DENY; + case IP_NOT_ALLOWED: return SmsFrameworkErrorCodeConstants.SMS_IP_DENY; + } + return SmsFrameworkErrorCodeConstants.SMS_UNKNOWN; + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsChannelEnum.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsChannelEnum.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java index ba2615d3d..c62478ca7 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsChannelEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsChannelEnum.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.enums; +package cn.iocoder.yudao.framework.sms.core.enums; import cn.hutool.core.util.ArrayUtil; import lombok.AllArgsConstructor; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java similarity index 97% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java index bfd77fb68..6770fcfc1 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsFrameworkErrorCodeConstants.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.enums; +package cn.iocoder.yudao.framework.sms.core.enums; import cn.iocoder.yudao.framework.common.exception.ErrorCode; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java similarity index 83% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java index 888b2eeb5..255565002 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/enums/SmsTemplateAuditStatusEnum.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.sms.core.enums; +package cn.iocoder.yudao.framework.sms.core.enums; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/property/SmsChannelProperties.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/property/SmsChannelProperties.java similarity index 89% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/property/SmsChannelProperties.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/property/SmsChannelProperties.java index 750f2e7b4..c66ca85a4 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/dashboard/framework/sms/core/property/SmsChannelProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/java/cn/iocoder/yudao/framework/sms/core/property/SmsChannelProperties.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.sms.core.property; +package cn.iocoder.yudao.framework.sms.core.property; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsChannelEnum; +import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; import lombok.Data; import org.springframework.validation.annotation.Validated; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..bb26b5327 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.sms.config.YudaoSmsAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java similarity index 90% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java index ddbd4469a..e65e23db7 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsClientTest.java @@ -1,17 +1,18 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.aliyun; +package cn.iocoder.yudao.framework.sms.core.client.impl.aliyun; import cn.hutool.core.util.ReflectUtil; -import cn.iocoder.dashboard.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import com.aliyuncs.AcsRequest; import com.aliyuncs.IAcsClient; import com.aliyuncs.dysmsapi.model.v20170525.QuerySmsTemplateRequest; @@ -20,6 +21,7 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.aliyuncs.exceptions.ClientException; import com.google.common.collect.Lists; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatcher; import org.mockito.InjectMocks; @@ -28,9 +30,8 @@ import org.mockito.Mock; import java.util.List; import java.util.function.Function; -import static cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.argThat; @@ -184,8 +185,8 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest { // 断言 assertEquals(ex.getErrCode(), result.getApiCode()); assertEquals(ex.getErrMsg(), result.getApiMsg()); - assertEquals(SMS_API_PARAM_ERROR.getCode(), result.getCode()); - assertEquals(SMS_API_PARAM_ERROR.getMsg(), result.getMsg()); + Assertions.assertEquals(SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR.getCode(), result.getCode()); + Assertions.assertEquals(SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR.getMsg(), result.getMsg()); assertEquals(ex.getRequestId(), result.getApiRequestId()); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java index 823c7ce40..ef8901daf 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/aliyun/AliyunSmsCodeMappingTest.java @@ -1,8 +1,8 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.aliyun; +package cn.iocoder.yudao.framework.sms.core.client.impl.aliyun; -import cn.iocoder.dashboard.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java index 079bb53b4..8271c0d7b 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsClientTest.java @@ -1,15 +1,15 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.yunpian; +package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; import cn.hutool.core.util.ReflectUtil; -import cn.iocoder.dashboard.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.client.SmsCommonResult; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsReceiveRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsSendRespDTO; -import cn.iocoder.dashboard.framework.sms.core.client.dto.SmsTemplateRespDTO; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsTemplateAuditStatusEnum; -import cn.iocoder.dashboard.framework.sms.core.property.SmsChannelProperties; +import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; +import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; +import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum; +import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties; import cn.iocoder.yudao.framework.common.util.date.DateUtils; import com.google.common.collect.Lists; import com.yunpian.sdk.YunpianClient; @@ -29,7 +29,7 @@ import java.util.Map; import java.util.function.Function; import java.util.function.Supplier; -import static cn.iocoder.dashboard.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static com.yunpian.sdk.constant.Code.OK; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java similarity index 86% rename from yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java rename to yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java index 76d079688..8a292e325 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/dashboard/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-sms/src/test/java/cn/iocoder/yudao/framework/sms/core/client/impl/yunpian/YunpianSmsCodeMappingTest.java @@ -1,8 +1,9 @@ -package cn.iocoder.dashboard.framework.sms.core.client.impl.yunpian; +package cn.iocoder.yudao.framework.sms.core.client.impl.yunpian; -import cn.iocoder.dashboard.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; -import cn.iocoder.dashboard.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import cn.iocoder.yudao.framework.sms.core.enums.SmsFrameworkErrorCodeConstants; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; @@ -22,7 +23,7 @@ class YunpianSmsCodeMappingTest extends BaseMockitoUnitTest { @Test public void testApply() { assertEquals(GlobalErrorCodeConstants.SUCCESS, codeMapping.apply(String.valueOf(OK))); - assertEquals(SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR, codeMapping.apply(String.valueOf(ARGUMENT_MISSING))); + Assertions.assertEquals(SmsFrameworkErrorCodeConstants.SMS_API_PARAM_ERROR, codeMapping.apply(String.valueOf(ARGUMENT_MISSING))); assertEquals(SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_PARAM_ERROR, codeMapping.apply(String.valueOf(BAD_ARGUMENT_FORMAT))); assertEquals(SmsFrameworkErrorCodeConstants.SMS_ACCOUNT_MONEY_NOT_ENOUGH, codeMapping.apply(String.valueOf(MONEY_NOT_ENOUGH))); assertEquals(SmsFrameworkErrorCodeConstants.SMS_TEMPLATE_INVALID, codeMapping.apply(String.valueOf(TPL_NOT_FOUND))); diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/core/ConfigConsts.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/ConfigConsts.java similarity index 75% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/core/ConfigConsts.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/ConfigConsts.java index 8e0fe57bb..0008a8431 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/core/ConfigConsts.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/ConfigConsts.java @@ -1,4 +1,6 @@ -package cn.iocoder.dashboard.framework.apollo.core; +package cn.iocoder.yudao.framework.apollo.core; + +import cn.iocoder.yudao.framework.apollo.internals.ConfigFrameworkDAO; /** * 针对 {@link com.ctrip.framework.apollo.core.ConfigConsts} 的补充,主要增加: @@ -10,7 +12,7 @@ package cn.iocoder.dashboard.framework.apollo.core; public class ConfigConsts { /** - * {@link cn.iocoder.dashboard.framework.apollo.internals.ConfigFrameworkDAO} 的实现类 + * {@link ConfigFrameworkDAO} 的实现类 */ public static final String APOLLO_JDBC_DAO = "apollo.jdbc.dao"; public static final String APOLLO_JDBC_URL = "apollo.jdbc.url"; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/ConfigFrameworkDAO.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/ConfigFrameworkDAO.java similarity index 82% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/ConfigFrameworkDAO.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/ConfigFrameworkDAO.java index 8f46b2d30..c2fbd290b 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/ConfigFrameworkDAO.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/ConfigFrameworkDAO.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.apollo.internals; +package cn.iocoder.yudao.framework.apollo.internals; -import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; +import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; import java.util.Date; import java.util.List; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DBConfigRepository.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DBConfigRepository.java similarity index 97% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DBConfigRepository.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DBConfigRepository.java index 97726d339..c88038da9 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DBConfigRepository.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DBConfigRepository.java @@ -1,10 +1,10 @@ -package cn.iocoder.dashboard.framework.apollo.internals; +package cn.iocoder.yudao.framework.apollo.internals; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ClassUtil; import cn.hutool.core.util.ReflectUtil; -import cn.iocoder.dashboard.framework.apollo.core.ConfigConsts; -import cn.iocoder.dashboard.framework.apollo.internals.dto.ConfigRespDTO; +import cn.iocoder.yudao.framework.apollo.core.ConfigConsts; +import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; import com.ctrip.framework.apollo.Apollo; import com.ctrip.framework.apollo.build.ApolloInjector; import com.ctrip.framework.apollo.core.utils.ApolloThreadFactory; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DefaultXInjector.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DefaultXInjector.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DefaultXInjector.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DefaultXInjector.java index 587a850f3..554bad42f 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/DefaultXInjector.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/DefaultXInjector.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.apollo.internals; +package cn.iocoder.yudao.framework.apollo.internals; -import cn.iocoder.dashboard.framework.apollo.spi.DBConfigFactory; +import cn.iocoder.yudao.framework.apollo.spi.DBConfigFactory; import com.ctrip.framework.apollo.exceptions.ApolloConfigException; import com.ctrip.framework.apollo.internals.*; import com.ctrip.framework.apollo.spi.*; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/dto/ConfigRespDTO.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/dto/ConfigRespDTO.java similarity index 86% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/dto/ConfigRespDTO.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/dto/ConfigRespDTO.java index 3945dfbeb..350c94e42 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/internals/dto/ConfigRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/internals/dto/ConfigRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.apollo.internals.dto; +package cn.iocoder.yudao.framework.apollo.internals.dto; import lombok.Data; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/package-info.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/package-info.java similarity index 70% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/package-info.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/package-info.java index 03304119b..d31ab436b 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/package-info.java @@ -1,7 +1,7 @@ /** * 配置中心客户端,基于 Apollo Client 进行简化 * - * 差别在于,我们使用 {@link cn.iocoder.dashboard.modules.infra.dal.dataobject.config.InfConfigDO} 表作为配置源。 + * 差别在于,我们使用 cn.iocoder.yudao.modules.infra.dal.dataobject.config.InfConfigDO 表作为配置源。 * 当然,功能肯定也会相对少些,满足最小化诉求。 * * 1. 项目初始化时,可以使用 SysConfigDO 表的配置 @@ -10,4 +10,4 @@ * * 另外,整个包结构会参考 Apollo 为主,方便维护与理解 */ -package cn.iocoder.dashboard.framework.apollo; +package cn.iocoder.yudao.framework.apollo; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spi/DBConfigFactory.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spi/DBConfigFactory.java similarity index 88% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spi/DBConfigFactory.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spi/DBConfigFactory.java index bfa9e53fb..8b3003118 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spi/DBConfigFactory.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spi/DBConfigFactory.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.apollo.spi; +package cn.iocoder.yudao.framework.apollo.spi; -import cn.iocoder.dashboard.framework.apollo.internals.DBConfigRepository; +import cn.iocoder.yudao.framework.apollo.internals.DBConfigRepository; import com.ctrip.framework.apollo.Config; import com.ctrip.framework.apollo.ConfigFile; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java rename to yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java index 47af6b5d3..b68ca76d6 100644 --- a/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/dashboard/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.apollo.spring.boot; +package cn.iocoder.yudao.framework.apollo.spring.boot; -import cn.iocoder.dashboard.framework.apollo.core.ConfigConsts; +import cn.iocoder.yudao.framework.apollo.core.ConfigConsts; import com.google.common.base.Strings; import org.springframework.boot.SpringApplication; import org.springframework.boot.env.EnvironmentPostProcessor; diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector b/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector new file mode 100644 index 000000000..eb1d20e4b --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/services/com.ctrip.framework.apollo.internals.Injector @@ -0,0 +1 @@ +cn.iocoder.yudao.framework.apollo.internals.DefaultXInjector diff --git a/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..d98c85d5a --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-config/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.env.EnvironmentPostProcessor=\ + cn.iocoder.yudao.framework.apollo.spring.boot.ApolloApplicationContextInitializer diff --git a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java index 691509737..beed26f94 100644 --- a/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java +++ b/yudao-framework/yudao-spring-boot-starter-excel/src/main/java/cn/iocoder/yudao/framework/excel/core/convert/DictConvert.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.excel.core.convert; import cn.hutool.core.convert.Convert; import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; -import cn.iocoder.yudao.framework.dict.core.util.DictUtils; +import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; @@ -35,7 +35,7 @@ public class DictConvert implements Converter { // 使用字典解析 String type = getType(contentProperty); String label = cellData.getStringValue(); - DictDataRespDTO dictData = DictUtils.parseDictDataFromCache(type, label); + DictDataRespDTO dictData = DictFrameworkUtils.parseDictDataFromCache(type, label); if (dictData == null) { log.error("[convertToJavaData][type({}) 解析不掉 label({})]", type, label); return null; @@ -56,7 +56,7 @@ public class DictConvert implements Converter { // 使用字典格式化 String type = getType(contentProperty); String value = String.valueOf(object); - DictDataRespDTO dictData = DictUtils.getDictDataFromCache(type, value); + DictDataRespDTO dictData = DictFrameworkUtils.getDictDataFromCache(type, value); if (dictData == null) { log.error("[convertToExcelData][type({}) 转换不了 label({})]", type, value); return new CellData<>(""); diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/config/QuartzConfig.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoQuartzAutoConfiguration.java similarity index 71% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/config/QuartzConfig.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoQuartzAutoConfiguration.java index 30d883739..86c47fd0b 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/config/QuartzConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/config/YudaoQuartzAutoConfiguration.java @@ -1,6 +1,6 @@ -package cn.iocoder.dashboard.framework.quartz.config; +package cn.iocoder.yudao.framework.quartz.config; -import cn.iocoder.dashboard.framework.quartz.core.scheduler.SchedulerManager; +import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager; import org.quartz.Scheduler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -8,7 +8,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; @Configuration @EnableScheduling // 开启 Spring 自带的定时任务 -public class QuartzConfig { +public class YudaoQuartzAutoConfiguration { @Bean public SchedulerManager schedulerManager(Scheduler scheduler) { diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/enums/JobDataKeyEnum.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/enums/JobDataKeyEnum.java similarity index 79% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/enums/JobDataKeyEnum.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/enums/JobDataKeyEnum.java index 2849d1aa0..3154c4007 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/enums/JobDataKeyEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/enums/JobDataKeyEnum.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.quartz.core.enums; +package cn.iocoder.yudao.framework.quartz.core.enums; /** * Quartz Job Data 的 key 枚举 diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandler.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandler.java similarity index 81% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandler.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandler.java index bdf8a1bd5..381e132df 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandler.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.quartz.core.handler; +package cn.iocoder.yudao.framework.quartz.core.handler; /** * 任务处理器 diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandlerInvoker.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandlerInvoker.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java index a3dc8bc63..d47be8352 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/handler/JobHandlerInvoker.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/handler/JobHandlerInvoker.java @@ -1,9 +1,9 @@ -package cn.iocoder.dashboard.framework.quartz.core.handler; +package cn.iocoder.yudao.framework.quartz.core.handler; import cn.hutool.core.lang.Assert; import cn.hutool.core.thread.ThreadUtil; -import cn.iocoder.dashboard.framework.quartz.core.enums.JobDataKeyEnum; -import cn.iocoder.dashboard.framework.quartz.core.service.JobLogFrameworkService; +import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum; +import cn.iocoder.yudao.framework.quartz.core.service.JobLogFrameworkService; import lombok.extern.slf4j.Slf4j; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/scheduler/SchedulerManager.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/scheduler/SchedulerManager.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java index e72c90931..1c8aa7ba1 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/scheduler/SchedulerManager.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/scheduler/SchedulerManager.java @@ -1,7 +1,7 @@ -package cn.iocoder.dashboard.framework.quartz.core.scheduler; +package cn.iocoder.yudao.framework.quartz.core.scheduler; -import cn.iocoder.dashboard.framework.quartz.core.enums.JobDataKeyEnum; -import cn.iocoder.dashboard.framework.quartz.core.handler.JobHandlerInvoker; +import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum; +import cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker; import org.quartz.*; /** diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/service/JobLogFrameworkService.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/service/JobLogFrameworkService.java similarity index 96% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/service/JobLogFrameworkService.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/service/JobLogFrameworkService.java index a93dfdf08..ca5d0ccbc 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/service/JobLogFrameworkService.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/service/JobLogFrameworkService.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.quartz.core.service; +package cn.iocoder.yudao.framework.quartz.core.service; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java similarity index 96% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java index 62ba408fa..ccef9b374 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/core/util/CronUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.quartz.core.util; +package cn.iocoder.yudao.framework.quartz.core.util; import org.quartz.CronExpression; diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/package-info.java b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java similarity index 75% rename from yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/package-info.java rename to yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java index 79d9eebe7..69d681245 100644 --- a/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/dashboard/framework/quartz/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/java/cn/iocoder/yudao/framework/quartz/package-info.java @@ -2,4 +2,4 @@ * 定时任务,采用 Quartz 实现进程内的任务执行。 * 考虑到高可用,使用 Quartz 自带的 MySQL 集群方案。 */ -package cn.iocoder.dashboard.framework.quartz; +package cn.iocoder.yudao.framework.quartz; diff --git a/yudao-framework/yudao-spring-boot-starter-job/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-job/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..553b6e309 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-job/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.quartz.config.YudaoQuartzAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/TracerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java similarity index 97% rename from yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/TracerAutoConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java index 7209cd8de..6c2422a4e 100644 --- a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/TracerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/config/YudaoTracerAutoConfiguration.java @@ -22,7 +22,7 @@ import org.springframework.context.annotation.Configuration; @ConditionalOnClass({BizTraceAspect.class}) @EnableConfigurationProperties(TracerProperties.class) @ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true) -public class TracerAutoConfiguration { +public class YudaoTracerAutoConfiguration { @Bean @ConditionalOnMissingBean diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..6f4f606bb --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-monitor/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.tracer.config.YudaoTracerAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md b/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md new file mode 100644 index 000000000..7f898b9ce --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控工具 Admin 入门》.md @@ -0,0 +1 @@ + diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控端点 Actuator 入门》.md b/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控端点 Actuator 入门》.md new file mode 100644 index 000000000..b73a460c1 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 监控端点 Actuator 入门》.md @@ -0,0 +1 @@ + diff --git a/yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/《芋道 Spring Boot 链路追踪 SkyWalking 入门》.md b/yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 链路追踪 SkyWalking 入门》.md similarity index 100% rename from yudao-framework/yudao-spring-boot-starter-monitor/src/main/java/cn/iocoder/yudao/framework/tracer/《芋道 Spring Boot 链路追踪 SkyWalking 入门》.md rename to yudao-framework/yudao-spring-boot-starter-monitor/《芋道 Spring Boot 链路追踪 SkyWalking 入门》.md diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml index 0daf802d6..e72fe0b0f 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/pom.xml @@ -32,12 +32,6 @@ provided - - - - - - mysql diff --git a/yudao-framework/yudao-spring-boot-starter-protection/pom.xml b/yudao-framework/yudao-spring-boot-starter-protection/pom.xml index 16b5acf50..b02d4a1c1 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-protection/pom.xml @@ -20,7 +20,6 @@ cn.iocoder.boot yudao-spring-boot-starter-redis - provided diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/IdempotentConfiguration.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/YudaoIdempotentConfiguration.java similarity index 97% rename from yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/IdempotentConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/YudaoIdempotentConfiguration.java index 470037924..8c39ffe33 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/IdempotentConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/idempotent/config/YudaoIdempotentConfiguration.java @@ -15,7 +15,7 @@ import java.util.List; @Configuration(proxyBeanMethods = false) @AutoConfigureAfter(RedisAutoConfiguration.class) -public class IdempotentConfiguration { +public class YudaoIdempotentConfiguration { @Bean public IdempotentAspect idempotentAspect(List keyResolvers, IdempotentRedisDAO idempotentRedisDAO) { diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/Lock4jConfiguration.java b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/Lock4jConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java index 567ff698d..4919bf7c2 100644 --- a/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/Lock4jConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/java/cn/iocoder/yudao/framework/lock4j/config/YudaoLock4jConfiguration.java @@ -7,7 +7,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration -public class Lock4jConfiguration { +public class YudaoLock4jConfiguration { static { // 手动加载 Lock4jRedisKeyConstants 类,因为它不会被使用到 diff --git a/yudao-framework/yudao-spring-boot-starter-protection/src/main/resources/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-protection/src/main/resources/resources/META-INF/spring.factories new file mode 100644 index 000000000..0e55a1f2a --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-protection/src/main/resources/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.idempotent.config.YudaoIdempotentConfiguration,\ + cn.iocoder.yudao.framework.lock4j.config.YudaoLock4jConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/RedisConfig.java b/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/YudaoRedisAutoConfiguration.java similarity index 99% rename from yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/RedisConfig.java rename to yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/YudaoRedisAutoConfiguration.java index 354cb27c8..4e9f0a002 100644 --- a/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/RedisConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-redis/src/main/java/cn/iocoder/yudao/framework/redis/config/YudaoRedisAutoConfiguration.java @@ -24,7 +24,7 @@ import java.util.List; */ @Configuration @Slf4j -public class RedisConfig { +public class YudaoRedisAutoConfiguration { /** * 创建 RedisTemplate Bean,使用 JSON 序列化方式 diff --git a/yudao-framework/yudao-spring-boot-starter-redis/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-redis/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..c76daf1a7 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-redis/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java new file mode 100644 index 000000000..b9e0f34fc --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityAutoConfiguration.java @@ -0,0 +1,79 @@ +package cn.iocoder.yudao.framework.security.config; + +import cn.iocoder.yudao.framework.security.core.filter.JwtAuthenticationTokenFilter; +import cn.iocoder.yudao.framework.security.core.handler.AccessDeniedHandlerImpl; +import cn.iocoder.yudao.framework.security.core.handler.AuthenticationEntryPointImpl; +import cn.iocoder.yudao.framework.security.core.handler.LogoutSuccessHandlerImpl; +import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; +import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.AuthenticationEntryPoint; +import org.springframework.security.web.access.AccessDeniedHandler; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; + +import javax.annotation.Resource; + +/** + * Spring Security 自动配置类,主要用于相关组件的配置 + * + * 注意,不能和 {@link YudaoWebSecurityConfigurerAdapter} 用一个,原因是会导致初始化报错。 + * 参见 https://stackoverflow.com/questions/53847050/spring-boot-delegatebuilder-cannot-be-null-on-autowiring-authenticationmanager 文档。 + * + * @author 芋道源码 + */ +@Configuration +@EnableConfigurationProperties(SecurityProperties.class) +public class YudaoSecurityAutoConfiguration { + + @Resource + private SecurityProperties securityProperties; + + /** + * 认证失败处理类 Bean + */ + @Bean + public AuthenticationEntryPoint authenticationEntryPoint() { + return new AuthenticationEntryPointImpl(); + } + + /** + * 权限不够处理器 Bean + */ + @Bean + public AccessDeniedHandler accessDeniedHandler() { + return new AccessDeniedHandlerImpl(); + } + + /** + * 退出处理类 Bean + */ + @Bean + public LogoutSuccessHandler logoutSuccessHandler(SecurityAuthFrameworkService securityFrameworkService) { + return new LogoutSuccessHandlerImpl(securityProperties, securityFrameworkService); + } + + /** + * Spring Security 加密器 + * 考虑到安全性,这里采用 BCryptPasswordEncoder 加密器 + * + * @see Password Encoding with Spring Security + */ + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + /** + * Token 认证过滤器 Bean + */ + @Bean + public JwtAuthenticationTokenFilter authenticationTokenFilter(SecurityAuthFrameworkService securityFrameworkService, + GlobalExceptionHandler globalExceptionHandler) { + return new JwtAuthenticationTokenFilter(securityProperties, securityFrameworkService, globalExceptionHandler); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityConfiguration.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java similarity index 85% rename from yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityConfiguration.java rename to yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index d095e90f1..3d678eefd 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoSecurityConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -1,12 +1,17 @@ package cn.iocoder.yudao.framework.security.config; import cn.iocoder.yudao.framework.security.core.filter.JwtAuthenticationTokenFilter; +import cn.iocoder.yudao.framework.security.core.handler.AccessDeniedHandlerImpl; +import cn.iocoder.yudao.framework.security.core.handler.AuthenticationEntryPointImpl; import cn.iocoder.yudao.framework.security.core.handler.LogoutSuccessHandlerImpl; +import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; import cn.iocoder.yudao.framework.web.config.WebProperties; +import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; @@ -20,45 +25,18 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; import javax.annotation.Resource; /** - * spring security配置 + * 自定义的 Spring Security 配置适配器实现 * * @author 芋道源码 */ +@Configuration @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) -@EnableConfigurationProperties(SecurityProperties.class) -public class YudaoSecurityConfiguration extends WebSecurityConfigurerAdapter { - - /** - * 自定义用户认证逻辑 - */ - @Resource - private UserDetailsService userDetailsService; - - /** - * 认证失败处理类 - */ - @Resource - private AuthenticationEntryPoint unauthorizedHandler; - /** - * 权限不够处理器 - */ - @Resource - private AccessDeniedHandler accessDeniedHandler; - /** - * 退出处理类 - */ - @Resource - private LogoutSuccessHandlerImpl logoutSuccessHandler; - - /** - * Token 认证过滤器 - */ - @Resource - private JwtAuthenticationTokenFilter authenticationTokenFilter; +public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter { @Resource private WebProperties webProperties; @@ -66,6 +44,37 @@ public class YudaoSecurityConfiguration extends WebSecurityConfigurerAdapter { @Value("${spring.boot.admin.context-path:''}") private String adminSeverContextPath; + /** + * 自定义用户【认证】逻辑 + */ + @Resource + private UserDetailsService userDetailsService; + /** + * Spring Security 加密器 + */ + @Resource + private PasswordEncoder passwordEncoder; + /** + * 认证失败处理类 Bean + */ + @Resource + private AuthenticationEntryPoint authenticationEntryPoint; + /** + * 权限不够处理器 Bean + */ + @Resource + private AccessDeniedHandler accessDeniedHandler; + /** + * 退出处理类 Bean + */ + @Resource + private LogoutSuccessHandler logoutSuccessHandler; + /** + * Token 认证过滤器 Bean + */ + @Resource + private JwtAuthenticationTokenFilter authenticationTokenFilter; + /** * 由于 Spring Security 创建 AuthenticationManager 对象时,没声明 @Bean 注解,导致无法被注入 * 通过覆写父类的该方法,添加 @Bean 注解,解决该问题 @@ -77,24 +86,13 @@ public class YudaoSecurityConfiguration extends WebSecurityConfigurerAdapter { return super.authenticationManagerBean(); } - /** - * Spring Security 加密器 - * 考虑到安全性,这里采用 BCryptPasswordEncoder 加密器 - * - * @see Password Encoding with Spring Security - */ - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } - /** * 身份认证接口 */ @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService) - .passwordEncoder(passwordEncoder()); + .passwordEncoder(passwordEncoder); } /** @@ -124,7 +122,7 @@ public class YudaoSecurityConfiguration extends WebSecurityConfigurerAdapter { // 基于 token 机制,所以不需要 Session .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() // 一堆自定义的 Spring Security 处理器 - .exceptionHandling().authenticationEntryPoint(unauthorizedHandler) + .exceptionHandling().authenticationEntryPoint(authenticationEntryPoint) .accessDeniedHandler(accessDeniedHandler).and() // 设置每个请求的权限 .authorizeRequests() diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/JwtAuthenticationTokenFilter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/JwtAuthenticationTokenFilter.java index 2f9343354..d451c179d 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/JwtAuthenticationTokenFilter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/filter/JwtAuthenticationTokenFilter.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkSer import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; +import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; @@ -24,15 +25,14 @@ import java.io.IOException; * * @author ruoyi */ -@Component +@AllArgsConstructor public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { - @Resource - private SecurityProperties securityProperties; - @Resource - private SecurityAuthFrameworkService authService; - @Resource - private GlobalExceptionHandler globalExceptionHandler; + private final SecurityProperties securityProperties; + + private final SecurityAuthFrameworkService authService; + + private final GlobalExceptionHandler globalExceptionHandler; @Override @SuppressWarnings("NullableProblems") diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java index 517df55d6..fa0c4b373 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java @@ -25,7 +25,6 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC * * @author 芋道源码 */ -@Component @Slf4j @SuppressWarnings("JavadocReference") public class AccessDeniedHandlerImpl implements AccessDeniedHandler { @@ -35,7 +34,7 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler { throws IOException, ServletException { // 打印 warn 的原因是,不定期合并 warn,看看有没恶意破坏 log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(), - SecurityFrameworkUtils.getLoginUser().getId(), e); + SecurityFrameworkUtils.getLoginUserId(), e); // 返回 403 ServletUtils.writeJSON(response, CommonResult.error(UNAUTHORIZED)); } diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java index 380f5b76f..0a451e076 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AuthenticationEntryPointImpl.java @@ -7,7 +7,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.access.ExceptionTranslationFilter; -import org.springframework.stereotype.Component; import javax.servlet.FilterChain; import javax.servlet.http.HttpServletRequest; @@ -22,7 +21,6 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC * * @author ruoyi */ -@Component @Slf4j @SuppressWarnings("JavadocReference") // 忽略文档引用报错 public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint { diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/LogoutSuccessHandlerImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/LogoutSuccessHandlerImpl.java index ed61cf007..1bf8091be 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/LogoutSuccessHandlerImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/LogoutSuccessHandlerImpl.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.security.config.SecurityProperties; import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; +import lombok.AllArgsConstructor; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; import org.springframework.stereotype.Component; @@ -20,14 +21,12 @@ import javax.servlet.http.HttpServletResponse; * * @author ruoyi */ -@Component +@AllArgsConstructor public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler { - @Resource - private SecurityProperties securityProperties; + private final SecurityProperties securityProperties; - @Resource - private SecurityAuthFrameworkService securityFrameworkService; + private final SecurityAuthFrameworkService securityFrameworkService; @Override public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-security/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..564bb0f78 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/resources/META-INF/spring.factories @@ -0,0 +1,3 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.security.config.YudaoSecurityAutoConfiguration,\ + cn.iocoder.yudao.framework.security.config.YudaoWebSecurityConfigurerAdapter diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/package-info.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/package-info.java deleted file mode 100644 index 0f33dfb00..000000000 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 提供单元测试 Unit Test 的基类 - */ -package cn.iocoder.dashboard.framework.test.core.ut; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/BaseMockitoUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseMockitoUnitTest.java similarity index 82% rename from yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/BaseMockitoUnitTest.java rename to yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseMockitoUnitTest.java index eb1f3d45e..26048695c 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/ut/BaseMockitoUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseMockitoUnitTest.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.test.core.ut; +package cn.iocoder.yudao.framework.test.core.ut; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/package-info.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/package-info.java new file mode 100644 index 000000000..bda7aad25 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/package-info.java @@ -0,0 +1,4 @@ +/** + * 提供单元测试 Unit Test 的基类 + */ +package cn.iocoder.yudao.framework.test.core.ut; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/AssertUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java similarity index 98% rename from yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/AssertUtils.java rename to yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java index 9f7e501dc..c18bd248c 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/AssertUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/AssertUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.test.core.util; +package cn.iocoder.yudao.framework.test.core.util; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ReflectUtil; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/RandomUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java similarity index 98% rename from yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/RandomUtils.java rename to yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java index 7ac7b28e8..e8d36ad88 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/core/util/RandomUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.framework.test.core.util; +package cn.iocoder.yudao.framework.test.core.util; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.RandomUtil; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/package-info.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/package-info.java similarity index 59% rename from yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/package-info.java rename to yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/package-info.java index fa0221306..3a17f5190 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/dashboard/framework/test/package-info.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/package-info.java @@ -1,4 +1,4 @@ /** * 测试组件,用于单元测试、集成测试等等 */ -package cn.iocoder.dashboard.framework.test; +package cn.iocoder.yudao.framework.test; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java index d4444da8b..2edc3e883 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/WebProperties.java @@ -29,7 +29,7 @@ public class WebProperties { * * 主要目的是,给该 Controller 设置指定的 {@link #apiPrefix} * - * 因为我们有多个 modules 包里会包含 Controller,所以只需要写到 cn.iocoder.dashboard 这样的层级 + * 因为我们有多个 modules 包里会包含 Controller,所以只需要写到 cn.iocoder.yudao 这样的层级 */ @NotNull(message = "Controller 所在包不能为空") private String controllerPackage; diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java index 90773f83e..5d390cdb1 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java @@ -1,9 +1,13 @@ package cn.iocoder.yudao.framework.web.config; +import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; import cn.iocoder.yudao.framework.web.core.filter.CacheRequestBodyFilter; import cn.iocoder.yudao.framework.web.core.filter.DemoFilter; import cn.iocoder.yudao.framework.web.core.filter.XssFilter; +import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; +import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; @@ -26,6 +30,11 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { @Resource private WebProperties webProperties; + /** + * 应用名 + */ + @Value("${spring.application.name}") + private String applicationName; @Override public void configurePathMatch(PathMatchConfigurer configurer) { @@ -35,6 +44,16 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { && clazz.getPackage().getName().startsWith(webProperties.getControllerPackage())); // 仅仅匹配 controller 包 } + @Bean + public GlobalExceptionHandler globalExceptionHandler(ApiErrorLogFrameworkService ApiErrorLogFrameworkService) { + return new GlobalExceptionHandler(applicationName, ApiErrorLogFrameworkService); + } + + @Bean + public GlobalResponseBodyHandler globalResponseBodyHandler() { + return new GlobalResponseBodyHandler(); + } + // ========== Filter 相关 ========== /** diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index 3616bd34c..a27d87a82 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import io.github.resilience4j.ratelimiter.RequestNotPermitted; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.beans.factory.annotation.Value; @@ -43,14 +44,13 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC * @author 芋道源码 */ @RestControllerAdvice +@AllArgsConstructor @Slf4j public class GlobalExceptionHandler { - @Value("${spring.application.name}") - private String applicationName; + private final String applicationName; - @Resource - private ApiErrorLogFrameworkService apiErrorLogFrameworkService; + private final ApiErrorLogFrameworkService apiErrorLogFrameworkService; /** * 处理所有异常,主要是提供给 Filter 使用 diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring.factories b/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..3b0e1d772 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring.factories @@ -0,0 +1,5 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ + cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration,\ + cn.iocoder.yudao.framework.jackson.config.YudaoJacksonAutoConfiguration,\ + cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration,\ + cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration