From 3e18d4bfbf2c657b08b21512c2d884cc9d59df7b Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 14 十月 2024 16:29:49 +0800 Subject: [PATCH] 模型运行 --- iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/db/dynamic/DataDS.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/db/dynamic/DataDS.java b/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/db/dynamic/DataDS.java new file mode 100644 index 0000000..fce0fbb --- /dev/null +++ b/iailab-framework/iailab-common-biz-tenant/src/main/java/com/iailab/framework/tenant/core/db/dynamic/DataDS.java @@ -0,0 +1,25 @@ +package com.iailab.framework.tenant.core.db.dynamic; + +import com.baomidou.dynamic.datasource.annotation.DS; + +import java.lang.annotation.*; + +/** + * 使用数据源所在的数据源 + * + * 使用方式:当我们希望一个表使用租户所在的数据源,可以在该表的 Mapper 上添加该注解 + * + * @author 芋道源码 + */ +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@DS(DataDS.KEY) +public @interface DataDS { + + /** + * 数据源的占位符 + */ + String KEY = "#context.dataSourceId"; + +} -- Gitblit v1.9.3