master
parent
c0d588a0a4
commit
3ebe787d58
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.jing</groupId>
|
||||
<artifactId>jing-common</artifactId>
|
||||
<version>3.6.4</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jing-common-datasource</artifactId>
|
||||
|
||||
<description>
|
||||
jing-common-datasource多数据源
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- Druid -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Dynamic DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>${dynamic-ds.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,22 @@
|
|||
package com.jing.common.datasource.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
||||
/**
|
||||
* 主库数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@DS("master")
|
||||
public @interface Master
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.jing.common.datasource.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
||||
/**
|
||||
* 从库数据源
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@DS("slave")
|
||||
public @interface Slave
|
||||
{
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
artifactId=jing-common-datasource
|
||||
groupId=com.jing
|
||||
version=3.6.4
|
|
@ -0,0 +1,2 @@
|
|||
com\jing\common\datasource\annotation\Slave.class
|
||||
com\jing\common\datasource\annotation\Master.class
|
|
@ -0,0 +1,2 @@
|
|||
F:\Welcome-2105A\20240521142828\jing-cloud\jing-common\jing-common-datasource\src\main\java\com\jing\common\datasource\annotation\Slave.java
|
||||
F:\Welcome-2105A\20240521142828\jing-cloud\jing-common\jing-common-datasource\src\main\java\com\jing\common\datasource\annotation\Master.java
|
Loading…
Reference in New Issue