Compare commits

..

No commits in common. "master_fei" and "master" have entirely different histories.

536 changed files with 2043 additions and 7862 deletions

View File

@ -1,26 +1,26 @@
## 系统模块 ## 系统模块
~~~ ~~~
com.etl com.muyu
├── etl-ui // 前端框架 [80] ├── muyu-ui // 前端框架 [80]
├── etl-gateway // 网关模块 [8080] ├── muyu-gateway // 网关模块 [8080]
├── etl-auth // 认证中心 [9200] ├── muyu-auth // 认证中心 [9200]
├── etl-common // 通用模块 ├── muyu-common // 通用模块
│ └── etl-common-core // 核心模块 │ └── muyu-common-core // 核心模块
│ └── etl-common-datascope // 权限范围 │ └── muyu-common-datascope // 权限范围
│ └── etl-common-datasource // 多数据源 │ └── muyu-common-datasource // 多数据源
│ └── etl-common-log // 日志记录 │ └── muyu-common-log // 日志记录
│ └── etl-common-redis // 缓存服务 │ └── muyu-common-redis // 缓存服务
│ └── etl-common-seata // 分布式事务 │ └── muyu-common-seata // 分布式事务
│ └── etl-common-security // 安全模块 │ └── muyu-common-security // 安全模块
│ └── etl-common-swagger // 系统接口 │ └── muyu-common-swagger // 系统接口
│ └── etl-common-system // 系统基础 │ └── muyu-common-system // 系统基础
├── etl-modules // 业务模块 ├── muyu-modules // 业务模块
│ └── etl-system // 系统模块 [9201] │ └── muyu-system // 系统模块 [9201]
│ └── etl-gen // 代码生成 [9202] │ └── muyu-gen // 代码生成 [9202]
│ └── etl-job // 定时任务 [9203] │ └── muyu-job // 定时任务 [9203]
│ └── etl-file // 文件服务 [9300] │ └── muyu-file // 文件服务 [9300]
├── etl-visual // 图形化管理模块 ├── muyu-visual // 图形化管理模块
│ └── etl-visual-monitor // 监控中心 [9100] │ └── muyu-visual-monitor // 监控中心 [9100]
├──pom.xml // 公共依赖 ├──pom.xml // 公共依赖
~~~ ~~~

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Auth<74><68><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-auth/target cd ../muyu-auth/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-auth.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-auth.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Gateway<61><79><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-gateway/target cd ../muyu-gateway/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-gateway.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-gateway.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Modules-File<6C><65><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-modules/etl-file/target cd ../muyu-modules/muyu-file/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-modules-file.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-modules-file.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Modules-Gen<65><6E><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-modules/etl-gen/target cd ../muyu-modules/muyu-gen/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-modules-gen.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-modules-gen.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Modules-Job<6F><62><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-modules/etl-job/target cd ../muyu-modules/muyu-job/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-modules-job.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-modules-job.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Modules-System<65><6D><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-modules/etl-system/target cd ../muyu-modules/muyu-system/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-modules-system.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-modules-system.jar
cd bin cd bin
pause pause

View File

@ -4,11 +4,11 @@ echo [<5B><>Ϣ] ʹ<><CAB9>Jar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Monitor<6F><72><EFBFBD>̡<EFBFBD>
echo. echo.
cd %~dp0 cd %~dp0
cd ../etl-visual/etl-monitor/target cd ../muyu-visual/muyu-monitor/target
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar etl-visual-monitor.jar java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar muyu-visual-monitor.jar
cd bin cd bin
pause pause

View File

