commit 2dd0e8cb91040136fdede37074040c26f7da4d74 Author: chaiyapeng <3535863041@qq.com> Date: Fri Jul 26 19:33:34 2024 +0800 初始化 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d1639d5 --- /dev/null +++ b/pom.xml @@ -0,0 +1,35 @@ + + + + com.muyu + cloud-common + 3.6.3 + + 4.0.0 + + cloud-common-datasource + + + cloud-common-datasource多数据源 + + + + + + + com.alibaba + druid-spring-boot-3-starter + ${druid.version} + + + + + com.baomidou + dynamic-datasource-spring-boot3-starter + ${dynamic-ds.version} + + + + diff --git a/src/main/java/com/muyu/common/datasource/annotation/Master.java b/src/main/java/com/muyu/common/datasource/annotation/Master.java new file mode 100644 index 0000000..d9aae00 --- /dev/null +++ b/src/main/java/com/muyu/common/datasource/annotation/Master.java @@ -0,0 +1,18 @@ +package com.muyu.common.datasource.annotation; + +import com.baomidou.dynamic.datasource.annotation.DS; + +import java.lang.annotation.*; + +/** + * 主库数据源 + * + * @author muyu + */ +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@DS("master") +public @interface Master { + +} diff --git a/src/main/java/com/muyu/common/datasource/annotation/Slave.java b/src/main/java/com/muyu/common/datasource/annotation/Slave.java new file mode 100644 index 0000000..9663cd4 --- /dev/null +++ b/src/main/java/com/muyu/common/datasource/annotation/Slave.java @@ -0,0 +1,18 @@ +package com.muyu.common.datasource.annotation; + +import com.baomidou.dynamic.datasource.annotation.DS; + +import java.lang.annotation.*; + +/** + * 从库数据源 + * + * @author muyu + */ +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@DS("slave") +public @interface Slave { + +} diff --git a/target/classes/com/muyu/common/datasource/annotation/Master.class b/target/classes/com/muyu/common/datasource/annotation/Master.class new file mode 100644 index 0000000..6cb4fc8 Binary files /dev/null and b/target/classes/com/muyu/common/datasource/annotation/Master.class differ diff --git a/target/classes/com/muyu/common/datasource/annotation/Slave.class b/target/classes/com/muyu/common/datasource/annotation/Slave.class new file mode 100644 index 0000000..b61700d Binary files /dev/null and b/target/classes/com/muyu/common/datasource/annotation/Slave.class differ diff --git a/target/cloud-common-datasource-3.6.3.jar b/target/cloud-common-datasource-3.6.3.jar new file mode 100644 index 0000000..48d8fa0 Binary files /dev/null and b/target/cloud-common-datasource-3.6.3.jar differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..635ed09 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jul 26 19:32:49 CST 2024 +groupId=com.muyu +artifactId=cloud-common-datasource +version=3.6.3 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..b66cfdf --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\muyu\common\datasource\annotation\Slave.class +com\muyu\common\datasource\annotation\Master.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..740dda5 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +D:\workspace\ry-2112Ag6\cyp-cloud-2112\cloud-common-datasource\src\main\java\com\muyu\common\datasource\annotation\Master.java +D:\workspace\ry-2112Ag6\cyp-cloud-2112\cloud-common-datasource\src\main\java\com\muyu\common\datasource\annotation\Slave.java