Changes
|
@ -0,0 +1,25 @@
|
|||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
logs/
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
.idea
|
||||
*.iml
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.tar.gz
|
||||
*.rar
|
||||
target/
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
|
@ -0,0 +1,9 @@
|
|||
SRT License
|
||||
|
||||
Copyright (c) 2023 天津数睿通科技有限公司
|
||||
|
||||
The data center of Shuruitong 2.0 can be used for learning and communication, and for secondary developers to use in projects, but cannot be modified. After transformation, profits can be made by selling source code
|
||||
The intellectual property rights of the software belong to Tianjin Shuruitong Technology Co., Ltd. Violators will be held legally responsible!
|
||||
|
||||
数睿通 2.0 数据中台可用于学习交流、二开商用于项目之中,但不可经过修改,换化之后通过售卖源码谋利
|
||||
软件知识产权归天津数睿通科技有限公司所有,违者将追究其法律责任!
|
|
@ -0,0 +1,304 @@
|
|||
## 项目说明
|
||||
srt-cloud 是采用 Vue3,Ts,Spring Cloud Alibaba、SpringSecurity、Spring Cloud Gateway、SpringBoot、Nacos、Redis、Mybatis-Plus,Tidb,Flink,Hadoop 等最新技术,开发的全新数睿通数据中台,包含数据集成,数据开发,数据治理,数据资产,数据服务,数据集市六大模块,解决数据孤岛问题,实现数据统一口径标准,自定义数据开发任务,帮助企业,政府等解决数据问题!目前项目正在开发中,会尽快做出一版成型可用的产品。
|
||||
|
||||
## 功能模块说明
|
||||
|
||||
目前全局管理,应用管理,日志管理,系统管理,数据集成,数据开发,数据服务几大模块已基本完毕。
|
||||
|
||||
- 数据集成
|
||||
|
||||
- 数据库管理 — 管理用户添加的数据源,支持 MYSQL/ORACLE/SQLSERVER/POSTGRESQL/GREENPLUM/MARIADB/DB2/DM/OSCAR/KINGBASE8/OSCAR/GBASE8A/HIVE/SQLITE3/SYBASE/DORIS,支持库表查询,测试连接等
|
||||
- 文件管理 — 管理用户上传的文件数据
|
||||
- 数据接入 — 接入外部数据源的数据到中台 **ODS** 层,也可自定义接入目的端数据源,支持一次性全量同步和周期性增量同步;可自定义表名,字段名的映射规则,支持正则表达式匹配;支持查看执行记录及详细执行结果,可查看同步的数据量,数据大小,成功表数量,失败表数量,成功信息,失败信息,也可查看具体每张表同步的数据量,数据大小,错误信息等,帮助用户全面掌握数据接入的执行情况
|
||||
- 贴源数据 — 查看接入到ods层的数据表和数据,可查看每张表的同步记录
|
||||
- 数据开发
|
||||
- 数据生产 — 对数据进行作业代码化编辑,自行 DDL 建模,运行,调试等
|
||||
- 调度中心
|
||||
- 调度管理 — 对生产作业进行流程编辑,可视化调度
|
||||
- 调度记录 — 查看调度结果,日志等
|
||||
- 运维中心 — 对作业执行运维管理
|
||||
- 资源中心
|
||||
- Flink 集群实例 — 管理 FLink 资源
|
||||
- Hadoop 集群配置 — 管理 Hadoop 资源
|
||||
- 配置中心 — 管理 FlinkSql 执行配置
|
||||
- 数据服务
|
||||
- API 目录 — 用户自定义 API 目录,动态生成 API,对外提供服务
|
||||
- API 权限 — 对私有 API 进行授权操作
|
||||
- API 日志 — 查看 API 调用日志
|
||||
- 数据治理
|
||||
- 元数据
|
||||
- 元模型 — 描述元数据的元数据,主要定义了元数据的属性,通常元模型都是系统内置的,如表元模型,字段元模型等
|
||||
- 元数据采集 — 根据定义的元模型对元数据进行采集,通常是每一种元模型有自己内置的采集逻辑,可以设置采集周期等
|
||||
- 元数据管理 — 对采集的元数据进行查看和管理
|
||||
- 数据血缘 — 通过数据接入,数据生产流程之间的关系自动构建数据血缘关系图,追溯数据流向(70%)
|
||||
- 数据标准
|
||||
- 数据质量
|
||||
- 数据资产(70%)
|
||||
- 资源管理 — 自定义资源目录,在每个目录下自定义资源,挂在数据库,api等
|
||||
- 资产总览 — 对中台资源做一个总的统计概览
|
||||
- 数据集市(50%)
|
||||
- 资源目录 — 中台资源目录以及目录下资源的查看,可对资源进行申请操作
|
||||
- API 目录 — 中台 API 目录以及目录下 API 的查看,可对 API 进行申请
|
||||
- 我的申请 — 可以查看自己的申请记录,审批结果
|
||||
- 服务审批 — 管理员对其他角色的申请做出审批,若审批通过,申请人便可以收到审批通过的消息,使用自己申请的服务资源
|
||||
- 全局管理
|
||||
- 数据项目管理 — 中台项目(租户)的管理,每个项目下可以关联用户,用户只能查看自己关联的项目下的数据,选择自己的数据仓库,所有的模块数据都会有所属项目
|
||||
- 数仓分层展示 — 对中台数仓的分成做展示说明
|
||||
- 应用管理
|
||||
- 消息管理
|
||||
- 短信平台 — 集成短信平台,支持阿里,腾讯等常用的短信平台
|
||||
- 短信日志 — 调用短信所产生的日志
|
||||
- 日志管理
|
||||
|
||||
- 登录日志 — 系统登录产生的日志
|
||||
- 系统管理
|
||||
- 用户管理 — 对系统用户进行管理
|
||||
- 菜单管理 — 对系统菜单进行管理,用于实现动态菜单
|
||||
- 定时任务 — 可自定义定时任务,调度执行
|
||||
- 数据字典 — 系统的字典数据
|
||||
- 机构管理 — 机构数据,若各模块中的数据有所属机构概念,可用于数据权限管理
|
||||
- 岗位管理 — 岗位的管理
|
||||
- 角色管理 — 角色管理,可以为每个角色自定义菜单查看权限以及机构级的数据权限
|
||||
- 附件管理 — 系统附件管理,可以上传下载
|
||||
|
||||
## 系统数仓架构
|
||||
|
||||
系统数仓可以在全局项目管理中配置不同租户的数据仓库,在数据集成集成到ods层之后, 可以通过数据生产进行数据开发,数据整体流向图如下:
|
||||
|
||||
###### 
|
||||
|
||||
关于数仓为什么要分层:分层可以有助于数据的管理,同时每次取数只需要获取统计分析过的成品就可以,不需要从源头数据反复计算,避免了计算资源的浪费,通常源头数据量较大,并且中间的处理逻辑较为复杂,所以采用建模分层的方式解决,通常表的前缀都用层级来定义。
|
||||
|
||||
## 系统核心技术栈
|
||||
|
||||
前台:
|
||||
|
||||
- vue3
|
||||
- vite
|
||||
- typeScript
|
||||
- element-plus
|
||||
- pinia
|
||||
- 。。。
|
||||
|
||||
后台:
|
||||
|
||||
- Spring Cloud Alibaba
|
||||
- SpringSecurity
|
||||
- Spring Cloud Gateway
|
||||
- SpringBoot
|
||||
- Nacos
|
||||
- Redis
|
||||
- Mybatis-Plus
|
||||
- mysql8.0
|
||||
- tidb
|
||||
- doris
|
||||
- flink
|
||||
- flink cdc
|
||||
- flink sql
|
||||
- neo4j
|
||||
- 。。。
|
||||
|
||||
## 系统运行方式
|
||||
|
||||
### 下载Nacos
|
||||
|
||||
需要从GitHub下载Nacos,下载地址:https://github.com/alibaba/nacos/releases
|
||||
下载2.1.1版本,因为本项目使用的是Nacos 2.1.1,如果版本号对应不上,后面项目启动会出错。
|
||||
|
||||
### nacos数据库
|
||||
|
||||
注意:Nacos 目前只支持MySQL数据库,请安装MySQL8.0版本,以免出现其他错误。
|
||||
|
||||
新建数据库nacos_config,并运行【conf/nacos-mysql.sql】文件,初始化数据库即可。
|
||||
|
||||
### 修改Nacos的配置文件
|
||||
|
||||
需要在【conf/application.properties】文件末尾,新增如下配置:
|
||||
|
||||
```bash
|
||||
# 填自己的ip地址,本地填127.0.0.1就行
|
||||
nacos.inetutils.ip-address=127.0.0.1
|
||||
|
||||
spring.datasource.platform=mysql
|
||||
db.num=1
|
||||
#填自己的数据库连接和密码
|
||||
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
||||
db.user.0=root
|
||||
db.password.0=root
|
||||
```
|
||||
|
||||
### 启动Nacos
|
||||
|
||||
```bash
|
||||
Windows:
|
||||
startup.cmd -m standalone
|
||||
|
||||
Linux:
|
||||
sh startup.sh -m standalone
|
||||
|
||||
# 集群启动可关注公众号 螺旋编程极客 查看
|
||||
```
|
||||
|
||||
访问Nacos管理界面(http://localhost:8848/nacos) ,初始用户名nacos,密码nacos,登录之后,如下所示:
|
||||
|
||||

|
||||
|
||||
### 创建系统数据库
|
||||
|
||||
创建 `srt_cloud` 数据库,数据库编码为`utf8mb4`
|
||||
执行`db/srt_cloud.sql`文件,初始化数据库脚本
|
||||
|
||||
### 导入Nacos配置文件
|
||||
|
||||
导入Nacos配置文件,配置文件在项目里,文件名为:【deploy/nacos_config.zip】,如下所示:
|
||||
|
||||

|
||||
|
||||
导入配置文件后,还需要在Nacos里,修改datasource.yaml,如:Redis、MySQL信息等。
|
||||
|
||||
### 下载安装 neo4j
|
||||
|
||||
具体参考
|
||||
|
||||
[neo4j安装](https://blog.csdn.net/weixin_44593504/article/details/119903908)
|
||||
|
||||
安装 neo4j-community-3.5.3-unix.tar.gz 版本(相关安装包文件夹里有),否则可能不适配
|
||||
|
||||
### 启动后端
|
||||
|
||||
把系统导入 idea,注意部门 jdbc 驱动包 maven 官方仓库不存在,需要手动在本地 mvn install 一下,jar 包在网盘 jdbc 驱动包自取,导入项目后,右上角 profiles 勾选 flink1.14,多刷新几次,导入完 maven 依赖之后,依次启动:
|
||||
|
||||
#### 启动 srt-cloud-gateway
|
||||
|
||||
运行 GatewayApplication.java
|
||||
|
||||
#### 启动 srt-cloud-system
|
||||
|
||||
运行 SystemApplication.java
|
||||
|
||||
#### 启动 srt-cloud-data-integrate
|
||||
|
||||
运行 DataIntegrateApplication.java
|
||||
|
||||
#### 启动 srt-cloud-data-development
|
||||
|
||||
运行 DataDevelopmentApplication.java
|
||||
|
||||
#### 启动 srt-cloud-data-service
|
||||
|
||||
运行 DataServiceApplication.java
|
||||
|
||||
#### 启动 srt-cloud-data-governance
|
||||
|
||||
运行 DataGovernanceApplication.java
|
||||
|
||||
#### 启动 srt-cloud-data-assets
|
||||
|
||||
运行 DataAssetsApplication.java
|
||||
|
||||
#### 启动 srt-cloud-quartz
|
||||
|
||||
运行 QuartzApplication.java
|
||||
|
||||
#### 启动 srt-cloud-message
|
||||
|
||||
运行 MessageApplication.java
|
||||
|
||||
### 启动前端
|
||||
|
||||
安装版本号为`16.15.0`的`nodejs`,如果已经安装了,请先卸载,推荐使用 nvm 安装 node.js,方便切换不同版本
|
||||
|
||||
1. 需要先把本地安装的`nodejs`卸载,然后再下载nvm,地址:
|
||||
https://github.com/coreybutler/nvm-windows/releases
|
||||
2. 一般情况,找到最新版本,然后下载`nvm-setup.exe`文件就可以了,下载后,我们双击安装即可。
|
||||
3. 我们使用`PowerShell`打开命令行,这里需要注意下,要使用`管理员`身份打开`PowerShell`
|
||||
4. 命令`nvm version` ,可以查看版本号
|
||||
5. 命令`nvm ls available`查看`nodejs`可用的版本
|
||||
6. 命令`nvm install 16.15.0`,可以安装版本号为`16.15.0`的`nodejs`
|
||||
7. 命令`nvm list`,可以查看已安装的版本号
|
||||
8. 命令`nvm use 16.15.0`,可以切换到版本号为`16.15.0`的`nodejs`,现在就可以通过命令`node -v`查看当前的`nodejs`版本号
|
||||
9. 命令`nvm uninstall 16.15.0`,可以卸载版本号为`16.15.0`的`nodejs`
|
||||
|
||||
用 vscode 或 hbuildx 打开 srt-cloud-web
|
||||
|
||||
安装依赖:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
运行项目:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
打包项目
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 系统运行展示
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 帮助支持
|
||||
|
||||
想要了解更多的朋友请关注公众号 **螺旋编程极客** 添加作者微信或在菜单栏加入知识星球,一起进步,一起成长。
|
|
@ -0,0 +1,41 @@
|
|||
<assembly>
|
||||
<id>linux</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/bin</directory>
|
||||
<outputDirectory>${project.artifactId}/bin</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>${project.artifactId}</include>
|
||||
<include>wrapper-linux*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/lib</directory>
|
||||
<outputDirectory>${project.artifactId}/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
<include>libwrapper-linux*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/conf</directory>
|
||||
<outputDirectory>${project.artifactId}/conf</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/logs</directory>
|
||||
<outputDirectory>${project.artifactId}/logs</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
</assembly>
|
|
@ -0,0 +1,40 @@
|
|||
<assembly>
|
||||
<id>win</id>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/bin</directory>
|
||||
<outputDirectory>${project.artifactId}/bin</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>${project.artifactId}.bat</include>
|
||||
<include>wrapper-windows*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/lib</directory>
|
||||
<outputDirectory>${project.artifactId}/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
<include>wrapper-windows*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/conf</directory>
|
||||
<outputDirectory>${project.artifactId}/conf</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target/generated-resources/appassembler/jsw/${project.artifactId}/logs</directory>
|
||||
<outputDirectory>${project.artifactId}/logs</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 115 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 140 KiB |
After Width: | Height: | Size: 194 KiB |
After Width: | Height: | Size: 155 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 97 KiB |
After Width: | Height: | Size: 124 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 145 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 114 KiB |
|
@ -0,0 +1,238 @@
|
|||
<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>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>srt-cloud</name>
|
||||
<description>新一代数睿通数据中台</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.6.11</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>srt-cloud-framework</module>
|
||||
<module>srt-cloud-api</module>
|
||||
<module>srt-cloud-module</module>
|
||||
<module>srt-cloud-data-integrate</module>
|
||||
<module>srt-cloud-system</module>
|
||||
<module>srt-cloud-gateway</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<revision>2.0.0</revision>
|
||||
<skipTests>true</skipTests>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring.cloud.version>2021.0.1</spring.cloud.version>
|
||||
<spring.cloud.alibaba.version>2021.0.1.0</spring.cloud.alibaba.version>
|
||||
<mybatisplus.version>3.5.1</mybatisplus.version>
|
||||
<knife4j.version>3.0.3</knife4j.version>
|
||||
<springdoc.version>1.6.8</springdoc.version>
|
||||
<captcha.version>1.6.2</captcha.version>
|
||||
<mapstruct.version>1.4.2.Final</mapstruct.version>
|
||||
<nacos.version>2.1.1</nacos.version>
|
||||
<hutool.version>5.8.4</hutool.version>
|
||||
<aliyun.oss.version>3.8.0</aliyun.oss.version>
|
||||
<dameng.version>8.1.2.79</dameng.version>
|
||||
<aliyun.dysmsapi.version>2.0.18</aliyun.dysmsapi.version>
|
||||
<tencentcloud.sdk.version>3.1.574</tencentcloud.sdk.version>
|
||||
<qiniu.version>7.11.0</qiniu.version>
|
||||
<minio.version>8.4.3</minio.version>
|
||||
<qcloud.cos.version>5.6.89</qcloud.cos.version>
|
||||
<huaweicloud.obs.version>3.22.3</huaweicloud.obs.version>
|
||||
<oshi.version>6.2.2</oshi.version>
|
||||
|
||||
<mysql-connector-java.version>8.0.16</mysql-connector-java.version>
|
||||
<postgresql.version>42.2.18</postgresql.version>
|
||||
<ojdbc8.version>19.3.0.0</ojdbc8.version>
|
||||
<sqljdbc6.0.version>6.0</sqljdbc6.0.version>
|
||||
<msbase.version>3.0</msbase.version>
|
||||
<msutil.version>3.0</msutil.version>
|
||||
<mssqlserver.version>3.0</mssqlserver.version>
|
||||
<greenplum-jdbc.version>5.1.4</greenplum-jdbc.version>
|
||||
<dm-jdbc.version>1.0.0</dm-jdbc.version>
|
||||
<kingbase-jdbc.version>8.6.0</kingbase-jdbc.version>
|
||||
<hive-jdbc.version>3.1.2</hive-jdbc.version>
|
||||
<sizeof.version>0.4.0</sizeof.version>
|
||||
<json-smart.version>2.3</json-smart.version>
|
||||
<calcite-core.version>1.21.0</calcite-core.version>
|
||||
<calcite-server.version>1.21.0</calcite-server.version>
|
||||
<jsqlparser.version>4.3</jsqlparser.version>
|
||||
<druid-starter-version>1.2.8</druid-starter-version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring.cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>${spring.cloud.alibaba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid-starter-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatisplus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-springdoc-ui</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webmvc-core</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webflux-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.whvcse</groupId>
|
||||
<artifactId>easy-captcha</artifactId>
|
||||
<version>${captcha.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-jdk8</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${mapstruct.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>${aliyun.oss.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver18</artifactId>
|
||||
<version>${dameng.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dysmsapi20170525</artifactId>
|
||||
<version>${aliyun.dysmsapi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||
<version>${tencentcloud.sdk.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qiniu</groupId>
|
||||
<artifactId>qiniu-java-sdk</artifactId>
|
||||
<version>${qiniu.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qcloud</groupId>
|
||||
<artifactId>cos_api</artifactId>
|
||||
<version>${qcloud.cos.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.huaweicloud</groupId>
|
||||
<artifactId>esdk-obs-java-bundle</artifactId>
|
||||
<version>${huaweicloud.obs.version}</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<name>阿里云公共仓库</name>
|
||||
<url>https://maven.aliyun.com/repository/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>阿里云公共仓库</name>
|
||||
<url>https://maven.aliyun.com/repository/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
|
@ -0,0 +1,132 @@
|
|||
<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">
|
||||
<parent>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>srt-cloud-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud-common</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud-dbswitch</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<!--排除依赖,避免api包过大-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jsqlparser</artifactId>
|
||||
<groupId>com.github.jsqlparser</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.oracle.ojdbc</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.oracle.ojdbc</groupId>
|
||||
<artifactId>orai18n</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc6.0</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc6.0</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>msbase</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>msutil</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssqlserver</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.pivotal</groupId>
|
||||
<artifactId>greenplum-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>dm-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.kingbase</groupId>
|
||||
<artifactId>kingbase-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.ibm.db2.jcc</groupId>
|
||||
<artifactId>db2jcc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.hive</groupId>
|
||||
<artifactId>hive-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.sybase</groupId>
|
||||
<artifactId>jconn4</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.oscar</groupId>
|
||||
<artifactId>oscar-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.gbase.jdbc</groupId>
|
||||
<artifactId>gbase-connector-java</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,41 @@
|
|||
package net.srt.api;
|
||||
|
||||
/**
|
||||
* 服务名称集合
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
public interface ServerNames {
|
||||
/**
|
||||
* srt-cloud-gateway 服务名
|
||||
*/
|
||||
String GATEWAY_SERVER_NAME = "srt-cloud-gateway";
|
||||
/**
|
||||
* srt-cloud-system 服务名
|
||||
*/
|
||||
String SYSTEM_SERVER_NAME = "srt-cloud-system";
|
||||
/**
|
||||
* srt-cloud-message 服务名
|
||||
*/
|
||||
String MESSAGE_SERVER_NAME = "srt-cloud-message";
|
||||
|
||||
/**
|
||||
* srt-cloud-quartz 服务名
|
||||
*/
|
||||
String QUARTZ_SERVER_NAME = "srt-cloud-quartz";
|
||||
|
||||
/**
|
||||
* srt-cloud-data-integrate 服务名
|
||||
*/
|
||||
String DATA_INTEGRATE_NAME = "srt-cloud-data-integrate";
|
||||
|
||||
/**
|
||||
* srt-cloud-data-development 服务名
|
||||
*/
|
||||
String DATA_DEVELOPMENT_NAME = "srt-cloud-data-development";
|
||||
|
||||
/**
|
||||
* srt-cloud-data-governance 服务名
|
||||
*/
|
||||
String DATA_GOVERNANCE_NAME = "srt-cloud-data-governance";
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.api.module.data.assets.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 接入方式
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ResourceOpenType {
|
||||
/**
|
||||
* 全部
|
||||
*/
|
||||
ALL(1),
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
ROLE(2),
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
USER(3);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package net.srt.api.module.data.integrate;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessDto;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessTaskDto;
|
||||
import net.srt.api.module.data.integrate.dto.PreviewNameMapperDto;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchResult;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchTableResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApi
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:39
|
||||
*/
|
||||
@FeignClient(name = ServerNames.DATA_INTEGRATE_NAME, contextId = "data-integrate-access")
|
||||
public interface DataAccessApi {
|
||||
/**
|
||||
* 根据id获取
|
||||
*/
|
||||
@GetMapping(value = "api/data/integrate/access/{id}")
|
||||
Result<DataAccessDto> getById(@PathVariable Long id);
|
||||
|
||||
@PostMapping(value = "api/data/integrate/access/task")
|
||||
Result<Long> addTask(@RequestBody DataAccessTaskDto dataAccessTaskDto);
|
||||
|
||||
@PutMapping(value = "api/data/integrate/access/task")
|
||||
void updateTask(@RequestBody DataAccessTaskDto dataAccessTaskDto);
|
||||
|
||||
@PostMapping(value = "api/data/integrate/access/task-detail/{projectId}/{taskId}/{dataAccessId}")
|
||||
void addTaskDetail(@PathVariable Long projectId, @PathVariable Long taskId, @PathVariable Long dataAccessId, @RequestBody DbSwitchTableResult tableResult);
|
||||
|
||||
/**
|
||||
* 根据任务id获取任务
|
||||
*/
|
||||
@GetMapping(value = "api/quartz/access-task/{id}")
|
||||
Result<DataAccessTaskDto> getTaskById(@PathVariable Long id);
|
||||
|
||||
@GetMapping(value = "api/quartz/access-task/table-map/{id}")
|
||||
Result<List<PreviewNameMapperDto>> getTableMap(@PathVariable Long id);
|
||||
|
||||
@GetMapping(value = "api/quartz/access-task/column-map/{id}")
|
||||
Result<List<PreviewNameMapperDto>> getColumnMap(@PathVariable Long id, @RequestParam String tableName);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package net.srt.api.module.data.integrate;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.api.module.data.integrate.dto.DataDatabaseDto;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApi
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:39
|
||||
*/
|
||||
@FeignClient(name = ServerNames.DATA_INTEGRATE_NAME, contextId = "data-integrate-database")
|
||||
public interface DataDatabaseApi {
|
||||
/**
|
||||
* 根据id获取
|
||||
*/
|
||||
@GetMapping(value = "api/data/integrate/database/{id}")
|
||||
Result<DataDatabaseDto> getById(@PathVariable Long id);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package net.srt.api.module.data.integrate;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.api.module.data.integrate.dto.DataOdsDto;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApi
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:39
|
||||
*/
|
||||
@FeignClient(name = ServerNames.DATA_INTEGRATE_NAME, contextId = "data-integrate-ods")
|
||||
public interface DataOdsApi {
|
||||
/**
|
||||
* 添加ods
|
||||
*/
|
||||
@PostMapping(value = "api/data/integrate/ods")
|
||||
Result<String> addOds(@RequestBody DataOdsDto dataOdsDto);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package net.srt.api.module.data.integrate;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.cache.bean.DataProjectCacheBean;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApi
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:39
|
||||
*/
|
||||
@FeignClient(name = ServerNames.DATA_INTEGRATE_NAME, contextId = "data-integrate-project")
|
||||
public interface DataProjectApi {
|
||||
/**
|
||||
* 根据id获取
|
||||
*/
|
||||
@GetMapping(value = "api/data/integrate/project/list-all")
|
||||
Result<List<DataProjectCacheBean>> getProjectList();
|
||||
|
||||
/**
|
||||
* 根据id获取
|
||||
*/
|
||||
@GetMapping(value = "api/data/integrate/project/{id}")
|
||||
Result<DataProjectCacheBean> getById(@PathVariable Long id);
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package net.srt.api.module.data.integrate.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 接入方式
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AccessMode {
|
||||
/**
|
||||
* ods接入
|
||||
*/
|
||||
ODS(1),
|
||||
/**
|
||||
* 自定义接入
|
||||
*/
|
||||
CUSTOM(2);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package net.srt.api.module.data.integrate.constant;
|
||||
|
||||
/**
|
||||
* @ClassName CommonRunStatus
|
||||
* @Author zrx
|
||||
* @Date 2022/5/22 16:15
|
||||
*/
|
||||
public enum CommonRunStatus {
|
||||
|
||||
/**
|
||||
* 等待中
|
||||
*/
|
||||
WAITING(1,"等待中"),
|
||||
/**
|
||||
* 运行中
|
||||
*/
|
||||
RUNNING(2,"运行中"),
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
SUCCESS(3,"正常结束"),
|
||||
|
||||
/**
|
||||
* 异常
|
||||
*/
|
||||
FAILED(4,"异常结束");
|
||||
|
||||
|
||||
private Integer code;
|
||||
private String name;
|
||||
|
||||
CommonRunStatus(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package net.srt.api.module.data.integrate.constant;
|
||||
|
||||
/**
|
||||
* @ClassName TaskType
|
||||
* @Author zrx
|
||||
*/
|
||||
public enum TaskType {
|
||||
|
||||
/**
|
||||
* 实时同步
|
||||
*/
|
||||
REAL_TIME_SYNC(1,"实时同步"),
|
||||
/**
|
||||
* 一次性全量同步
|
||||
*/
|
||||
ONE_TIME_FULL_SYNC(2,"一次性全量同步"),
|
||||
/**
|
||||
* 一次性全量周期性增量
|
||||
*/
|
||||
ONE_TIME_FULL_PERIODIC_INCR_SYNC(3,"一次性全量周期性增量");
|
||||
|
||||
|
||||
private Integer code;
|
||||
private String name;
|
||||
|
||||
TaskType(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package net.srt.api.module.data.integrate.dto;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
import srt.cloud.framework.dbswitch.data.config.DbswichProperties;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据集成-数据接入")
|
||||
public class DataAccessDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "源端数据库id")
|
||||
private Long sourceDatabaseId;
|
||||
|
||||
@Schema(description = "目的端数据库id")
|
||||
private Long targetDatabaseId;
|
||||
|
||||
@Schema(description = "接入方式 1-ods接入 2-自定义接入")
|
||||
private Integer accessMode;
|
||||
|
||||
@Schema(description = "任务类型")
|
||||
private Integer taskType;
|
||||
|
||||
@Schema(description = "cron表达式")
|
||||
private String cron;
|
||||
|
||||
@Schema(description = "发布状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "最新运行状态")
|
||||
private Integer runStatus;
|
||||
|
||||
@Schema(description = "数据接入基础配置json")
|
||||
private DbswichProperties dataAccessJson;
|
||||
|
||||
@Schema(description = "最近开始时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date startTime;
|
||||
|
||||
@Schema(description = "最近结束时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date endTime;
|
||||
|
||||
@Schema(description = "发布时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date releaseTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String note;
|
||||
|
||||
@Schema(description = "发布人id")
|
||||
private Long releaseUserId;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package net.srt.api.module.data.integrate.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据接入任务记录
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-26
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据接入任务记录")
|
||||
public class DataAccessTaskDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据接入任务id")
|
||||
private Long dataAccessId;
|
||||
|
||||
@Schema(description = "运行状态( 1-等待中 2-运行中 3-正常结束 4-异常结束)")
|
||||
private Integer runStatus;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date endTime;
|
||||
|
||||
private String realTimeLog;
|
||||
@Schema(description = "错误信息")
|
||||
private String errorInfo;
|
||||
|
||||
@Schema(description = "更新数据量")
|
||||
private Long dataCount;
|
||||
|
||||
@Schema(description = "成功表数量")
|
||||
private Long tableSuccessCount;
|
||||
|
||||
@Schema(description = "失败表数量")
|
||||
private Long tableFailCount;
|
||||
|
||||
@Schema(description = "更新大小")
|
||||
private String byteCount;
|
||||
|
||||
@Schema(description = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
private Date nextRunTime;
|
||||
|
||||
private Boolean updateTaskAccess;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package net.srt.api.module.data.integrate.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
import srt.cloud.framework.dbswitch.common.type.ProductTypeEnum;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据集成-数据库管理
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-09
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据集成-数据库管理")
|
||||
public class DataDatabaseDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据库类型")
|
||||
private Integer databaseType;
|
||||
|
||||
@Schema(description = "主机ip")
|
||||
private String databaseIp;
|
||||
|
||||
@Schema(description = "端口")
|
||||
private String databasePort;
|
||||
|
||||
@Schema(description = "库名(服务名)")
|
||||
private String databaseName;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "是否支持实时接入")
|
||||
private Integer isRtApprove;
|
||||
|
||||
@Schema(description = "不支持实时接入原因")
|
||||
private String noRtReason;
|
||||
|
||||
@Schema(description = "jdbcUrl")
|
||||
private String jdbcUrl;
|
||||
|
||||
@Schema(description = "所属项目")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package net.srt.api.module.data.integrate.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据集成-贴源数据
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-07
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据集成-贴源数据")
|
||||
public class DataOdsDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "数据接入id")
|
||||
private Long dataAccessId;
|
||||
|
||||
@Schema(description = "表名")
|
||||
private String tableName;
|
||||
|
||||
@Schema(description = "注释")
|
||||
private String remarks;
|
||||
|
||||
@Schema(description = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "最近同步时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date recentlySyncTime;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package net.srt.api.module.data.integrate.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class PreviewNameMapperDto {
|
||||
|
||||
private String originalName;
|
||||
private String targetName;
|
||||
private String remarks;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package net.srt.api.module.message;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 短信服务API
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.MESSAGE_SERVER_NAME)
|
||||
public interface SmsApi {
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param params 参数
|
||||
* @return 是否发送成功
|
||||
*/
|
||||
@PostMapping(value = "api/message/sms/send")
|
||||
Result<Boolean> send(@RequestParam("mobile") String mobile, @RequestParam("params") Map<String, String> params);
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param key 参数KEY
|
||||
* @param value 参数Value
|
||||
* @return 是否发送成功
|
||||
*/
|
||||
@PostMapping(value = "api/message/sms/sendCode")
|
||||
Result<Boolean> sendCode(@RequestParam("mobile") String mobile, @RequestParam("key") String key, @RequestParam("value") String value);
|
||||
|
||||
/**
|
||||
* 效验短信验证码
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param code 验证码
|
||||
* @return 是否效验成功
|
||||
*/
|
||||
@PostMapping(value = "api/message/sms/verifyCode")
|
||||
Result<Boolean> verifyCode(@RequestParam("mobile") String mobile, @RequestParam("code") String code);
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* RPC 接口声明,如:Feign接口
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
package net.srt.api.module;
|
|
@ -0,0 +1,35 @@
|
|||
package net.srt.api.module.quartz;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入 定时api
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.QUARTZ_SERVER_NAME, contextId = "quartz-data-integrate-access")
|
||||
public interface QuartzDataAccessApi {
|
||||
|
||||
/**
|
||||
* 发布数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/access/release/{id}")
|
||||
Result<String> releaseAccess(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 取消数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/access/cancle/{id}")
|
||||
Result<String> cancleAccess(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 手动执行
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/access/hand-run/{id}")
|
||||
Result<String> handRun(@PathVariable Long id);
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package net.srt.api.module.quartz;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入 定时api
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.QUARTZ_SERVER_NAME, contextId = "quartz-data-metadata-collect")
|
||||
public interface QuartzDataGovernanceMetadataCollectApi {
|
||||
|
||||
/**
|
||||
* 发布数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/metadata-collect/release/{id}")
|
||||
Result<String> release(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 取消数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/metadata-collect/cancel/{id}")
|
||||
Result<String> cancel(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 手动执行
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/metadata-collect/hand-run/{id}")
|
||||
Result<String> handRun(@PathVariable Long id);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package net.srt.api.module.quartz;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入 定时api
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.QUARTZ_SERVER_NAME, contextId = "quartz-data-quality")
|
||||
public interface QuartzDataGovernanceQualityApi {
|
||||
|
||||
/**
|
||||
* 发布数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/quality/release/{id}")
|
||||
Result<String> release(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 取消数据接入任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/quality/cancel/{id}")
|
||||
Result<String> cancel(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 手动执行
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/quality/hand-run/{id}")
|
||||
Result<String> handRun(@PathVariable Long id);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package net.srt.api.module.quartz;
|
||||
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入 定时api
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.QUARTZ_SERVER_NAME, contextId = "quartz-data-development-production-schedule")
|
||||
public interface QuartzDataProductionScheduleApi {
|
||||
|
||||
/**
|
||||
* 发布作业调度任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/development-schedule/release/{id}")
|
||||
Result<String> release(@PathVariable Long id);
|
||||
|
||||
/**
|
||||
* 取消作业调度任务
|
||||
*/
|
||||
@PostMapping(value = "api/quartz/development-schedule/cancle/{id}")
|
||||
Result<String> cancle(@PathVariable Long id);
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package net.srt.api.module.quartz.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @ClassName QuartzJobType
|
||||
* @Author zrx
|
||||
* @Date 2023/1/19 15:24
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum QuartzJobType {
|
||||
/**
|
||||
* 自定义
|
||||
*/
|
||||
CUSTOM(1),
|
||||
/**
|
||||
* 数据接入
|
||||
*/
|
||||
DATA_ACCESS(2),
|
||||
/**
|
||||
* 数据生产
|
||||
*/
|
||||
DATA_PRODUCTION(3),
|
||||
|
||||
/**
|
||||
* 数据治理
|
||||
*/
|
||||
DATA_GOVERNANCE(4),
|
||||
|
||||
/**
|
||||
* 数据质量
|
||||
*/
|
||||
DATA_QUALITY(5);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package net.srt.api.module.system;
|
||||
|
||||
import feign.codec.Encoder;
|
||||
import feign.form.spring.SpringFormEncoder;
|
||||
import net.srt.api.ServerNames;
|
||||
import net.srt.api.module.system.dto.StorageDTO;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@FeignClient(name = ServerNames.SYSTEM_SERVER_NAME)
|
||||
public interface StorageApi {
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*/
|
||||
@PostMapping(value = "api/storage/upload", produces = {MediaType.APPLICATION_JSON_VALUE},
|
||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
Result<StorageDTO> upload(@RequestPart("file") MultipartFile file) throws IOException;
|
||||
|
||||
class MultipartSupportConfig {
|
||||
@Bean
|
||||
public Encoder feignFormEncoder() {
|
||||
return new SpringFormEncoder();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.api.module.system.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 超级管理员枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SuperAdminEnum {
|
||||
YES(1),
|
||||
NO(0);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package net.srt.api.module.system.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @author 阿沐 babamu@126.com
|
||||
*/
|
||||
@Data
|
||||
@Tag(name="文件上传")
|
||||
public class StorageDTO {
|
||||
@Schema(description = "URL")
|
||||
private String url;
|
||||
@Schema(description = "文件大小")
|
||||
private Long size;
|
||||
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
<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">
|
||||
<parent>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>srt-cloud-data-integrate</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<!--使用log42j-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud-mybatis</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.srt</groupId>
|
||||
<artifactId>srt-cloud-dbswitch</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jsqlparser</artifactId>
|
||||
<groupId>com.github.jsqlparser</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-springdoc-ui</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!--<finalName>${project.artifactId}</finalName>-->
|
||||
<!--生成可执行文件 linux,win系统,win首次执行需要先 app.bat install-->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>appassembler-maven-plugin</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<!-- 如果不配置 generate-daemons,则打包命令为 mvn clean package appassembler:assemble -->
|
||||
<!-- 如果配置了 generate-daemons,打包命令可以是 mvn clean package 也可以是 mvn clean package appassembler:assemble -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-jsw-scripts</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>generate-daemons</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
<configuration>
|
||||
<!-- flat与lib共同决定将项目用的的所有jar包复制到lib目录下 -->
|
||||
<repositoryLayout>flat</repositoryLayout>
|
||||
<!--从哪里copy配置文件-->
|
||||
<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
|
||||
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
|
||||
<!--是否copy配置文件-->
|
||||
<copyConfigurationDirectory>true</copyConfigurationDirectory>
|
||||
<!--配置文件存放在conf目录路径-->
|
||||
<configurationDirectory>conf</configurationDirectory>
|
||||
<!-- 打包的jar,以及maven依赖的jar放到这个目录里面 -->
|
||||
<repositoryName>lib</repositoryName>
|
||||
<!-- 可执行脚本的目录 -->
|
||||
<binFolder>bin</binFolder>
|
||||
<encoding>UTF-8</encoding>
|
||||
<logsDirectory>logs</logsDirectory>
|
||||
|
||||
<daemons>
|
||||
<daemon>
|
||||
<id>${project.artifactId}</id>
|
||||
<mainClass>net.srt.DataIntegrateApplication</mainClass>
|
||||
<platforms>
|
||||
<platform>jsw</platform>
|
||||
</platforms>
|
||||
<generatorConfigurations>
|
||||
<generatorConfiguration>
|
||||
<generator>jsw</generator>
|
||||
<includes>
|
||||
<include>linux-x86-32</include>
|
||||
<include>linux-x86-64</include>
|
||||
<include>windows-x86-32</include>
|
||||
<include>windows-x86-64</include>
|
||||
</includes>
|
||||
<configuration>
|
||||
<property>
|
||||
<name>configuration.directory.in.classpath.first</name>
|
||||
<value>conf</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>wrapper.ping.timeout</name>
|
||||
<value>120</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>set.default.REPO_DIR</name>
|
||||
<value>lib</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>wrapper.logfile</name>
|
||||
<value>logs/wrapper.log</value>
|
||||
</property>
|
||||
</configuration>
|
||||
</generatorConfiguration>
|
||||
</generatorConfigurations>
|
||||
<jvmSettings>
|
||||
<!-- jvm参数 -->
|
||||
<!--<systemProperties>
|
||||
<systemProperty>com.sun.management.jmxremote</systemProperty>
|
||||
<systemProperty>com.sun.management.jmxremote.port=1984</systemProperty>
|
||||
<systemProperty>com.sun.management.jmxremote.authenticate=false</systemProperty>
|
||||
<systemProperty>com.sun.management.jmxremote.ssl=false</systemProperty>
|
||||
</systemProperties>-->
|
||||
<extraArguments>
|
||||
<extraArgument>-server</extraArgument>
|
||||
<extraArgument>-Dfile.encoding=utf-8</extraArgument>
|
||||
<extraArgument>-Xms128m</extraArgument>
|
||||
<extraArgument>-Xmx1024m</extraArgument>
|
||||
<extraArgument>-XX:+PrintGCDetails</extraArgument><!--输出GC的详细日志-->
|
||||
<extraArgument>-XX:+PrintGCDateStamps</extraArgument><!--输出GC的时间戳-->
|
||||
<extraArgument>-Xloggc:logs/gc.log</extraArgument><!--日志文件的输出路径-->
|
||||
</extraArguments>
|
||||
</jvmSettings>
|
||||
</daemon>
|
||||
</daemons>
|
||||
<programs>
|
||||
<program>
|
||||
<mainClass>net.srt.DataIntegrateApplication</mainClass>
|
||||
<id>${project.artifactId}</id>
|
||||
</program>
|
||||
</programs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!--打包 日常调试打包可以把该组件注释掉,不然install的速度比较慢-->
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${project.parent.basedir}/assembly/assembly-win.xml</descriptor>
|
||||
<descriptor>${project.parent.basedir}/assembly/assembly-linux.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,22 @@
|
|||
package net.srt;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* 数据集成微服务
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
*/
|
||||
@EnableFeignClients
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class DataIntegrateApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DataIntegrateApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package net.srt.api;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.srt.api.module.data.integrate.DataAccessApi;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessDto;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessTaskDto;
|
||||
import net.srt.api.module.data.integrate.dto.PreviewNameMapperDto;
|
||||
import net.srt.constants.YesOrNo;
|
||||
import net.srt.convert.DataAccessConvert;
|
||||
import net.srt.convert.DataAccessTaskConvert;
|
||||
import net.srt.entity.DataAccessEntity;
|
||||
import net.srt.entity.DataAccessTaskDetailEntity;
|
||||
import net.srt.entity.DataAccessTaskEntity;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.service.DataAccessService;
|
||||
import net.srt.service.DataAccessTaskDetailService;
|
||||
import net.srt.service.DataAccessTaskService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchResult;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchTableResult;
|
||||
import srt.cloud.framework.dbswitch.data.util.BytesUnitUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApiImpl
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:50
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class DataAccessApiImpl implements DataAccessApi {
|
||||
|
||||
private final DataAccessService dataAccessService;
|
||||
private final DataAccessTaskService dataAccessTaskService;
|
||||
private final DataAccessTaskDetailService dataAccessTaskDetailService;
|
||||
|
||||
@Override
|
||||
public Result<DataAccessDto> getById(Long id) {
|
||||
DataAccessEntity dataAccessEntity = dataAccessService.loadById(id);
|
||||
return Result.ok(DataAccessConvert.INSTANCE.convertDto(dataAccessEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Long> addTask(DataAccessTaskDto dataAccessTaskDto) {
|
||||
DataAccessTaskEntity dataAccessTaskEntity = DataAccessTaskConvert.INSTANCE.convertByDto(dataAccessTaskDto);
|
||||
dataAccessTaskService.save(dataAccessTaskEntity);
|
||||
//更新任务的最新开始时间和状态
|
||||
dataAccessService.updateStartInfo(dataAccessTaskDto.getDataAccessId());
|
||||
return Result.ok(dataAccessTaskEntity.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTask(DataAccessTaskDto dataAccessTaskDto) {
|
||||
DataAccessTaskEntity dataAccessTaskEntity = DataAccessTaskConvert.INSTANCE.convertByDto(dataAccessTaskDto);
|
||||
dataAccessTaskService.updateById(dataAccessTaskEntity);
|
||||
//更新任务的最新结束时间和状态
|
||||
if (dataAccessTaskDto.getUpdateTaskAccess()) {
|
||||
dataAccessService.updateEndInfo(dataAccessTaskDto.getDataAccessId(), dataAccessTaskDto.getRunStatus(), dataAccessTaskDto.getNextRunTime());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTaskDetail(Long projectId, Long taskId, Long dataAccessId, DbSwitchTableResult tableResult) {
|
||||
dataAccessTaskDetailService.save(DataAccessTaskDetailEntity.builder().projectId(projectId).taskId(taskId).dataAccessId(dataAccessId)
|
||||
.sourceSchemaName(tableResult.getSourceSchemaName()).sourceTableName(tableResult.getSourceTableName())
|
||||
.targetSchemaName(tableResult.getTargetSchemaName()).targetTableName(tableResult.getTargetTableName())
|
||||
.ifSuccess(tableResult.getIfSuccess().get() ? YesOrNo.YES.getValue() : YesOrNo.NO.getValue())
|
||||
.syncCount(tableResult.getSyncCount().get()).syncBytes(BytesUnitUtils.bytesSizeToHuman(tableResult.getSyncBytes().get()))
|
||||
.createTime(new Date()).errorMsg(tableResult.getErrorMsg()).successMsg(tableResult.getSuccessMsg()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<DataAccessTaskDto> getTaskById(Long id) {
|
||||
return Result.ok(DataAccessTaskConvert.INSTANCE.convertDto(dataAccessTaskService.getById(id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<PreviewNameMapperDto>> getTableMap(Long id) {
|
||||
List<PreviewNameMapperDto> previewNameMapperDtos = dataAccessService.getTableMap(id);
|
||||
return Result.ok(previewNameMapperDtos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<PreviewNameMapperDto>> getColumnMap(Long id, String tableName) {
|
||||
List<PreviewNameMapperDto> previewNameMapperDtos = dataAccessService.getColumnMap(id, tableName);
|
||||
return Result.ok(previewNameMapperDtos);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package net.srt.api;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.srt.api.module.data.integrate.DataDatabaseApi;
|
||||
import net.srt.api.module.data.integrate.DataOdsApi;
|
||||
import net.srt.api.module.data.integrate.dto.DataDatabaseDto;
|
||||
import net.srt.api.module.data.integrate.dto.DataOdsDto;
|
||||
import net.srt.convert.DataDatabaseConvert;
|
||||
import net.srt.convert.DataOdsConvert;
|
||||
import net.srt.entity.DataOdsEntity;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.service.DataDatabaseService;
|
||||
import net.srt.service.DataOdsService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName DataDatabaseApiImpl
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:50
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class DataDatabaseApiImpl implements DataDatabaseApi {
|
||||
|
||||
private final DataDatabaseService databaseService;
|
||||
|
||||
@Override
|
||||
public Result<DataDatabaseDto> getById(Long id) {
|
||||
return Result.ok(DataDatabaseConvert.INSTANCE.convertDto(databaseService.getById(id)));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package net.srt.api;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.srt.api.module.data.integrate.DataAccessApi;
|
||||
import net.srt.api.module.data.integrate.DataOdsApi;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessDto;
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessTaskDto;
|
||||
import net.srt.api.module.data.integrate.dto.DataOdsDto;
|
||||
import net.srt.constants.YesOrNo;
|
||||
import net.srt.convert.DataAccessConvert;
|
||||
import net.srt.convert.DataAccessTaskConvert;
|
||||
import net.srt.convert.DataOdsConvert;
|
||||
import net.srt.entity.DataAccessEntity;
|
||||
import net.srt.entity.DataAccessTaskDetailEntity;
|
||||
import net.srt.entity.DataAccessTaskEntity;
|
||||
import net.srt.entity.DataOdsEntity;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.service.DataAccessService;
|
||||
import net.srt.service.DataAccessTaskDetailService;
|
||||
import net.srt.service.DataAccessTaskService;
|
||||
import net.srt.service.DataOdsService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchResult;
|
||||
import srt.cloud.framework.dbswitch.data.domain.DbSwitchTableResult;
|
||||
import srt.cloud.framework.dbswitch.data.util.BytesUnitUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApiImpl
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:50
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class DataOdsApiImpl implements DataOdsApi {
|
||||
|
||||
private final DataOdsService dataOdsService;
|
||||
|
||||
@Override
|
||||
public Result<String> addOds(DataOdsDto dataOdsDto) {
|
||||
DataOdsEntity dataOdsEntity = dataOdsService.getByTableName(dataOdsDto.getProjectId(), dataOdsDto.getTableName());
|
||||
if (dataOdsEntity == null) {
|
||||
dataOdsService.save(DataOdsConvert.INSTANCE.convertByDto(dataOdsDto));
|
||||
} else {
|
||||
dataOdsDto.setId(dataOdsEntity.getId());
|
||||
dataOdsService.updateById(DataOdsConvert.INSTANCE.convertByDto(dataOdsDto));
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package net.srt.api;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.srt.api.module.data.integrate.DataProjectApi;
|
||||
import net.srt.entity.DataProjectEntity;
|
||||
import net.srt.framework.common.cache.bean.DataProjectCacheBean;
|
||||
import net.srt.framework.common.utils.BeanUtil;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.service.DataProjectService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName DataAccessApiImpl
|
||||
* @Author zrx
|
||||
* @Date 2022/10/26 11:50
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class DataProjectApiImpl implements DataProjectApi {
|
||||
|
||||
private final DataProjectService dataProjectService;
|
||||
|
||||
|
||||
@Override
|
||||
public Result<List<DataProjectCacheBean>> getProjectList() {
|
||||
List<DataProjectEntity> list = dataProjectService.list();
|
||||
return Result.ok(BeanUtil.copyListProperties(list, DataProjectCacheBean::new));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<DataProjectCacheBean> getById(Long id) {
|
||||
return Result.ok(BeanUtil.copyProperties(dataProjectService.getById(id), DataProjectCacheBean::new));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package net.srt.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 接入方式
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AccessMode {
|
||||
/**
|
||||
* ods接入
|
||||
*/
|
||||
ODS(1),
|
||||
/**
|
||||
* 自定义接入
|
||||
*/
|
||||
CUSTOM(2);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package net.srt.constants;
|
||||
|
||||
/**
|
||||
* @ClassName CommonRunStatus
|
||||
* @Author zrx
|
||||
* @Date 2022/5/22 16:15
|
||||
*/
|
||||
public enum CommonRunStatus {
|
||||
|
||||
/**
|
||||
* 等待中
|
||||
*/
|
||||
WAITING(1,"等待中"),
|
||||
/**
|
||||
* 运行中
|
||||
*/
|
||||
RUNNING(2,"运行中"),
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
SUCCESS(3,"正常结束"),
|
||||
|
||||
/**
|
||||
* 异常
|
||||
*/
|
||||
FAILED(4,"异常结束");
|
||||
|
||||
|
||||
private Integer code;
|
||||
private String name;
|
||||
|
||||
CommonRunStatus(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package net.srt.constants;
|
||||
|
||||
/**
|
||||
* @ClassName DataHouseLayer
|
||||
* @Author zrx
|
||||
* @Date 2022/5/20 14:58
|
||||
*/
|
||||
public enum DataHouseLayer {
|
||||
|
||||
|
||||
/**
|
||||
* ODS
|
||||
*/
|
||||
ODS("数据引入层","ods_"),
|
||||
/**
|
||||
* DWD
|
||||
*/
|
||||
DWD("明细数据层","dwd_"),
|
||||
/**
|
||||
* DIM
|
||||
*/
|
||||
DIM("维度层","dim_"),
|
||||
/**
|
||||
* DWS
|
||||
*/
|
||||
DWS("汇总数据层","dws_"),
|
||||
/**
|
||||
* 应用数据层
|
||||
*/
|
||||
ADS("应用数据层","ads_"),
|
||||
|
||||
/**
|
||||
* OTHER
|
||||
*/
|
||||
OTHER("其他数据","");
|
||||
|
||||
private String name;
|
||||
private String tablePrefix;
|
||||
|
||||
DataHouseLayer(String name,String tablePrefix) {
|
||||
this.name = name;
|
||||
this.tablePrefix = tablePrefix;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getTablePrefix() {
|
||||
return tablePrefix;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 接入方式
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MiddleTreeNodeType {
|
||||
/**
|
||||
* DB
|
||||
*/
|
||||
DB(1),
|
||||
/**
|
||||
* LAYER
|
||||
*/
|
||||
LAYER(2),
|
||||
/**
|
||||
* TABLE
|
||||
*/
|
||||
TABLE(3);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 超级管理员枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SuperAdminEnum {
|
||||
YES(1),
|
||||
NO(0);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 超级管理员枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum YesOrNo {
|
||||
YES(1),
|
||||
NO(0);
|
||||
|
||||
private final Integer value;
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.dto.DataAccessClientDto;
|
||||
import net.srt.dto.PreviewMapDto;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.query.DataAccessQuery;
|
||||
import net.srt.query.DataAccessTaskDetailQuery;
|
||||
import net.srt.query.DataAccessTaskQuery;
|
||||
import net.srt.service.DataAccessService;
|
||||
import net.srt.vo.DataAccessTaskDetailVO;
|
||||
import net.srt.vo.DataAccessTaskVO;
|
||||
import net.srt.vo.DataAccessVO;
|
||||
import net.srt.vo.PreviewNameMapperVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("access")
|
||||
@Tag(name = "数据集成-数据接入")
|
||||
@AllArgsConstructor
|
||||
public class DataAccessController {
|
||||
private final DataAccessService dataAccessService;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:page')")
|
||||
public Result<PageResult<DataAccessVO>> page(@Valid DataAccessQuery query) {
|
||||
PageResult<DataAccessVO> page = dataAccessService.page(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:info')")
|
||||
public Result<DataAccessClientDto> get(@PathVariable("id") Long id) {
|
||||
return Result.ok(dataAccessService.getById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:save')")
|
||||
public Result<String> save(@RequestBody DataAccessClientDto dto) {
|
||||
dataAccessService.save(dto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:update')")
|
||||
public Result<String> update(@RequestBody DataAccessClientDto dto) {
|
||||
dataAccessService.update(dto);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:delete')")
|
||||
public Result<String> delete(@RequestBody List<Long> idList) {
|
||||
dataAccessService.delete(idList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("preview-table-name-map")
|
||||
@Operation(summary = "预览表名映射")
|
||||
public Result<List<PreviewNameMapperVo>> previewTableMap(@RequestBody PreviewMapDto previewMapDto) {
|
||||
return Result.ok(dataAccessService.previewTableMap(previewMapDto));
|
||||
}
|
||||
|
||||
@PostMapping("preview-column-name-map")
|
||||
@Operation(summary = "预览字段名映射")
|
||||
public Result<List<PreviewNameMapperVo>> previewColumnMap(@RequestBody PreviewMapDto previewMapDto) {
|
||||
return Result.ok(dataAccessService.previewColumnMap(previewMapDto));
|
||||
}
|
||||
|
||||
@PostMapping("release/{id}")
|
||||
@Operation(summary = "发布任务")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:release')")
|
||||
public Result<String> release(@PathVariable Long id) {
|
||||
dataAccessService.release(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("cancle/{id}")
|
||||
@Operation(summary = "取消任务")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:cancle')")
|
||||
public Result<String> cancle(@PathVariable Long id) {
|
||||
dataAccessService.cancle(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("hand-run/{id}")
|
||||
@Operation(summary = "手动调度执行")
|
||||
@PreAuthorize("hasAuthority('data-integrate:access:selfhandler')")
|
||||
public Result<String> handRun(@PathVariable Long id) {
|
||||
dataAccessService.handRun(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@GetMapping("task-page")
|
||||
@Operation(summary = "获取调度记录")
|
||||
public Result<PageResult<DataAccessTaskVO>> taskPage(DataAccessTaskQuery taskQuery) {
|
||||
PageResult<DataAccessTaskVO> pageResult = dataAccessService.taskPage(taskQuery);
|
||||
return Result.ok(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("task/{id}")
|
||||
@Operation(summary = "获取调度任务")
|
||||
public Result<DataAccessTaskVO> getTaskById(@PathVariable Long id) {
|
||||
return Result.ok(dataAccessService.getTaskById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("task")
|
||||
@Operation(summary = "删除调度记录")
|
||||
public Result<String> deleteTask(@RequestBody List<Long> idList) {
|
||||
dataAccessService.deleteTask(idList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@GetMapping("task-detail-page")
|
||||
@Operation(summary = "获取同步结果")
|
||||
public Result<PageResult<DataAccessTaskDetailVO>> taskDetailPage(DataAccessTaskDetailQuery detailQuery) {
|
||||
PageResult<DataAccessTaskDetailVO> pageResult = dataAccessService.taskDetailPage(detailQuery);
|
||||
return Result.ok(pageResult);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.DataDatabaseConvert;
|
||||
import net.srt.dto.SqlConsole;
|
||||
import net.srt.entity.DataAccessEntity;
|
||||
import net.srt.entity.DataDatabaseEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.framework.common.utils.TreeNodeVo;
|
||||
import net.srt.query.DataDatabaseQuery;
|
||||
import net.srt.service.DataAccessService;
|
||||
import net.srt.service.DataDatabaseService;
|
||||
import net.srt.vo.ColumnDescriptionVo;
|
||||
import net.srt.vo.DataDatabaseVO;
|
||||
import net.srt.vo.SchemaTableDataVo;
|
||||
import net.srt.vo.SqlGenerationVo;
|
||||
import net.srt.vo.TableVo;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-数据库管理
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("database")
|
||||
@Tag(name = "数据集成-数据库管理")
|
||||
@AllArgsConstructor
|
||||
public class DataDatabaseController {
|
||||
private final DataDatabaseService dataDatabaseService;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
@PreAuthorize("hasAuthority('data-integrate:database:page')")
|
||||
public Result<PageResult<DataDatabaseVO>> page(@Valid DataDatabaseQuery query) {
|
||||
PageResult<DataDatabaseVO> page = dataDatabaseService.page(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('data-integrate:database:info')")
|
||||
public Result<DataDatabaseVO> get(@PathVariable("id") Long id) {
|
||||
DataDatabaseEntity entity = dataDatabaseService.getById(id);
|
||||
|
||||
return Result.ok(DataDatabaseConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:database:save')")
|
||||
public Result<String> save(@RequestBody DataDatabaseVO vo) {
|
||||
dataDatabaseService.save(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:database:update')")
|
||||
public Result<String> update(@RequestBody @Valid DataDatabaseVO vo) {
|
||||
dataDatabaseService.update(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:database:delete')")
|
||||
public Result<String> delete(@RequestBody List<Long> idList) {
|
||||
dataDatabaseService.delete(idList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/test-online")
|
||||
@Operation(summary = "测试连接")
|
||||
public Result<String> testOnline(@RequestBody @Valid DataDatabaseVO vo) {
|
||||
dataDatabaseService.testOnline(vo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/tables/{id}")
|
||||
@Operation(summary = "根据数据库id获取表相关信息")
|
||||
public Result<List<TableVo>> getTablesById(@PathVariable Long id) {
|
||||
List<TableVo> tableVos = dataDatabaseService.getTablesById(id);
|
||||
return Result.ok(tableVos);
|
||||
}
|
||||
|
||||
@PostMapping("/table-data/{id}")
|
||||
@Operation(summary = "根据sql获取数据")
|
||||
public Result<SchemaTableDataVo> getTableDataBySql(@PathVariable Integer id, @RequestBody SqlConsole sqlConsole) {
|
||||
SchemaTableDataVo schemaTableDataVo = dataDatabaseService.getTableDataBySql(id, sqlConsole);
|
||||
return Result.ok(schemaTableDataVo);
|
||||
}
|
||||
|
||||
@GetMapping("/list-all")
|
||||
@Operation(summary = "获取当前用户所能看到的的数据表")
|
||||
public Result<List<DataDatabaseVO>> listAll() {
|
||||
List<DataDatabaseVO> list = dataDatabaseService.listAll();
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list-tree/{id}")
|
||||
@Operation(summary = "获取库目录树")
|
||||
public Result<List<TreeNodeVo>> listTree(@PathVariable Long id) {
|
||||
List<TreeNodeVo> list = dataDatabaseService.listTree(id);
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/middle-db/list-tree")
|
||||
@Operation(summary = "获取中台库(当前项目)目录树")
|
||||
public Result<List<TreeNodeVo>> listMiddleDbTree() {
|
||||
List<TreeNodeVo> list = dataDatabaseService.listMiddleDbTree();
|
||||
return Result.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/{tableName}/columns")
|
||||
@Operation(summary = "获取字段信息")
|
||||
public Result<List<ColumnDescriptionVo>> columnInfo(@PathVariable Long id, @PathVariable String tableName) {
|
||||
return Result.ok(dataDatabaseService.getColumnInfo(id, tableName));
|
||||
}
|
||||
|
||||
@GetMapping("/middle-db/{tableName}/columns")
|
||||
@Operation(summary = "获取中台库字段信息")
|
||||
public Result<List<ColumnDescriptionVo>> middleDbClumnInfo(@PathVariable String tableName) {
|
||||
return Result.ok(dataDatabaseService.middleDbClumnInfo(tableName));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/{tableName}/sql-generation")
|
||||
@Operation(summary = "获取sql信息")
|
||||
public Result<SqlGenerationVo> getSqlGeneration(@PathVariable Long id, @PathVariable String tableName, String tableRemarks) {
|
||||
return Result.ok(dataDatabaseService.getSqlGeneration(id, tableName, tableRemarks));
|
||||
}
|
||||
|
||||
@GetMapping("/middle-db/{tableName}/sql-generation")
|
||||
@Operation(summary = "获取中台库sql信息")
|
||||
public Result<SqlGenerationVo> getMiddleDbSqlGeneration(@PathVariable String tableName, String tableRemarks) {
|
||||
return Result.ok(dataDatabaseService.getMiddleDbSqlGeneration(tableName, tableRemarks));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.entity.DataFileCategoryEntity;
|
||||
import net.srt.framework.common.utils.BeanUtil;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.framework.common.utils.TreeNodeVo;
|
||||
import net.srt.service.DataFileCategoryService;
|
||||
import net.srt.vo.DataFileCategoryVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件分组表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("fileCategory")
|
||||
@Tag(name = "文件分组表")
|
||||
@AllArgsConstructor
|
||||
public class DataFileCategoryController {
|
||||
private final DataFileCategoryService dataFileCategoryService;
|
||||
|
||||
@GetMapping
|
||||
@Operation(summary = "查询文件分组树")
|
||||
public Result<List<TreeNodeVo>> listTree() {
|
||||
return Result.ok(dataFileCategoryService.listTree());
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "根据id获取")
|
||||
public Result<TreeNodeVo> getById(@PathVariable Integer id) {
|
||||
DataFileCategoryEntity entity = dataFileCategoryService.getById(id);
|
||||
TreeNodeVo nodeVo = BeanUtil.copyProperties(entity, TreeNodeVo::new);
|
||||
nodeVo.setLabel(entity.getName());
|
||||
nodeVo.setParentPath(entity.getPath().contains("/") ? entity.getPath().substring(0, entity.getPath().lastIndexOf("/")) : null);
|
||||
return Result.ok(nodeVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:fileCategory:save')")
|
||||
public Result<String> save(@RequestBody DataFileCategoryVO vo) {
|
||||
dataFileCategoryService.save(vo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:fileCategory:update')")
|
||||
public Result<String> update(@RequestBody @Valid DataFileCategoryVO vo) {
|
||||
dataFileCategoryService.update(vo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:fileCategory:delete')")
|
||||
public Result<String> delete(Long id) {
|
||||
dataFileCategoryService.delete(id);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.DataFileConvert;
|
||||
import net.srt.entity.DataFileEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.service.DataFileService;
|
||||
import net.srt.query.DataFileQuery;
|
||||
import net.srt.vo.DataFileVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("file")
|
||||
@Tag(name="文件表")
|
||||
@AllArgsConstructor
|
||||
public class DataFileController {
|
||||
private final DataFileService dataFileService;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
@PreAuthorize("hasAuthority('data-integrate:file:page')")
|
||||
public Result<PageResult<DataFileVO>> page(@Valid DataFileQuery query){
|
||||
PageResult<DataFileVO> page = dataFileService.page(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("page-resource")
|
||||
@Operation(summary = "根据resourceId分页获取")
|
||||
public Result<PageResult<DataFileVO>> pageResource(@Valid DataFileQuery query){
|
||||
PageResult<DataFileVO> page = dataFileService.pageResource(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('data-integrate:file:info')")
|
||||
public Result<DataFileVO> get(@PathVariable("id") Long id){
|
||||
DataFileEntity entity = dataFileService.getById(id);
|
||||
|
||||
return Result.ok(DataFileConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:file:save')")
|
||||
public Result<String> save(@RequestBody DataFileVO vo){
|
||||
dataFileService.save(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:file:update')")
|
||||
public Result<String> update(@RequestBody @Valid DataFileVO vo){
|
||||
dataFileService.update(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:file:delete')")
|
||||
public Result<String> delete(@RequestBody List<Long> idList){
|
||||
dataFileService.delete(idList);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.DataLayerConvert;
|
||||
import net.srt.entity.DataLayerEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.query.DataLayerQuery;
|
||||
import net.srt.service.DataLayerService;
|
||||
import net.srt.vo.DataLayerVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 数仓分层
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("layer")
|
||||
@Tag(name="数仓分层")
|
||||
@AllArgsConstructor
|
||||
public class DataLayerController {
|
||||
private final DataLayerService dataLayerService;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
@PreAuthorize("hasAuthority('data-integrate:layer:page')")
|
||||
public Result<PageResult<DataLayerVO>> page(@Valid DataLayerQuery query){
|
||||
PageResult<DataLayerVO> page = dataLayerService.page(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('data-integrate:layer:info')")
|
||||
public Result<DataLayerVO> get(@PathVariable("id") Long id){
|
||||
DataLayerEntity entity = dataLayerService.getById(id);
|
||||
|
||||
return Result.ok(DataLayerConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
/*@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:layer:save')")
|
||||
public Result<String> save(@RequestBody DataLayerVO vo){
|
||||
dataLayerService.save(vo);
|
||||
|
||||
return Result.ok();
|
||||
}*/
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:layer:update')")
|
||||
public Result<String> update(@RequestBody @Valid DataLayerVO vo){
|
||||
dataLayerService.update(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/*@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:layer:delete')")
|
||||
public Result<String> delete(@RequestBody List<Long> idList){
|
||||
dataLayerService.delete(idList);
|
||||
|
||||
return Result.ok();
|
||||
}*/
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.DataOdsConvert;
|
||||
import net.srt.dto.SqlConsole;
|
||||
import net.srt.entity.DataOdsEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.query.DataOdsQuery;
|
||||
import net.srt.service.DataOdsService;
|
||||
import net.srt.vo.ColumnDescriptionVo;
|
||||
import net.srt.vo.DataOdsVO;
|
||||
import net.srt.vo.SchemaTableDataVo;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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;
|
||||
import srt.cloud.framework.dbswitch.core.model.ColumnDescription;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-贴源数据
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("ods")
|
||||
@Tag(name = "数据集成-贴源数据")
|
||||
@AllArgsConstructor
|
||||
public class DataOdsController {
|
||||
private final DataOdsService dataOdsService;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
public Result<PageResult<DataOdsVO>> page(@Valid DataOdsQuery query) {
|
||||
PageResult<DataOdsVO> page = dataOdsService.page(query);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
public Result<DataOdsVO> get(@PathVariable("id") Long id) {
|
||||
DataOdsEntity entity = dataOdsService.getById(id);
|
||||
|
||||
return Result.ok(DataOdsConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/{tableName}/column-info")
|
||||
@Operation(summary = "获取字段信息")
|
||||
public Result<List<ColumnDescriptionVo>> columnInfo(@PathVariable Long id, @PathVariable String tableName) {
|
||||
return Result.ok(dataOdsService.getColumnInfo(id, tableName));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/{tableName}/table-data")
|
||||
@Operation(summary = "获取表数据")
|
||||
public Result<SchemaTableDataVo> getTableData(@PathVariable Long id, @PathVariable String tableName) {
|
||||
return Result.ok(dataOdsService.getTableData(id, tableName));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
public Result<String> delete(@RequestBody List<Long> idList) {
|
||||
dataOdsService.delete(idList);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.DataProjectConvert;
|
||||
import net.srt.entity.DataProjectEntity;
|
||||
import net.srt.framework.common.cache.RedisCache;
|
||||
import net.srt.framework.common.cache.RedisKeys;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.framework.security.cache.TokenStoreCache;
|
||||
import net.srt.framework.security.utils.TokenUtils;
|
||||
import net.srt.query.DataProjectQuery;
|
||||
import net.srt.service.DataProjectService;
|
||||
import net.srt.vo.DataDatabaseVO;
|
||||
import net.srt.vo.DataProjectVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据项目
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-09-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("project")
|
||||
@Tag(name = "数据项目")
|
||||
@AllArgsConstructor
|
||||
public class DataProjectController {
|
||||
private final DataProjectService dataProjectService;
|
||||
private final TokenStoreCache storeCache;
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:page')")
|
||||
public Result<PageResult<DataProjectVO>> page(@Valid DataProjectQuery query) {
|
||||
PageResult<DataProjectVO> page = dataProjectService.page(query);
|
||||
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:info')")
|
||||
public Result<DataProjectVO> get(@PathVariable("id") Long id) {
|
||||
DataProjectEntity entity = dataProjectService.getById(id);
|
||||
|
||||
return Result.ok(DataProjectConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:save')")
|
||||
public Result<String> save(@RequestBody DataProjectVO vo) {
|
||||
dataProjectService.save(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:update')")
|
||||
public Result<String> update(@RequestBody @Valid DataProjectVO vo) {
|
||||
dataProjectService.update(vo);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:delete')")
|
||||
public Result<String> delete(@RequestBody List<Long> idList) {
|
||||
dataProjectService.delete(idList);
|
||||
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("adduser/{projectId}")
|
||||
@Operation(summary = "添加成员")
|
||||
@PreAuthorize("hasAuthority('data-integrate:project:adduser')")
|
||||
public Result<String> addUser(@PathVariable Long projectId, @RequestBody List<Long> userIds) {
|
||||
dataProjectService.addUser(projectId, userIds);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/current-user-projects")
|
||||
@Operation(summary = "获取当前用户拥有的项目")
|
||||
public Result<List<DataProjectVO>> listProjects() {
|
||||
return Result.ok(dataProjectService.listProjects());
|
||||
}
|
||||
|
||||
@PutMapping("/change-project/{projectId}")
|
||||
@Operation(summary = "切换项目(租户)")
|
||||
public Result<String> changeProject(@PathVariable Long projectId, HttpServletRequest request) {
|
||||
String accessToken = TokenUtils.getAccessToken(request);
|
||||
//把当前用户的租户id存储到redis缓存中,24小时过期
|
||||
storeCache.saveProjectId(accessToken, projectId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/test-online")
|
||||
@Operation(summary = "测试连接")
|
||||
public Result<String> testOnline(@RequestBody @Valid DataProjectVO vo) {
|
||||
dataProjectService.testOnline(vo);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessDto;
|
||||
import net.srt.entity.DataAccessEntity;
|
||||
import net.srt.vo.DataAccessVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessConvert {
|
||||
DataAccessConvert INSTANCE = Mappers.getMapper(DataAccessConvert.class);
|
||||
|
||||
DataAccessEntity convert(DataAccessVO vo);
|
||||
|
||||
DataAccessVO convert(DataAccessEntity entity);
|
||||
|
||||
DataAccessDto convertDto(DataAccessEntity entity);
|
||||
|
||||
List<DataAccessVO> convertList(List<DataAccessEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.api.module.data.integrate.dto.DataAccessTaskDto;
|
||||
import net.srt.entity.DataAccessTaskEntity;
|
||||
import net.srt.vo.DataAccessTaskVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据接入任务记录
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessTaskConvert {
|
||||
DataAccessTaskConvert INSTANCE = Mappers.getMapper(DataAccessTaskConvert.class);
|
||||
|
||||
DataAccessTaskEntity convert(DataAccessTaskVO vo);
|
||||
|
||||
DataAccessTaskEntity convertByDto(DataAccessTaskDto dto);
|
||||
|
||||
DataAccessTaskVO convert(DataAccessTaskEntity entity);
|
||||
|
||||
DataAccessTaskDto convertDto(DataAccessTaskEntity entity);
|
||||
|
||||
List<DataAccessTaskVO> convertList(List<DataAccessTaskEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataAccessTaskDetailEntity;
|
||||
import net.srt.vo.DataAccessTaskDetailVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据接入-同步记录详情
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-28
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessTaskDetailConvert {
|
||||
DataAccessTaskDetailConvert INSTANCE = Mappers.getMapper(DataAccessTaskDetailConvert.class);
|
||||
|
||||
DataAccessTaskDetailEntity convert(DataAccessTaskDetailVO vo);
|
||||
|
||||
DataAccessTaskDetailVO convert(DataAccessTaskDetailEntity entity);
|
||||
|
||||
List<DataAccessTaskDetailVO> convertList(List<DataAccessTaskDetailEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.api.module.data.integrate.dto.DataDatabaseDto;
|
||||
import net.srt.entity.DataDatabaseEntity;
|
||||
import net.srt.vo.DataDatabaseVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-数据库管理
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataDatabaseConvert {
|
||||
DataDatabaseConvert INSTANCE = Mappers.getMapper(DataDatabaseConvert.class);
|
||||
|
||||
DataDatabaseEntity convert(DataDatabaseVO vo);
|
||||
|
||||
DataDatabaseVO convert(DataDatabaseEntity entity);
|
||||
|
||||
DataDatabaseDto convertDto(DataDatabaseEntity entity);
|
||||
|
||||
List<DataDatabaseVO> convertList(List<DataDatabaseEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataFileCategoryEntity;
|
||||
import net.srt.vo.DataFileCategoryVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件分组表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataFileCategoryConvert {
|
||||
DataFileCategoryConvert INSTANCE = Mappers.getMapper(DataFileCategoryConvert.class);
|
||||
|
||||
DataFileCategoryEntity convert(DataFileCategoryVO vo);
|
||||
|
||||
DataFileCategoryVO convert(DataFileCategoryEntity entity);
|
||||
|
||||
List<DataFileCategoryVO> convertList(List<DataFileCategoryEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataFileEntity;
|
||||
import net.srt.vo.DataFileVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataFileConvert {
|
||||
DataFileConvert INSTANCE = Mappers.getMapper(DataFileConvert.class);
|
||||
|
||||
DataFileEntity convert(DataFileVO vo);
|
||||
|
||||
DataFileVO convert(DataFileEntity entity);
|
||||
|
||||
List<DataFileVO> convertList(List<DataFileEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataLayerEntity;
|
||||
import net.srt.vo.DataLayerVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数仓分层
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataLayerConvert {
|
||||
DataLayerConvert INSTANCE = Mappers.getMapper(DataLayerConvert.class);
|
||||
|
||||
DataLayerEntity convert(DataLayerVO vo);
|
||||
|
||||
DataLayerVO convert(DataLayerEntity entity);
|
||||
|
||||
List<DataLayerVO> convertList(List<DataLayerEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.api.module.data.integrate.dto.DataOdsDto;
|
||||
import net.srt.entity.DataOdsEntity;
|
||||
import net.srt.vo.DataOdsVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据集成-贴源数据
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataOdsConvert {
|
||||
DataOdsConvert INSTANCE = Mappers.getMapper(DataOdsConvert.class);
|
||||
|
||||
DataOdsEntity convert(DataOdsVO vo);
|
||||
|
||||
DataOdsEntity convertByDto(DataOdsDto dto);
|
||||
|
||||
DataOdsVO convert(DataOdsEntity entity);
|
||||
|
||||
List<DataOdsVO> convertList(List<DataOdsEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataProjectEntity;
|
||||
import net.srt.vo.DataProjectVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据项目
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataProjectConvert {
|
||||
DataProjectConvert INSTANCE = Mappers.getMapper(DataProjectConvert.class);
|
||||
|
||||
DataProjectEntity convert(DataProjectVO vo);
|
||||
|
||||
DataProjectVO convert(DataProjectEntity entity);
|
||||
|
||||
List<DataProjectVO> convertList(List<DataProjectEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.entity.DataProjectUserRelEntity;
|
||||
import net.srt.vo.DataProjectUserRelVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目用户关联表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-08
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataProjectUserRelConvert {
|
||||
DataProjectUserRelConvert INSTANCE = Mappers.getMapper(DataProjectUserRelConvert.class);
|
||||
|
||||
DataProjectUserRelEntity convert(DataProjectUserRelVO vo);
|
||||
|
||||
DataProjectUserRelVO convert(DataProjectUserRelEntity entity);
|
||||
|
||||
List<DataProjectUserRelVO> convertList(List<DataProjectUserRelEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.DataAccessEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据集成-数据接入
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessDao extends BaseDao<DataAccessEntity> {
|
||||
|
||||
void updateStartInfo(@Param("dataAccessId") Long dataAccessId);
|
||||
|
||||
void updateEndInfo(@Param("dataAccessId")Long dataAccessId, @Param("runStatus") Integer runStatus, @Param("nextRunTime") Date nextRunTime);
|
||||
|
||||
void changeStatus(@Param("id") Long id, @Param("status") Integer status, @Param("releaseTime") Date releaseTime, @Param("releaseUserId") Long releaseUserId);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.DataAccessTaskEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 数据接入任务记录
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessTaskDao extends BaseDao<DataAccessTaskEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.DataAccessTaskDetailEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 数据接入-同步记录详情
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-28
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataAccessTaskDetailDao extends BaseDao<DataAccessTaskDetailEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.DataDatabaseEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 数据集成-数据库管理
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-10-09
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataDatabaseDao extends BaseDao<DataDatabaseEntity> {
|
||||
|
||||
void changeStatusById(@Param("id") Long id, @Param("status") Integer status);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.DataFileCategoryEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 文件分组表
|
||||
*
|
||||
* @author zrx 985134801@qq.com
|
||||
* @since 1.0.0 2022-11-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface DataFileCategoryDao extends BaseDao<DataFileCategoryEntity> {
|
||||
|
||||
}
|