@ -14,28 +14,28 @@ cp ../sql/ry_config_20220929.sql ./mysql/db
# copy html # copy html
echo "begin copy html " echo "begin copy html "
cp -r ../etl-ui/dist/** ./nginx/html/dist cp -r ../muyu-ui/dist/** ./nginx/html/dist
# copy jar # copy jar
echo "begin copy etl-gateway " echo "begin copy muyu-gateway "
cp ../etl-gateway/target/etl-gateway.jar ./etl/gateway/jar cp ../muyu-gateway/target/muyu-gateway.jar ./muyu/gateway/jar
echo "begin copy etl-auth " echo "begin copy muyu-auth "
cp ../etl-auth/target/etl-auth.jar ./etl/auth/jar cp ../muyu-auth/target/muyu-auth.jar ./muyu/auth/jar
echo "begin copy etl-visual " echo "begin copy muyu-visual "
cp ../etl-visual/etl-monitor/target/etl-visual-monitor.jar ./etl/visual/monitor/jar cp ../muyu-visual/muyu-monitor/target/muyu-visual-monitor.jar ./muyu/visual/monitor/jar
echo "begin copy etl-modules-system " echo "begin copy muyu-modules-system "
cp ../etl-modules/etl-system/target/etl-modules-system.jar ./etl/modules/system/jar cp ../muyu-modules/muyu-system/target/muyu-modules-system.jar ./muyu/modules/system/jar
echo "begin copy etl-modules-file " echo "begin copy muyu-modules-file "
cp ../etl-modules/etl-file/target/etl-modules-file.jar ./etl/modules/file/jar cp ../muyu-modules/muyu-file/target/muyu-modules-file.jar ./muyu/modules/file/jar
echo "begin copy etl-modules-job " echo "begin copy muyu-modules-job "
cp ../etl-modules/etl-job/target/etl-modules-job.jar ./etl/modules/job/jar cp ../muyu-modules/muyu-job/target/muyu-modules-job.jar ./muyu/modules/job/jar
echo "begin copy etl-modules-gen " echo "begin copy muyu-modules-gen "
cp ../etl-modules/etl-gen/target/etl-modules-gen.jar ./etl/modules/gen/jar cp ../muyu-modules/muyu-gen/target/muyu-modules-gen.jar ./muyu/modules/gen/jar

View File

@ -26,12 +26,12 @@ port(){
# 启动基础环境(必须) # 启动基础环境(必须)
base(){ base(){
docker-compose up -d etl-mysql etl-redis etl-nacos docker-compose up -d muyu-mysql muyu-redis muyu-nacos
} }
# 启动程序模块(必须) # 启动程序模块(必须)
modules(){ modules(){
docker-compose up -d etl-nginx etl-gateway etl-auth etl-modules-system docker-compose up -d muyu-nginx muyu-gateway muyu-auth muyu-modules-system
} }
# 关闭所有环境/模块 # 关闭所有环境/模块

View File

@ -1,7 +1,7 @@
version : '3.8' version : '3.8'
services: services:
etl-nacos: muyu-nacos:
container_name: etl-nacos container_name: muyu-nacos
image: nacos/nacos-server image: nacos/nacos-server
build: build:
context: ./nacos context: ./nacos
@ -15,9 +15,9 @@ services:
- "9848:9848" - "9848:9848"
- "9849:9849" - "9849:9849"
depends_on: depends_on:
- etl-mysql - muyu-mysql
etl-mysql: muyu-mysql:
container_name: etl-mysql container_name: muyu-mysql
image: mysql:5.7 image: mysql:5.7
build: build:
context: ./mysql context: ./mysql
@ -38,103 +38,103 @@ services:
environment: environment:
MYSQL_DATABASE: 'ry-cloud' MYSQL_DATABASE: 'ry-cloud'
MYSQL_ROOT_PASSWORD: password MYSQL_ROOT_PASSWORD: password
etl-redis: muyu-redis:
container_name: etl-redis container_name: muyu-redis
image: redis image: redis
build: build:
context: ./redis context: ./redis
ports: ports:
- "6379:6379" - "6379:6379"
volumes: volumes:
- ./redis/conf/redis.conf:/home/etl/redis/redis.conf - ./redis/conf/redis.conf:/home/muyu/redis/redis.conf
- ./redis/data:/data - ./redis/data:/data
command: redis-server /home/etl/redis/redis.conf command: redis-server /home/muyu/redis/redis.conf
etl-nginx: muyu-nginx:
container_name: etl-nginx container_name: muyu-nginx
image: nginx image: nginx
build: build:
context: ./nginx context: ./nginx
ports: ports:
- "80:80" - "80:80"
volumes: volumes:
- ./nginx/html/dist:/home/etl/projects/etl-ui - ./nginx/html/dist:/home/muyu/projects/muyu-ui
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx - ./nginx/logs:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d - ./nginx/conf.d:/etc/nginx/conf.d
depends_on: depends_on:
- etl-gateway - muyu-gateway
links: links:
- etl-gateway - muyu-gateway
etl-gateway: muyu-gateway:
container_name: etl-gateway container_name: muyu-gateway
build: build:
context: ./etl/gateway context: ./muyu/gateway
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "8080:8080" - "8080:8080"
depends_on: depends_on:
- etl-redis - muyu-redis
links: links:
- etl-redis - muyu-redis
etl-auth: muyu-auth:
container_name: etl-auth container_name: muyu-auth
build: build:
context: ./etl/auth context: ./muyu/auth
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9200:9200" - "9200:9200"
depends_on: depends_on:
- etl-redis - muyu-redis
links: links:
- etl-redis - muyu-redis
etl-modules-system: muyu-modules-system:
container_name: etl-modules-system container_name: muyu-modules-system
build: build:
context: ./etl/modules/system context: ./muyu/modules/system
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9201:9201" - "9201:9201"
depends_on: depends_on:
- etl-redis - muyu-redis
- etl-mysql - muyu-mysql
links: links:
- etl-redis - muyu-redis
- etl-mysql - muyu-mysql
etl-modules-gen: muyu-modules-gen:
container_name: etl-modules-gen container_name: muyu-modules-gen
build: build:
context: ./etl/modules/gen context: ./muyu/modules/gen
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9202:9202" - "9202:9202"
depends_on: depends_on:
- etl-mysql - muyu-mysql
links: links:
- etl-mysql - muyu-mysql
etl-modules-job: muyu-modules-job:
container_name: etl-modules-job container_name: muyu-modules-job
build: build:
context: ./etl/modules/job context: ./muyu/modules/job
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9203:9203" - "9203:9203"
depends_on: depends_on:
- etl-mysql - muyu-mysql
links: links:
- etl-mysql - muyu-mysql
etl-modules-file: muyu-modules-file:
container_name: etl-modules-file container_name: muyu-modules-file
build: build:
context: ./etl/modules/file context: ./muyu/modules/file
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9300:9300" - "9300:9300"
volumes: volumes:
- ./etl/uploadPath:/home/etl/uploadPath - ./muyu/uploadPath:/home/muyu/uploadPath
etl-visual-monitor: muyu-visual-monitor:
container_name: etl-visual-monitor container_name: muyu-visual-monitor
build: build:
context: ./etl/visual/monitor context: ./muyu/visual/monitor
dockerfile: dockerfile dockerfile: dockerfile
ports: ports:
- "9100:9100" - "9100:9100"

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-auth.jar /home/etl/etl-auth.jar
# 启动认证服务
ENTRYPOINT ["java","-jar","etl-auth.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-gateway.jar /home/etl/etl-gateway.jar
# 启动网关服务
ENTRYPOINT ["java","-jar","etl-gateway.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-modules-file.jar /home/etl/etl-modules-file.jar
# 启动文件服务
ENTRYPOINT ["java","-jar","etl-modules-file.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-modules-gen.jar /home/etl/etl-modules-gen.jar
# 启动代码生成服务
ENTRYPOINT ["java","-jar","etl-modules-gen.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-modules-job.jar /home/etl/etl-modules-job.jar
# 启动定时任务服务
ENTRYPOINT ["java","-jar","etl-modules-job.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-modules-system.jar /home/etl/etl-modules-system.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","etl-modules-system.jar"]

View File

@ -1,15 +0,0 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER etl
# 挂载目录
VOLUME /home/etl
# 创建目录
RUN mkdir -p /home/etl
# 指定路径
WORKDIR /home/etl
# 复制jar文件到路径
COPY ./jar/etl-visual-monitor.jar /home/etl/etl-visual-monitor.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","etl-visual-monitor.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-auth.jar /home/muyu/muyu-auth.jar
# 启动认证服务
ENTRYPOINT ["java","-jar","muyu-auth.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-gateway.jar /home/muyu/muyu-gateway.jar
# 启动网关服务
ENTRYPOINT ["java","-jar","muyu-gateway.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-modules-file.jar /home/muyu/muyu-modules-file.jar
# 启动文件服务
ENTRYPOINT ["java","-jar","muyu-modules-file.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-modules-gen.jar /home/muyu/muyu-modules-gen.jar
# 启动代码生成服务
ENTRYPOINT ["java","-jar","muyu-modules-gen.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-modules-job.jar /home/muyu/muyu-modules-job.jar
# 启动定时任务服务
ENTRYPOINT ["java","-jar","muyu-modules-job.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-modules-system.jar /home/muyu/muyu-modules-system.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","muyu-modules-system.jar"]

View File

@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER muyu
# 挂载目录
VOLUME /home/muyu
# 创建目录
RUN mkdir -p /home/muyu
# 指定路径
WORKDIR /home/muyu
# 复制jar文件到路径
COPY ./jar/muyu-visual-monitor.jar /home/muyu/muyu-visual-monitor.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","muyu-visual-monitor.jar"]

View File

@ -1,7 +1,7 @@
# 基础镜像 # 基础镜像
FROM mysql:5.7 FROM mysql:5.7
# author # author
MAINTAINER etl MAINTAINER muyu
# 执行sql脚本 # 执行sql脚本
ADD ./db/*.sql /docker-entrypoint-initdb.d/ ADD ./db/*.sql /docker-entrypoint-initdb.d/

View File

@ -1,6 +1,6 @@
spring.datasource.platform=mysql spring.datasource.platform=mysql
db.num=1 db.num=1
db.url.0=jdbc:mysql://etl-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC db.url.0=jdbc:mysql://muyu-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root db.user=root
db.password=password db.password=password
@ -16,7 +16,7 @@ management.metrics.export.influx.enabled=false
server.tomcat.accesslog.enabled=true server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
server.tomcat.basedir=/home/etl/nacos/tomcat/logs server.tomcat.basedir=/home/muyu/nacos/tomcat/logs
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/** nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**

View File

@ -1,7 +1,7 @@
# 基础镜像 # 基础镜像
FROM nacos/nacos-server FROM nacos/nacos-server
# author # author
MAINTAINER etl MAINTAINER muyu
# 复制conf文件到路径 # 复制conf文件到路径
COPY ./conf/application.properties /home/nacos/conf/application.properties COPY ./conf/application.properties /home/nacos/conf/application.properties

View File

@ -15,7 +15,7 @@ http {
server_name localhost; server_name localhost;
location / { location / {
root /home/etl/projects/etl-ui; root /home/muyu/projects/muyu-ui;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
index index.html index.htm; index index.html index.htm;
} }
@ -25,7 +25,7 @@ http {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://etl-gateway:8080/; proxy_pass http://muyu-gateway:8080/;
} }
# 避免actuator暴露 # 避免actuator暴露

View File

@ -1,15 +1,15 @@
# 基础镜像 # 基础镜像
FROM nginx FROM nginx
# author # author
MAINTAINER etl MAINTAINER muyu
# 挂载目录 # 挂载目录
VOLUME /home/etl/projects/etl-ui VOLUME /home/muyu/projects/muyu-ui
# 创建目录 # 创建目录
RUN mkdir -p /home/etl/projects/etl-ui RUN mkdir -p /home/muyu/projects/muyu-ui
# 指定路径 # 指定路径
WORKDIR /home/etl/projects/etl-ui WORKDIR /home/muyu/projects/muyu-ui
# 复制conf文件到路径 # 复制conf文件到路径
COPY ./conf/nginx.conf /etc/nginx/nginx.conf COPY ./conf/nginx.conf /etc/nginx/nginx.conf
# 复制html文件到路径 # 复制html文件到路径
COPY ./html/dist /home/etl/projects/etl-ui COPY ./html/dist /home/muyu/projects/muyu-ui

View File

@ -1,13 +1,13 @@
# 基础镜像 # 基础镜像
FROM redis FROM redis
# author # author
MAINTAINER etl MAINTAINER muyu
# 挂载目录 # 挂载目录
VOLUME /home/etl/redis VOLUME /home/muyu/redis
# 创建目录 # 创建目录
RUN mkdir -p /home/etl/redis RUN mkdir -p /home/muyu/redis
# 指定路径 # 指定路径
WORKDIR /home/etl/redis WORKDIR /home/muyu/redis
# 复制conf文件到路径 # 复制conf文件到路径
COPY ./conf/redis.conf /home/etl/redis/redis.conf COPY ./conf/redis.conf /home/muyu/redis/redis.conf

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<springProperty scope="context" name="springAppName" source="Website may be available for web development ideas"/>
<springProperty scope="context" name="serverPort" source="server.port"/>
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!--logstash的服务地址和端口可以实际情况设置-->
<destination>111.229.102.61:5044</destination>
<!-- 日志输出编码 -->
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
<pattern>
<pattern>
{
<!--应用名称 -->
"app": "${springAppName}_${serverPort}",
<!--打印时间 -->
"timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS}",
<!--线程名称 -->
"thread": "%thread",
<!--日志级别 -->
"level": "%level",
<!--日志名称 -->
"logger_name": "%logger",
<!--日志信息 -->
"message": "%msg",
<!--日志堆栈 -->
"stack_trace": "%exception"
}
</pattern>
</pattern>
</providers>
</encoder>
</appender>
<!--定义日志文件的存储地址,使用绝对路径-->
<property name="LOG_HOME" value="/Users/jianchenghou/log/elklog"/>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${LOG_HOME}/${springAppName}-${serverPort}-%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="LOGSTASH" />
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>

View File

@ -1,33 +0,0 @@
package com.etl.common.core.constant;
/**
*
*
* @author etl
*/
public class ServiceNameConstants {
/**
* serviceid
*/
public static final String AUTH_SERVICE = "etl-auth";
/**
* serviceid
*/
public static final String SYSTEM_SERVICE = "etl-system";
/**
* serviceid
*/
public static final String FILE_SERVICE = "etl-file";
/**
*
*/
public static final String DATA_SOURCE_SERVICE = "etl-data-source";
/**
*
*/
public static final String DATA_RULE_ENGINE_SERVICE = "etl-data-rule-engine";
}

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.etl</groupId>
<artifactId>etl-common</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>etl-common-data-standard</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,7 +0,0 @@
package com.etl;
public class Main {
public static void main(String[] args) {
System.out.println ( "Hello world!" );
}
}

View File

@ -1,44 +0,0 @@
package com.etl.conmon.data.standard.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author YunFei.Du
* @date 14:16 2024/5/15
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DataModel {
/**
*
*/
private String key;
/**
*
*/
private Object value;
/**
* -
*/
private String sourceType;
/**
* -
*/
private String processType;
/**
*
*/
private Class<?> processClass;
}

View File

@ -1,38 +0,0 @@
package com.etl.conmon.data.standard.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author YunFei.Du
* @date 14:17 2024/5/15
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DataSetModel {
// [[DataModel,DataModel,DataModel],[DataModel,DataModel,DataModel]]
private DataSetModel[] dataSetModel = null;
private int setLength;
public static DataSetModel build(int dataSetModelLength){
return build ( new DataSetModel[dataSetModelLength] );
}
public static DataSetModel build(DataSetModel[] dataSetModel){
return DataSetModel.builder ()
.dataSetModel(dataSetModel)
.setLength ( dataSetModel.length )
.build ();
}
}

View File

@ -1,10 +0,0 @@
package com.etl.conmon.data.standard.model;
/**
*
* @author YunFei.Du
* @date 14:17 2024/5/15
*/
public interface DataStandard {
}

View File

@ -1,78 +0,0 @@
package com.etl.conmon.data.standard.model;
import com.etl.conmon.data.standard.utils.EtlUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Arrays;
import java.util.function.IntFunction;
/**
*
* @author YunFei.Du
* @date 14:17 2024/5/15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RecordModel {
// [DataModel,DataModel,DataModel]
/**
* key ([] )
*/
private String[] keys;
/**
*
*/
private DataModel[] keyForValue;
/**
*
*/
private DataModel[] dataModelArr = null;
/**
*
*/
private int recodeLength;
/**
* RecordModel
* build(int dataModelLength, String[] keys)便RecordModel
* dataModelLengthkeys
*
* @param dataModelLength RecordModel
* @param keys RecordModel访
* @return RecordModel
*/
public static RecordModel build(int dataModelLength,String[] keys){
// 使用提供的数据模型长度和键数组来构建RecordModel
return build ( new DataModel[dataModelLength] , keys);
}
/**
*
*
* @param dataModelArr
* @param keys
* @return
*/
public static RecordModel build(DataModel[] dataModelArr, String[] keys){
return RecordModel.builder()
.dataModelArr ( dataModelArr )
.recodeLength ( dataModelArr.length )
.keys( keys)
// 筛选数据模型数组中键值匹配给定键数组的元素并将其设置为keyForValue
.keyForValue(
Arrays.stream (dataModelArr).filter ( dataModel -> EtlUtils.valAsArr ( keys , dataModel.getKey () ) )
.toArray ( value -> new DataModel[0] )
)
.build ();
}
}

View File

@ -1,21 +0,0 @@
package com.etl.conmon.data.standard.utils;
/**
* @ClassName EtlUtils
* @Description
* @Author YunFei.Du
* @Date 2024/5/15 14:28
*/
public class EtlUtils {
public static boolean valAsArr(String[] keys,String key ){
for (String s : keys) {
if (s.equals ( key )){
return true;
}
}
return false;
}
}

View File

@ -1,2 +0,0 @@
com.etl.common.log.service.AsyncLogService
com.etl.common.log.aspect.LogAspect

View File

@ -1,2 +0,0 @@
com.etl.common.redis.configure.RedisConfig
com.etl.common.redis.service.RedisService

View File

@ -1,5 +0,0 @@
com.etl.common.security.config.WebMvcConfig
com.etl.common.security.service.TokenService
com.etl.common.security.aspect.PreAuthorizeAspect
com.etl.common.security.aspect.InnerAuthAspect
com.etl.common.security.handler.GlobalExceptionHandler

View File

@ -1,3 +0,0 @@
# com.etl.common.swagger.config.SwaggerAutoConfiguration
# com.etl.common.swagger.config.SwaggerWebConfiguration
# com.etl.common.swagger.config.SwaggerBeanPostProcessor

View File

@ -1,3 +0,0 @@
com.etl.common.system.remote.factory.RemoteUserFallbackFactory
com.etl.common.system.remote.factory.RemoteLogFallbackFactory
com.etl.common.system.remote.factory.RemoteFileFallbackFactory

View File

@ -1,31 +0,0 @@
<?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.etl</groupId>
<artifactId>etl-cloud</artifactId>
<version>3.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>etl-common-log</module>
<module>etl-common-core</module>
<module>etl-common-redis</module>
<module>etl-common-seata</module>
<module>etl-common-swagger</module>
<module>etl-common-security</module>
<module>etl-common-datascope</module>
<module>etl-common-datasource</module>
<module>etl-common-system</module>
<module>etl-common-data-standard</module>
</modules>
<artifactId>etl-common</artifactId>
<packaging>pom</packaging>
<description>
etl-common通用模块
</description>
</project>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.etl</groupId>
<artifactId>etl-data-source</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>etl-data-source-client</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-data-source-remote</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,15 +0,0 @@
package com.etl.data.client.config;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;
/**
*
* @author YunFei.Du
* @date 21:34 2024/5/8
*/
@Component
@Import ( value = {DataAccessClientRunner.class})
public class DataAccessClientConfig {
}

View File

@ -1,48 +0,0 @@
package com.etl.data.client.config;
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.List;
/**
* 访
*
* @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) {
// List< DataSource > dataSourceList = remoteDataSourceService.getDataSourceList ( new DataSourceQueryReq ( ) ).getData ( ).getRows ( );
// if (!dataSourceList.isEmpty ()){
// ConnPoolManagementService.init ( dataSourceList );
// try {
// DruidPooledConnection druidPooledConnection = ConnPoolManagementService.get ( dataSourceList.get ( 0 ).getKey ( ) );
//// Map< DruidPooledConnection, String > connToKey = ConnPoolManagementService.getConnToKey ( );
//// log.info ( "connToKey:{}", druidPooledConnection );
//
//// JDBCConcreteClass jdbcConcreteClass = new JDBCConcreteClass ( );
//// PreparedStatement preparedStatement = jdbcConcreteClass.getPreparedStatement ( connection, "select * from car" );
//// ResultSetMetaData rsd = preparedStatement.getMetaData ( );
//// for (int i = 1; i <= rsd.getColumnCount ( ); i++) {
//// log.info ( "类型:{}", rsd.getColumnClassName ( i ) );
//// }
//
// ConnPoolManagementService.returnConnection ( druidPooledConnection );
// } catch (Exception e) {
// log.error ( "数据访问客户端运行程序异常:{}", e.getMessage ( ) );
// throw new RuntimeException ( e );
// }
// }
}
}

View File

@ -1,52 +0,0 @@
package com.etl.data.client.connPool.pool;
import com.alibaba.druid.pool.DruidDataSource;
import com.etl.common.core.exception.ServiceException;
import com.etl.common.core.utils.StringUtils;
import lombok.extern.log4j.Log4j2;
import java.util.concurrent.ConcurrentHashMap;
/**
*
* @author YunFei.Du
* @date 15:04 2024/5/15
*/
@Log4j2
public class ConnPoolContext {
/**
*
*/
private ConnPoolContext(){
}
private final static ConcurrentHashMap<String, DruidDataSource> connPoolContext
= new ConcurrentHashMap<>(16);
public static void setConnection(String key,DruidDataSource druidDataSource){
if (connPoolContext.containsKey(key)){
throw new ServiceException (
StringUtils.format ( "连接池key:{} 已存在" )
);
}
connPoolContext.put(key,druidDataSource);
}
/**
* key
* @param key
* @return
*/
public static DruidDataSource getConnection(String key){
return connPoolContext.get ( key );
}
public static void remove(String key){
try (DruidDataSource druidDataSource = connPoolContext.remove ( key )) {
druidDataSource.close ();
}catch (RuntimeException e){
log.warn ( "关闭连接池失败:[{}]-- [{}]", key,e.getMessage (),e );
}
}
}

View File

