diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobTest.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobTest.java deleted file mode 100644 index 8e23338bb..000000000 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TenantJobTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.iocoder.yudao.framework.tenant.core.job; - -import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService; -import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; -import com.google.common.collect.Lists; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.Mockito; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * 验证 job 租户逻辑 - * {@link TenantJobHandlerDecorator} - * - * @author gaibu - */ -public class TenantJobTest extends BaseMockitoUnitTest { - - @Mock - TenantFrameworkService tenantFrameworkService; - - @Test - public void test() throws Exception { - // 准备测试租户 id - List tenantIds = Lists.newArrayList(1L, 2L, 3L); - // mock 数据 - Mockito.doReturn(tenantIds).when(tenantFrameworkService).getTenantIds(); - // 准备测试任务 - TestJob testJob = new TestJob(); - // 创建任务装饰器 - TenantJobHandlerDecorator tenantJobHandlerDecorator = new TenantJobHandlerDecorator(tenantFrameworkService, testJob); - - // 执行任务 - tenantJobHandlerDecorator.execute(null); - - // 断言返回值 - assertEquals(testJob.getTenantIds(), tenantIds); - } -} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TestJob.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TestJob.java index bad1cb304..2a6d200c4 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TestJob.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/test/java/cn/iocoder/yudao/framework/tenant/core/job/TestJob.java @@ -9,12 +9,12 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @Component -@TenantJob // 标记多租户 public class TestJob implements JobHandler { private final List tenantIds = new CopyOnWriteArrayList<>(); @Override + @TenantJob // 标记多租户 public String execute(String param) throws Exception { tenantIds.add(TenantContextHolder.getTenantId()); return "success"; @@ -24,4 +24,5 @@ public class TestJob implements JobHandler { CollUtil.sort(tenantIds, Long::compareTo); return tenantIds; } + } diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 9e676233a..520d9f927 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -21,11 +21,6 @@ https://github.com/YunaiV/ruoyi-vue-pro - - cn.iocoder.boot - yudao-module-member-biz - ${revision} - cn.iocoder.boot yudao-module-system-biz @@ -41,6 +36,13 @@ yudao-spring-boot-starter-biz-error-code + + + + + + + diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index b45b9781b..38ef799f7 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -34,8 +34,8 @@ spring: multi-statement-allow: true dynamic: # 多数据源配置 druid: # Druid 【连接池】相关的全局配置 - initial-size: 5 # 初始连接数 - min-idle: 10 # 最小连接池数量 + initial-size: 1 # 初始连接数 + min-idle: 1 # 最小连接池数量 max-active: 20 # 最大连接池数量 max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 @@ -60,6 +60,7 @@ spring: # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 name: ruoyi-vue-pro + lazy: true # 开启懒加载,保证启动速度 url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 7137a5088..ff12307d2 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -73,17 +73,20 @@ mybatis-plus: # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解 logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + banner: false # 关闭控制台的 Banner 打印 type-aliases-package: ${yudao.info.base-package}.module.*.dal.dataobject encryptor: password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成 +mybatis-plus-join: + banner: false # 关闭控制台的 Banner 打印 + # Spring Data Redis 配置 spring: data: redis: repositories: enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度 - --- #################### 验证码相关配置 #################### aj: