From 88628f7a1dd320cec09af560880ab0cdaf9dbbbd Mon Sep 17 00:00:00 2001 From: bai <173792339@qq.com> Date: Sun, 28 Jul 2024 16:12:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 ++++ .idea/compiler.xml | 13 +++++++ .idea/encodings.xml | 7 ++++ .idea/jarRepositories.xml | 30 +++++++++++++++ .idea/misc.xml | 18 +++++++++ .idea/vcs.xml | 6 +++ pom.xml | 35 ++++++++++++++++++ .../common/datasource/annotation/Master.java | 18 +++++++++ .../common/datasource/annotation/Slave.java | 18 +++++++++ .../common/datasource/annotation/Master.class | Bin 0 -> 523 bytes .../common/datasource/annotation/Slave.class | Bin 0 -> 520 bytes target/cloud-common-datasource-3.6.3.jar | Bin 0 -> 3109 bytes target/maven-archiver/pom.properties | 3 ++ .../compile/default-compile/createdFiles.lst | 2 + .../compile/default-compile/inputFiles.lst | 2 + 15 files changed, 160 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/muyu/common/datasource/annotation/Master.java create mode 100644 src/main/java/com/muyu/common/datasource/annotation/Slave.java create mode 100644 target/classes/com/muyu/common/datasource/annotation/Master.class create mode 100644 target/classes/com/muyu/common/datasource/annotation/Slave.class create mode 100644 target/cloud-common-datasource-3.6.3.jar create mode 100644 target/maven-archiver/pom.properties create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst 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/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..1898d9f --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..872d41f --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b4cc47a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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 0000000000000000000000000000000000000000..6cb4fc8ae544d3d529cc41538f7ca297f309778f GIT binary patch literal 523 zcmaix%Sr<=6o&uQwxg|=dRw>TnM|aU6z0`j_y9hX zc&37NG2$X8Cnx{+lbrMM`SuRr3i|;n0%wsm()ip0<9M{S29uQR1PLD6uAI(fum*h7k2&QAkY{uTyJzj0?lv3i-Hn382Qv`LytPs zlZ2L3CUDp*bq>{RO72piHdl#f$J26MHz7l*3-ecEaW#Azb_MGFZg@NB2ppF~BXZ2} zzZq%&BN^I6M>z|F(ZhXs*Jt~aa-?G;U%Z84R?A+|_=&Pc$JWa@PnFTpAKmYanW&q^ x4B7$$E4*qvMWBLU5m&Ls`#Gv;@Lls66~a0;im-{TqC{w68#}DpEsh!Xz5t%mnY91_ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b61700d17c4e4bcfc197a44d95b7691e39a2b2a4 GIT binary patch literal 520 zcmaix%T59@6o&sIFp4+4EnFBc3pPgj0LFz07)?M3j3&lan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