@ -1,114 +0,0 @@
package com.etl.data.client.connPool.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidPooledConnection;
import com.etl.data.client.connPool.pool.ConnPoolContext;
import com.etl.data.domain.DataSource;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import static com.etl.data.client.connPool.pool.ConnPoolContext.getConnection;
/**
* @ClassName ConnPollManagementService
* @Description
* @Author YunFei.Du
* @Date 2024/5/15 15:14
*/
@Component
@Log4j2
public class ConnPoolManagementService {
private final static ThreadLocal< Map<DruidPooledConnection,String> > connToKey
= new ThreadLocal<> ( );
public static Map<DruidPooledConnection,String> getConnToKey() {
Map<DruidPooledConnection,String> dataMap=connToKey.get ();
return dataMap;
}
/**
*
*/
public static void init(List< DataSource> dataSourceList) {
for (DataSource dataSource : dataSourceList) {
createPool ( dataSource );
}
}
/**
*
*/
public static void createPool(DataSource dataSource){
DruidDataSource druidDataSource = new DruidDataSource ( );
druidDataSource.setUsername ( dataSource.getUsername ( ) );
druidDataSource.setPassword ( dataSource.getPassword ( ) );
druidDataSource.setUrl ( "jdbc:mysql://" + dataSource.getHost ( ) + ":" + dataSource.getPort ( ) + "/" + dataSource.getDatabaseName ( ) );
druidDataSource.setDriverClassName ( dataSource.getJdbcDriver ( ) );
// 设置初始化连接数和最小空闲连接数
druidDataSource.setInitialSize ( Integer.valueOf ( dataSource.getInitNum ( ) ) );
druidDataSource.setMinIdle ( Integer.valueOf ( dataSource.getInitNum ( ) ) );
// 设置最大活动连接数
druidDataSource.setMaxActive ( Integer.valueOf ( dataSource.getMaxNum ( ) ) );
ConnPoolContext.setConnection ( dataSource.getKey (), druidDataSource );
try {
druidDataSource.init ();
} catch (SQLException e) {
log.error ( "新增数据源失败" );
throw new RuntimeException ( e );
}
;
}
/**
*
*/
public static DruidPooledConnection get(DataSource dataSource){
return get ( dataSource.getKey () );
}
/**
*
*/
public static DruidPooledConnection get(String key){
DruidPooledConnection connection=null;
DruidDataSource druidDataSource = getConnection (key );
try {
connection = druidDataSource.getConnection ( );
return connection;
} catch (SQLException e) {
log.warn ( "获取连接异常:[{}] - [{}]",e.getMessage (),e );
throw new RuntimeException ( e );
}finally {
getConnToKey ().put ( connection,key );
}
}
/**
*
* @param connection
*/
public static void returnConnection(DruidPooledConnection connection) {
try {
connection.close ();
} catch (SQLException e) {
log.warn ( "获取连接异常:[{}] - [{}]",getConnToKey().get ( connection ),e.getMessage () );
throw new RuntimeException ( e );
}finally {
getConnToKey ().remove ( connection );
}
}
public static void remove(DataSource dataSource) {
}
}

View File

@ -1,18 +0,0 @@
package com.etl.data.client.jdbcUtils;
import org.springframework.stereotype.Component;
import java.sql.Connection;
import java.sql.PreparedStatement;
/**
* jdbc
* @author YunFei.Du
* @date 15:34 2024/5/14
*/
@Component
public abstract class JDBCAbstractClass {
public abstract PreparedStatement getPreparedStatement(Connection connection, String sql);
}

View File

@ -1,26 +0,0 @@
package com.etl.data.client.jdbcUtils;
import lombok.extern.log4j.Log4j2;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* jdbc
* @author YunFei.Du
* @date 15:36 2024/5/14
*/
@Log4j2
public class JDBCConcreteClass extends JDBCAbstractClass{
@Override
public PreparedStatement getPreparedStatement(Connection connection,String sql) {
try {
PreparedStatement preparedStatement = connection.prepareStatement ( sql );
log.info ( "查询结果:" + preparedStatement );
return preparedStatement;
} catch (SQLException e) {
throw new RuntimeException ( e );
}
}
}

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.etl</groupId>
<artifactId>etl-data-source</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>etl-data-source-common</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.20</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.20</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,46 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
* @author YunFei.Du
* @date 15:30 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@TableName("asset_accredit")
public class AssetAccredit extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键id */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 部门id */
private Long deptId;
/** 数据表id */
private Long dataAssetId;
/** 用户id */
private Long userId;
}

View File

@ -1,72 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
*
* @author YunFei.Du
* @date 10:26 2024/5/1
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("asset_model")
public class AssetModel extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 数据资产ID */
private Long dataAssetId;
/** 字段名 */
private String name;
/** 字段备注 */
private String comment;
/** 是否主键 */
private String isPrimaryKey;
/** 数据类型 */
private String type;
/** 映射数据类型 */
private String mappingType;
/** 长度 */
private String length;
/** 小数位 */
private String decimalPlaces;
/** 是否不可为空 */
private String isNull;
/** 是否字典 */
private String isDict;
/** 默认值 */
private String defaultValue;
/** 字典key */
private String dictKey;
/** 字典id */
private Long dictionaryId;
/** 字典信息 */
@TableField(exist = false)
private List<DictionaryInfo> dictionaryDataList;
}

View File

@ -1,46 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* ()
* @author YunFei.Du
* @date 10:06 2024/5/1
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("data_asset")
public class DataAsset extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 数据接入ID */
private Long dataSourceId;
/** 表名称 */
private String name;
/** 表备注 */
private String nameAs;
/** 数据量 */
private Integer dataTotal;
/** 资产模型 */
private Integer fields;
}

View File

@ -1,103 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
* @author YunFei.Du
* @date 21:47 2024/4/25
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("data_source")
public class DataSource extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*/
private String name;
/**
*
*/
private String systemName;
/**
*
*/
private String type;
/**
*
*/
private String host;
/**
* ip
*/
private String port;
/**
*
*/
private String databaseName;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String connectionParam;
/**
*
*/
private String initNum;
/**
*
*/
private String maxNum;
/**
*
*/
private String maxWaitTime;
/**
*
*/
private String maxWaitSize;
/**
*
*/
private String jdbcDriver;
/**
*
*/
private String modeName;
public String getKey(){
return this.name+"_"+this.systemName+"_"+this.id;
}
}

View File

@ -1,48 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
*
* @author YunFei.Du
* @date 15:16 2024/5/1
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("dictionary")
public class Dictionary extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 字典名称 */
private String dictionaryName;
/** 字典key */
private String dictionaryKey;
/** 数据源ID */
private Long dataSourceId;
/** 字典数据集合 */
@TableField(exist = false)
private List<DictionaryInfo> dictionaryDataList;
}

View File

@ -1,44 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
* @author YunFei.Du
* @date 15:16 2024/5/1
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("dictionary_data")
public class DictionaryInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* id
*/
private Long dictionaryId;
/**
*
*/
private String label;
/**
*
*/
private String val;
}

View File

@ -1,43 +0,0 @@
package com.etl.data.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.etl.common.core.annotation.Excel;
import com.etl.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
*
* @author YunFei.Du
* @date 15:26 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@TableName("source_accredit")
public class SourceAccredit extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键id */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 部门id */
private Long deptId;
/** 数据源id */
private Long dataSourceId;
/** 用户id */
private Long userId;
}

View File

@ -1,20 +0,0 @@
package com.etl.data.domain.custom;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName Statistics
* @Description
* @Author YunFei Du
* @Date 2024/4/23 20:43
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Statistics {
private Long dataAsset;
private Long assetModel;
private Long dataModel;
}

View File

@ -1,83 +0,0 @@
package com.etl.data.domain.dataSource;
import com.alibaba.druid.pool.DruidDataSource;
import com.etl.data.domain.DataSource;
import lombok.extern.log4j.Log4j2;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
/**
*
* @author YunFei.Du
* @date 9:09 2024/5/14
*/
@Log4j2
public class DataSourceConfig {
private static HashMap<String,DruidDataSource> dataSourceMap= new HashMap<> ();
/**
*
*
* @param dataSource JDBC
*/
public static void init(DataSource dataSource) {
// 创建Druid数据源实例
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setUsername(dataSource.getUsername ());
druidDataSource.setPassword(dataSource.getPassword());
druidDataSource.setUrl ( "jdbc:mysql://"+dataSource.getHost ( )+":"+dataSource.getPort ( )+"/"+dataSource.getDatabaseName ( ) );
druidDataSource.setDriverClassName ( dataSource.getJdbcDriver () );
// 设置初始化连接数和最小空闲连接数
druidDataSource.setInitialSize ( Integer.valueOf ( dataSource.getInitNum () ) );
druidDataSource.setMinIdle ( Integer.valueOf ( dataSource.getInitNum () ) );
// 设置最大活动连接数
druidDataSource.setMaxActive ( Integer.valueOf ( dataSource.getMaxNum () ) );
try {
//初始化连接池
druidDataSource.init();
} catch (SQLException e) {
// 如果初始化失败,记录错误信息
log.error ( "初始化数据源失败" );
}
// 将初始化好的数据源实例添加到全局的dataSourceMap中以便其他部分使用
dataSourceMap.put(dataSource.getName ()+dataSource.getId(), druidDataSource);
}
/**
*
* @param key
*/
public static void getNum(String key) {
DruidDataSource druidDataSource = dataSourceMap.get ( key );
log.info(key + "正在使用连接" + druidDataSource.getActiveCount () + "个,线程数量:" + druidDataSource.getPoolingCount () + "个");
}
public static Connection getConnection(String key) {
DruidDataSource druidDataSource = dataSourceMap.get ( key );
if (druidDataSource != null){
try {
return druidDataSource.getConnection ( );
} catch (SQLException e) {
throw new RuntimeException ( e );
}
}
return null;
}
/**
*
* @param connection
*/
public static void close(Connection connection) {
try {
connection.close ();
} catch (SQLException e) {
log.error ( "释放连接失败" );
}
}
}

View File

@ -1,56 +0,0 @@
package com.etl.data.domain.decoration;
import com.etl.data.domain.DataSource;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* @ClassName DataSourceDecoration
* @Description
* @Author YunFei.Du
* @Date 2024/5/9 8:53
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class DataSourceDecoration {
/**
* id
*/
private Long id;
/**
*
*/
private String systemName;
/**
*
*/
private String name;
/** 连接驱动名称 */
private String jdbcDriver;
/**
*
*/
private String databaseName;
private String type;
public static DataSourceDecoration dataSourceBuild(DataSource dataSource) {
return DataSourceDecoration.builder ()
.id(dataSource.getId ())
.name(dataSource.getName ())
.systemName(dataSource.getSystemName ())
.databaseName(dataSource.getDatabaseName ())
.type("dataSource")
.build ();
}
}

View File

@ -1,20 +0,0 @@
package com.etl.data.domain.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
*
* @author YunFei.Du
* @date 15:58 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AccreditModel {
private List<Long> userAccreditModelIds;
private List<Long> deptAccreditModelIds;
}

View File

@ -1,23 +0,0 @@
package com.etl.data.domain.req;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
*
* @author YunFei.Du
* @date 16:13 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class AssetAccreditReq {
private List<Long> deptIds;
private Long userId;
private Long dataAssetId;
}

View File

@ -1,37 +0,0 @@
package com.etl.data.domain.req;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
* @author YunFei.Du
* @date 14:55 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class DataSourceQueryReq {
private Integer pageNum=1;
private Integer pageSize=10;
/**
*
*/
private String name;
/**
*
* */
private String systemName;
/**
*
*/
private String databaseName;
}

View File

@ -1,24 +0,0 @@
package com.etl.data.domain.req;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* @ClassName SourceAccreditReq
* @Description
* @Author YunFei Du
* @Date 2024/4/26 15:19
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class SourceAccreditReq {
private List<Long> deptIds;
private Long userId;
private Long dataSourceId;
}

View File

@ -1,22 +0,0 @@
package com.etl.data.domain.resp;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
* @author YunFei.Du
* @date 14:55 2024/5/1
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class DataSourceSpliceParam {
private String name;
private String val;
}

View File

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.etl</groupId>
<artifactId>etl-data-source</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>etl-data-source-remote</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
</dependency>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-rule-engine-common</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-data-source-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,21 +0,0 @@
package com.etl.data.source.remote;
import com.etl.common.core.constant.ServiceNameConstants;
import com.etl.data.source.remote.factory.AssetModelFactory;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @ClassName RemoteAssetModelService
* @Description
* @Author YunFei.Du
* @Date 2024/5/13 15:08
*/
@FeignClient(
contextId = "RemoteAssetModelService",
value = ServiceNameConstants.DATA_SOURCE_SERVICE,
fallbackFactory = AssetModelFactory.class,
path = "/model"
)
public interface RemoteAssetModelService {
}

View File

@ -1,27 +0,0 @@
package com.etl.data.source.remote;
import com.etl.common.core.constant.ServiceNameConstants;
import com.etl.common.core.domain.Result;
import com.etl.common.core.web.page.TableDataInfo;
import com.etl.data.domain.DataSource;
import com.etl.data.domain.req.DataSourceQueryReq;
import com.etl.data.source.remote.factory.DataSourceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
*
* @author YunFei.Du
* @date 14:09 2024/5/10
*/
@FeignClient(
contextId = "RemoteDataAccess",
value = ServiceNameConstants.DATA_SOURCE_SERVICE,
fallbackFactory = DataSourceFactory.class,
path = "/source"
)
public interface RemoteDataSourceService {
@PostMapping("/list")
public Result< TableDataInfo< DataSource > > getDataSourceList (@RequestBody DataSourceQueryReq req);
}

View File

@ -1,17 +0,0 @@
package com.etl.data.source.remote.factory;
import com.etl.data.source.remote.RemoteAssetModelService;
import org.springframework.cloud.openfeign.FallbackFactory;
/**
* @ClassName AssetModelFactory
* @Description
* @Author YunFei.Du
* @Date 2024/5/13 15:07
*/
public class AssetModelFactory implements FallbackFactory< RemoteAssetModelService > {
@Override
public RemoteAssetModelService create(Throwable cause) {
return null;
}
}

View File

@ -1,25 +0,0 @@
package com.etl.data.source.remote.factory;
import com.etl.common.core.domain.Result;
import com.etl.common.core.web.page.TableDataInfo;
import com.etl.data.domain.DataSource;
import com.etl.data.domain.req.DataSourceQueryReq;
import com.etl.data.source.remote.RemoteDataSourceService;
import org.springframework.cloud.openfeign.FallbackFactory;
/**
*
* @author YunFei.Du
* @date 14:10 2024/5/10
*/
public class DataSourceFactory implements FallbackFactory< RemoteDataSourceService > {
@Override
public RemoteDataSourceService create(Throwable cause) {
return new RemoteDataSourceService (){
@Override
public Result< TableDataInfo< DataSource > > getDataSourceList(DataSourceQueryReq req) {
return Result.error ( new TableDataInfo<DataSource> ());
}
};
}
}

View File

@ -1,150 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.etl</groupId>
<artifactId>etl-data-source</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>etl-data-source-server</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.6</version>
</dependency>
<!-- Spring Cloud Sleuth -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!-- Spring Cloud zipkin -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Swagger UI -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- etl Common DataSource -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-datasource</artifactId>
</dependency>
<!-- etl Common DataScope -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-datascope</artifactId>
</dependency>
<!-- etl Common Log -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-log</artifactId>
</dependency>
<!-- etl Common Swagger -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-common-swagger</artifactId>
</dependency>
<!-- ETL模块 公共依赖 -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-data-source-common</artifactId>
</dependency>
<!-- ETL模块 远程调用 依赖 -->
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-data-source-remote</artifactId>
</dependency>
<!-- 添加 PostgreSQL JDBC 驱动 -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.0</version> <!-- 使用当前最新稳定版本 -->
</dependency>
<dependency>
<groupId>com.etl</groupId>
<artifactId>etl-data-source-client</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 加入maven deploy插件当在deploy时忽略些model-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,26 +0,0 @@
package com.etl.data;
import com.etl.common.security.annotation.EnableCustomConfig;
import com.etl.common.security.annotation.EnableMyFeignClients;
import com.etl.common.swagger.annotation.EnableCustomSwagger2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
*
*
* @author YunFei
*/
@EnableCustomConfig
@EnableCustomSwagger2
@EnableMyFeignClients
@SpringBootApplication
@EnableTransactionManagement
@MapperScan("com.etl.data.mapper")
public class ETLDataSourceApplication {
public static void main (String[] args) {
SpringApplication.run(ETLDataSourceApplication.class, args);
}
}

View File

@ -1,51 +0,0 @@
package com.etl.data.config;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
*
*
*/
@Component
@Log4j2
public class ConfirmCallbackConfig implements RabbitTemplate.ConfirmCallback {
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* @PostContructspringspring
*/
@PostConstruct
public void init() {
rabbitTemplate.setConfirmCallback(this);
}
/**
*
*
* @param correlationData
* @param ack
* @param cause
*/
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
if (ack) {
// 消息投递到broker 的状态true表示成功
log.info("消息已经成功发送到交换机");
} else {
// String exchange = correlationData.getReturned().getExchange();
// String message = correlationData.getReturned().getMessage().getBody().toString();
// 发送异常
log.error("消息发送到交换机:失败,原因是:{}", cause);
// TODO 可以把异常信息 以及 消息的内容直接添加到 MYSQL
}
}
}

View File

@ -1,62 +0,0 @@
package com.etl.data.config;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* rabbitAdmin RabbitAdmin Spring
*/
@Configuration
public class RabbitAdminConfig {
public static final String DATA_SOURCE_EXCHANGE = "data_source_exchange";
public static final String RULE_ENGINE_EXCHANGE = "rule_engine_exchange";
@Value("${spring.rabbitmq.host}")
private String host;
@Value("${spring.rabbitmq.username}")
private String username;
@Value("${spring.rabbitmq.password}")
private String password;
@Value("${spring.rabbitmq.virtualhost}")
private String virtualhost;
/**
*
* @return
*/
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setAddresses(host);
connectionFactory.setUsername(username);
connectionFactory.setPassword(password);
connectionFactory.setVirtualHost(virtualhost);
// 配置发送确认回调时次配置必须配置否则即使在RabbitTemplate配置了ConfirmCallback也不会生效
connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED);
connectionFactory.setPublisherReturns(true);
return connectionFactory;
}
/**
* RabbitAdmin RabbitMQ
* @param connectionFactory
* @return
*/
@Bean
public RabbitAdmin rabbitAdmin(ConnectionFactory connectionFactory) {
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
rabbitAdmin.setAutoStartup(true);
//创建交换机
FanoutExchange dataFanoutExchange = new FanoutExchange(DATA_SOURCE_EXCHANGE, true, true);
//声明交换机
rabbitAdmin.declareExchange(dataFanoutExchange);
return rabbitAdmin;
}
}

View File

@ -1,15 +0,0 @@
package com.etl.data.config;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RabbitmqConfig {
// 消息转换配置
@Bean
public MessageConverter jsonMessageConverter(){
return new Jackson2JsonMessageConverter();
}
}

View File

@ -1,41 +0,0 @@
package com.etl.data.config;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
*
*/
@Component
@Log4j2
public class ReturnCallbackConfig implements RabbitTemplate.ReturnsCallback {
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* @PostContructspringspring
*/
@PostConstruct
public void init() {
rabbitTemplate.setReturnsCallback(this);
}
/**
*
*
* @param returnedMessage the returned message and metadata.
*/
@Override
public void returnedMessage(ReturnedMessage returnedMessage) {
log.error("消息:{},被交换机:{} 回退!退回原因为:{}",
returnedMessage.getMessage().toString(), returnedMessage.getExchange(), returnedMessage.getReplyText());
// TODO 回退了所有的信息,可做补偿机制
}
}

View File

@ -1,56 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.domain.req.AssetAccreditReq;
import com.etl.data.service.AssetAccreditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @ClassName AssetAccreditController
* @Description
* @Author YunFei.Du
* @Date 2024/5/1 15:48
*/
@RestController
@RequestMapping( "/assetAccredit")
public class AssetAccreditController {
@Autowired
private AssetAccreditService assetAccreditService;
/**
* id
*/
@GetMapping(value = "/GetAssetAccreditByDataAssetId")
public Result getAssetAccreditByDataAssetId(@RequestParam("id") Long id)
{
return assetAccreditService.getAssetAccreditByDataAssetId(id);
}
/**
*
*/
@PostMapping()
public Result assetAccredit(@RequestBody AssetAccreditReq assetAccreditReq){
return assetAccreditService.insertAssetAccredit(assetAccreditReq);
}
/**
*
*/
@PostMapping("/DeleteAssetAccreditByAssetIds")
public Result deleteSourceAccreditBySourceIds(@RequestBody AssetAccreditReq assetAccreditReq)
{
return assetAccreditService.deleteAssetAccreditByAssetIds(assetAccreditReq);
}
}

View File

@ -1,27 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.domain.AssetModel;
import com.etl.data.service.AssetModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName AssetModelController
* @Description
* @Author YunFei.Du
* @Date 2024/5/2 9:38
*/
@RestController
@RequestMapping( "/model")
public class AssetModelController {
@Autowired
private AssetModelService assetModelService;
@PostMapping("UpdateAssetModel")
public Result updateAssetModel(AssetModel assetModel) {
return assetModelService.updateAssetModel(assetModel);
}
}

View File

@ -1,22 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.service.DataAssetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName DataAsset
* @Description
* @Author YunFei.Du
* @Date 2024/5/2 9:21
*/
@RestController
@RequestMapping("/asset")
public class DataAssetController {
@Autowired
private DataAssetService dataAssetService;
}

View File

@ -1,153 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.common.core.web.controller.BaseController;
import com.etl.common.core.web.page.TableDataInfo;
import com.etl.data.domain.DataAsset;
import com.etl.data.domain.DataSource;
import com.etl.data.domain.decoration.DataSourceDecoration;
import com.etl.data.domain.req.DataSourceQueryReq;
import com.etl.data.service.DataSourceService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* dataAccess
* @author YunFei.Du
* @date 21:47 2024/4/25
*/
@Log4j2
@RestController
@RequestMapping("/source")
public class DataSourceController extends BaseController {
@Autowired
private DataSourceService dataSourceService;
public static ThreadLocal< String > local = new ThreadLocal<> ( );
/**
*
*/
@PostMapping("/list")
public Result< TableDataInfo<DataSource> > getDataSourceList (@RequestBody DataSourceQueryReq req) {
startPage();
log.info ( "adsghssafghjhghdfsahgh" );
local.set ( "asdf" );
List<DataSource> list = dataSourceService.selectDataSourceList(req);
return getDataAsset (list);
}
@GetMapping("/getList")
public List< DataSourceDecoration > getList () {
List<DataSourceDecoration> list = dataSourceService.getList();
return list;
}
/**
* (/)
* @param dataSource
* @return
*/
@PostMapping("/editDataSource")
public Result editDataSource(@RequestBody DataSource dataSource){
return dataSourceService.editDataSource(dataSource);
}
/**
*
*/
@GetMapping("getDataSourceById")
public Result getDataSourceById(@RequestParam("id") Long id) {
DataSource dataSource = dataSourceService.getById(id);
return Result.success(dataSource);
}
/**
*
* @param id
* @return
*/
@GetMapping("handleDelete/{id}")
public Result handleDeleteByIds(@PathVariable Long id){
return dataSourceService.handleDeleteById(id);
}
/**
*
* @param ids
* @return
*/
@GetMapping("deleteInBulk/{ids}")
public Result deleteInBulk(@PathVariable Long[] ids){
return dataSourceService.deleteInBulk(ids);
}
/**
*
* @param dataSource
* @return
*/
@PostMapping("/TestConnection")
public Result testConnect(@RequestBody DataSource dataSource){
return dataSourceService.testConnect(dataSource)?Result.success():Result.error();
}
/**
// 同步数据
* @param dataSource
* @return
*/
@PostMapping("/SynchronousData")
public Result dataSynchronization(@RequestBody DataSource dataSource){
return dataSourceService.dataSynchronization(dataSource);
}
/**
* id
* @param dataSource
* @return
*/
@PostMapping("/DataAssetList")
public Result<List<DataAsset>> dataAssetListByDataSourceId(@RequestBody DataSource dataSource){
return dataSourceService.dataAssetListByDataSourceId(dataSource);
}
/**
* id
* @param dataAsset
* @return
*/
@PostMapping("/AssetModelList")
public Result assetModelListByDataAssetId(@RequestBody DataAsset dataAsset)
{
return dataSourceService.assetModelListByDataAssetId(dataAsset.getId ());
}
/**
*
* @param dataSource
* @return
*/
@PostMapping("/StructureList")
public Result structureList(@RequestBody DataSource dataSource)
{
return dataSourceService.structureList(dataSource);
}
/**
*
* @return
*/
@GetMapping("/Statistics")
public Result statistics(){
return dataSourceService.statistics();
}
}

View File

@ -1,52 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.domain.Dictionary;
import com.etl.data.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import static com.etl.common.core.domain.Result.success;
/**
* @ClassName DictionaryController
* @Description
* @Author YunFei.Du
* @Date 2024/5/2 9:18
*/
@RestController
@RequestMapping( "/dictionary")
public class DictionaryController {
@Autowired
private DictionaryService dictionaryService;
/**
*
*/
@PostMapping("insert")
public Result insert(Dictionary dictionary){
return dictionaryService.insert(dictionary);
}
/**
* id
*/
@GetMapping(value = "/GetDictionaryList")
public Result getDictionaryList(@RequestParam("dataSourceId") Long dataSourceId){
return dictionaryService.getDictionaryList(dataSourceId);
}
/**
* key
*/
@GetMapping(value = "/DeleteDictionary")
public Result deleteDictionary(@RequestParam("id") Long id){
return dictionaryService.deleteDictionary(id);
}
}

View File

@ -1,35 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.domain.DictionaryInfo;
import com.etl.data.service.DictionaryInfoService;
import com.etl.data.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName DictionaryController
* @Description
* @Author YunFei.Du
* @Date 2024/5/2 9:18
*/
@RestController
@RequestMapping( "/data")
public class DictionaryInfoController {
@Autowired
private DictionaryInfoService dictionaryInfoService;
@PostMapping("/insert")
public Result< DictionaryInfo > insert(@RequestBody DictionaryInfo dictionaryInfo) {
return dictionaryInfoService.save(dictionaryInfo) ? Result.success() : Result.error();
}
@PostMapping("/update")
public Result< DictionaryInfo > update(@RequestBody DictionaryInfo dictionaryInfo) {
return dictionaryInfoService.save(dictionaryInfo) ? Result.success() : Result.error();
}
}

View File

@ -1,53 +0,0 @@
package com.etl.data.controller;
import com.etl.common.core.domain.Result;
import com.etl.data.domain.req.AssetAccreditReq;
import com.etl.data.domain.req.SourceAccreditReq;
import com.etl.data.service.AssetAccreditService;
import com.etl.data.service.SourceAccreditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @ClassName AssetAccreditController
* @Description
* @Author YunFei.Du
* @Date 2024/5/1 15:48
*/
@RestController
@RequestMapping( "/sourceAccredit")
public class SourceAccreditController {
@Autowired
private SourceAccreditService sourceAccreditService;
/**
* id
*/
@GetMapping(value = "/GetSourceAccreditByDataSourceId")
public Result getSourceAccreditByDataSourceId(@RequestParam("id") Long id)
{
return sourceAccreditService.getSourceAccreditByDataSourceId(id);
}
/**
*
*/
@PostMapping("insertSourceAccredit")
public Result insertSourceAccredit(@RequestBody SourceAccreditReq sourceAccreditReq){
return sourceAccreditService.insertSourceAccredit(sourceAccreditReq);
}
/**
*
*/
@PostMapping("/DeleteSourceAccreditBySourceIds")
public Result deleteSourceAccreditBySourceIds(@RequestBody SourceAccreditReq sourceAccreditReq) {
return sourceAccreditService.deleteSourceAccreditBySourceIds(sourceAccreditReq);
}
}

View File

@ -1,13 +0,0 @@
package com.etl.data.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.etl.data.domain.AssetAccredit;
/**
*
* @author YunFei.Du
* @date 15:30 2024/5/1
*/
public interface AssetAccreditMapper extends BaseMapper< AssetAccredit > {
}

View File

@ -1,12 +0,0 @@
package com.etl.data.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.etl.data.domain.AssetModel;
/**
*
* @author YunFei.Du
* @date 10:26 2024/5/1
*/
public interface AssetModelMapper extends BaseMapper<AssetModel> {
}

Some files were not shown because too many files have changed in this diff Show More