first commit
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<?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.mhd</groupId>
|
||||
<artifactId>mhd</artifactId>
|
||||
<version>3.6.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>mhd_common_db</artifactId>
|
||||
|
||||
<description>
|
||||
seata数据库源
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!--添加mp 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
<!--添加mysql 依赖 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.47</version><!--依据自己本地数据库的版本进行跳转 -->
|
||||
</dependency>
|
||||
<!--添加druid连接池 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.2.11</version>
|
||||
</dependency>
|
||||
<!--添加seata依赖 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-alibaba-seata</artifactId>-->
|
||||
<!-- <version>1.5.0.RELEASE</version>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <!–排除低版本–>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>io.seata</groupId>-->
|
||||
<!-- <artifactId>seata-all</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.seata</groupId>-->
|
||||
<!-- <artifactId>seata-all</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--seata starter 采用1.4.2版本-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.seata</groupId>-->
|
||||
<!-- <artifactId>seata-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>1.4.2</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!--添加seata依赖 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-alibaba-seata</artifactId>-->
|
||||
<!-- <version>1.5.0.RELEASE</version>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <!–排除低版本–>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>io.seata</groupId>-->
|
||||
<!-- <artifactId>seata-all</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>io.seata</groupId>-->
|
||||
<!-- <artifactId>seata-all</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.mhd</groupId>
|
||||
<artifactId>mhd-common-datasource</artifactId>
|
||||
</dependency>
|
||||
<!-- Mhd Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.mhd</groupId>
|
||||
<artifactId>mhd-common-core</artifactId>
|
||||
</dependency>
|
||||
<!-- Mhd Common Security -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.mhd</groupId>-->
|
||||
<!-- <artifactId>mhd-common-security</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!--lombok工具-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mhd.common_db;
|
||||
|
||||
/**
|
||||
* 数据源代理
|
||||
*
|
||||
* @author 王子豪
|
||||
*/
|
||||
// @Configuration
|
||||
public class DataSourceConfiguration {
|
||||
|
||||
//
|
||||
// @Bean
|
||||
// @ConfigurationProperties("spring.datasource")
|
||||
// public DataSource druidDataSource() {
|
||||
// return new DruidDataSource();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置代理数据源
|
||||
// *
|
||||
// * @param druidDataSource
|
||||
// * @return
|
||||
// */
|
||||
// @Primary // 设置首选数据源
|
||||
// @Bean("datasource")
|
||||
// public DataSourceProxy dataSource(DataSource druidDataSource) {
|
||||
// return new DataSourceProxy(druidDataSource);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#spring.cloud.alibaba.seata.tx-service-group=my_test_tx_group
|
||||
#logging.level.seata=debug
|
||||
# spring\u914D\u7F6E
|
||||
# spring\u914D\u7F6E
|
||||
spring:
|
||||
name: mhd-common-db
|
||||
seata:
|
||||
tx-service-group: default_tx_group
|
||||
service:
|
||||
# 事务组对应的集群民称
|
||||
vgroup-mapping.default_tx_group: seata-server
|
||||
# seata-server的地址
|
||||
grouplist.seata-server: 192.168.10.18:8091
|
||||
# grouplist.seata-server: 8.130.64.92:8091
|
||||
enabled: true
|
||||
@@ -0,0 +1,33 @@
|
||||
registry {
|
||||
# file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
|
||||
type = "nacos"
|
||||
|
||||
nacos {
|
||||
application = "seata-server"
|
||||
serverAddr = "192.168.0.166:8848"
|
||||
group = "SEATA_GROUP"
|
||||
namespace = ""
|
||||
cluster = "default"
|
||||
username = "nacos"
|
||||
password = "manhuoda@2023"
|
||||
}
|
||||
file {
|
||||
name = "file.conf"
|
||||
}
|
||||
}
|
||||
|
||||
config {
|
||||
# file、nacos 、apollo、zk、consul、etcd3
|
||||
type = "nacos"
|
||||
|
||||
nacos {
|
||||
serverAddr = "192.168.0.166:8848"
|
||||
namespace = ""
|
||||
group = "SEATA_GROUP"
|
||||
username = "nacos"
|
||||
password = "manhuoda@2023"
|
||||
}
|
||||
file {
|
||||
name = "file.conf"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user