From 8bf49fe5a27851920c7fa6d7660707d236d3f1c8 Mon Sep 17 00:00:00 2001 From: Yunfei Du <278774021@qq.com> Date: Fri, 10 May 2024 22:43:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B5=84=E4=BA=A7=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=8B=86=E5=88=86=E8=BF=9E=E6=8E=A5=E6=B1=A0=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../etl-data-source-client/pom.xml | 27 ++++ .../client/config/DataAccessClientConfig.java | 5 +- .../client/config/DataAccessClientRunner.java | 35 ++++- .../etl-data-source-common/pom.xml | 16 +++ .../etl-data-source-remote/pom.xml | 19 +++ etl-modules/etl-data-unit/pom.xml | 93 ++++++++++++ .../etl/data/unit/DataUnitApplication.java | 26 ++++ .../src/main/resources/banner.txt | 2 + .../src/main/resources/bootstrap.yml | 34 +++++ .../etl-rule-engine-client/pom.xml | 26 ++++ .../etl-rule-engine-common/pom.xml | 26 ++++ .../etl-rule-engine-remote/pom.xml | 20 +++ .../etl-rule-engine-server/pom.xml | 134 ++++++++++++++++++ 13 files changed, 452 insertions(+), 11 deletions(-) create mode 100644 etl-modules/etl-data-source/etl-data-source-client/pom.xml create mode 100644 etl-modules/etl-data-unit/pom.xml create mode 100644 etl-modules/etl-data-unit/src/main/java/com/etl/data/unit/DataUnitApplication.java create mode 100644 etl-modules/etl-data-unit/src/main/resources/banner.txt create mode 100644 etl-modules/etl-data-unit/src/main/resources/bootstrap.yml create mode 100644 etl-modules/etl-rule-engine/etl-rule-engine-client/pom.xml create mode 100644 etl-modules/etl-rule-engine/etl-rule-engine-common/pom.xml create mode 100644 etl-modules/etl-rule-engine/etl-rule-engine-remote/pom.xml create mode 100644 etl-modules/etl-rule-engine/etl-rule-engine-server/pom.xml diff --git a/etl-modules/etl-data-source/etl-data-source-client/pom.xml b/etl-modules/etl-data-source/etl-data-source-client/pom.xml new file mode 100644 index 0000000..1e19dd1 --- /dev/null +++ b/etl-modules/etl-data-source/etl-data-source-client/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + com.etl + etl-data-source + 3.6.3 + + + etl-data-source-client + + + 17 + 17 + UTF-8 + + + + + com.etl + etl-data-source-remote + + + + diff --git a/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientConfig.java b/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientConfig.java index 8ec0f92..df0ae68 100644 --- a/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientConfig.java +++ b/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientConfig.java @@ -10,10 +10,7 @@ import org.springframework.stereotype.Component; * @author YunFei.Du * @date 21:34 2024/5/8 */ -@ComponentScan +@Component @Import ( value = {DataAccessClientRunner.class}) public class DataAccessClientConfig { - public static void main(String[] args) { - System.out.println ("连接池 编码" ); - } } diff --git a/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientRunner.java b/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientRunner.java index d8b5288..e94ee30 100644 --- a/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientRunner.java +++ b/etl-modules/etl-data-source/etl-data-source-client/src/main/java/com/etl/data/client/config/DataAccessClientRunner.java @@ -1,22 +1,43 @@ package com.etl.data.client.config; -import feign.Param; + +import com.etl.data.domain.DataSource; +import com.etl.data.domain.config.DataSourceConfig; +import com.etl.data.domain.req.DataSourceQueryReq; +import com.etl.data.source.remote.RemoteDataSourceService; +import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; +import java.util.HashMap; +import java.util.List; + /** - * @ClassName DataAccessClientRunner - * @Description 描述 - * @Author YunFei.Du - * @Date 2024/5/8 21:35 + * 数据访问客户端运行程序 + * @author YunFei.Du + * @date 14:10 2024/5/10 */ +@Log4j2 public class DataAccessClientRunner implements ApplicationRunner { - + @Autowired + private RemoteDataSourceService remoteDataSourceService; @Override - public void run(ApplicationArguments args) throws Exception { + public void run(ApplicationArguments args) { + try { + List< DataSource > dataSourceList = remoteDataSourceService.getDataSourceList ( new DataSourceQueryReq () ).getData ( ).getRows ( ); + HashMap< String, javax.sql.DataSource > hashMap = new HashMap<> ( ); + for (DataSource dataSource : dataSourceList) { + log.info ( "dataSource:{}", dataSource ); + javax.sql.DataSource dataSource1 = DataSourceConfig.dataSource ( dataSource.getHost ( ), dataSource.getDatabaseName ( ), dataSource.getPort ( ), dataSource.getUsername ( ), dataSource.getPassword ( ) ); + log.info ( "dataSource111:{}", dataSource1 ); + hashMap.put ( dataSource.getName ( ), dataSource1 ); + } + } catch (Exception e) { + log.error ( "失败了" ); + } } } diff --git a/etl-modules/etl-data-source/etl-data-source-common/pom.xml b/etl-modules/etl-data-source/etl-data-source-common/pom.xml index 5e75297..e9e452c 100644 --- a/etl-modules/etl-data-source/etl-data-source-common/pom.xml +++ b/etl-modules/etl-data-source/etl-data-source-common/pom.xml @@ -21,6 +21,22 @@ com.etl etl-common-core + + com.alibaba + druid + 1.2.20 + compile + + + com.alibaba + druid + 1.2.20 + compile + + + com.etl + etl-common-system + diff --git a/etl-modules/etl-data-source/etl-data-source-remote/pom.xml b/etl-modules/etl-data-source/etl-data-source-remote/pom.xml index 47e86db..64576a7 100644 --- a/etl-modules/etl-data-source/etl-data-source-remote/pom.xml +++ b/etl-modules/etl-data-source/etl-data-source-remote/pom.xml @@ -16,5 +16,24 @@ 17 UTF-8 + + + org.springframework.cloud + spring-cloud-openfeign-core + + + com.etl + etl-rule-engine-common + 3.6.3 + + + com.etl + etl-common-core + + + com.etl + etl-data-source-common + + diff --git a/etl-modules/etl-data-unit/pom.xml b/etl-modules/etl-data-unit/pom.xml new file mode 100644 index 0000000..f614d8f --- /dev/null +++ b/etl-modules/etl-data-unit/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + + com.etl + etl-modules + 3.6.3 + + + etl-data-unit + + + 17 + 17 + UTF-8 + + + + + com.etl + etl-data-source-client + 3.6.3 + + + com.etl + etl-data-source-remote + 3.6.3 + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + + com.etl + etl-common-log + + + + + com.etl + etl-common-swagger + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/etl-modules/etl-data-unit/src/main/java/com/etl/data/unit/DataUnitApplication.java b/etl-modules/etl-data-unit/src/main/java/com/etl/data/unit/DataUnitApplication.java new file mode 100644 index 0000000..fa98de0 --- /dev/null +++ b/etl-modules/etl-data-unit/src/main/java/com/etl/data/unit/DataUnitApplication.java @@ -0,0 +1,26 @@ +package com.etl.data.unit; + +import com.etl.common.security.annotation.EnableMyFeignClients; +import com.etl.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @ClassName DataUnitApplication + * @Description 描述 + * @Author YunFei.Du + * @Date 2024/5/10 9:55 + */ +@EnableScheduling +@EnableCustomSwagger2 +@EnableMyFeignClients +@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) +@EnableAsync +public class DataUnitApplication { + public static void main(String[] args) { + SpringApplication.run ( DataUnitApplication.class, args ); + } +} diff --git a/etl-modules/etl-data-unit/src/main/resources/banner.txt b/etl-modules/etl-data-unit/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/etl-modules/etl-data-unit/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/etl-modules/etl-data-unit/src/main/resources/bootstrap.yml b/etl-modules/etl-data-unit/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..669e0e3 --- /dev/null +++ b/etl-modules/etl-data-unit/src/main/resources/bootstrap.yml @@ -0,0 +1,34 @@ +# Tomcat +server: + port: 9523 + +# Spring +spring: + main: + allow-circular-references: true + application: + # 应用名称 + name: etl-data-unit + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 111.229.102.61:8848 + # 命名空间 + namespace: etl + config: + # 配置中心地址 + server-addr: 111.229.102.61:8848 + # 命名空间 + namespace: etl + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.etl.data.mapper: DEBUG diff --git a/etl-modules/etl-rule-engine/etl-rule-engine-client/pom.xml b/etl-modules/etl-rule-engine/etl-rule-engine-client/pom.xml new file mode 100644 index 0000000..798e5a6 --- /dev/null +++ b/etl-modules/etl-rule-engine/etl-rule-engine-client/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.etl + etl-rule-engine + 3.6.3 + + + etl-rule-engine-client + + + 17 + 17 + UTF-8 + + + + com.etl + etl-rule-engine-common + 3.6.3 + + + diff --git a/etl-modules/etl-rule-engine/etl-rule-engine-common/pom.xml b/etl-modules/etl-rule-engine/etl-rule-engine-common/pom.xml new file mode 100644 index 0000000..a10d87c --- /dev/null +++ b/etl-modules/etl-rule-engine/etl-rule-engine-common/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.etl + etl-rule-engine + 3.6.3 + + + etl-rule-engine-common + + + 17 + 17 + UTF-8 + + + + com.etl + etl-common-core + + + + diff --git a/etl-modules/etl-rule-engine/etl-rule-engine-remote/pom.xml b/etl-modules/etl-rule-engine/etl-rule-engine-remote/pom.xml new file mode 100644 index 0000000..6dc3a42 --- /dev/null +++ b/etl-modules/etl-rule-engine/etl-rule-engine-remote/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + com.etl + etl-rule-engine + 3.6.3 + + + etl-rule-engine-remote + + + 17 + 17 + UTF-8 + + + diff --git a/etl-modules/etl-rule-engine/etl-rule-engine-server/pom.xml b/etl-modules/etl-rule-engine/etl-rule-engine-server/pom.xml new file mode 100644 index 0000000..5bea871 --- /dev/null +++ b/etl-modules/etl-rule-engine/etl-rule-engine-server/pom.xml @@ -0,0 +1,134 @@ + + + 4.0.0 + + com.etl + etl-rule-engine + 3.6.3 + + + etl-rule-engine-server + + + 17 + 17 + UTF-8 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.etl + etl-common-datasource + + + + + com.etl + etl-common-datascope + + + + + com.etl + etl-common-log + + + + + com.etl + etl-common-swagger + + + + + com.etl + etl-data-source-common + + + + + + com.etl + etl-data-source-remote + + + + + org.postgresql + postgresql + 42.5.0 + + + com.etl + etl-rule-engine-common + 3.6.3 + compile + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + +