From 45e58636e15c6aad78c7520b1e22cafc54a97f27 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Wed, 8 Jan 2025 20:12:50 +0800 Subject: [PATCH 01/19] refactor(metadata): refactoring the way to obtain the database --- client/datacap-cli/pom.xml | 2 +- configure/etc/bin/install-plugin.bat | 2 +- configure/etc/bin/install-plugin.sh | 2 +- configure/etc/conf/application.properties | 2 +- configure/metadata.json | 402 +++++----- configure/schema/2025.1.0/schema.sql | 10 + convert/datacap-convert-csv/pom.xml | 2 +- convert/datacap-convert-json/pom.xml | 2 +- convert/datacap-convert-none/pom.xml | 2 +- convert/datacap-convert-spi/pom.xml | 2 +- convert/datacap-convert-txt/pom.xml | 2 +- convert/datacap-convert-xml/pom.xml | 2 +- core/datacap-captcha/pom.xml | 2 +- core/datacap-common/pom.xml | 2 +- core/datacap-condor/pom.xml | 2 +- core/datacap-parser/pom.xml | 2 +- core/datacap-plugin/pom.xml | 2 +- core/datacap-security/pom.xml | 2 +- core/datacap-server/pom.xml | 2 +- .../server/controller/ColumnController.java | 34 - .../server/controller/DatabaseController.java | 34 - .../server/controller/MetadataController.java | 27 + .../server/controller/SourceController.java | 7 - .../server/controller/TableController.java | 71 -- .../admin/TemplateSqlController.java | 60 -- .../datacap/server/runner/ScheduleRunner.java | 10 - core/datacap-service/pom.xml | 2 +- .../datacap/service/entity/ColumnEntity.java | 97 --- .../service/entity/DatabaseEntity.java | 56 -- .../datacap/service/entity/SourceEntity.java | 4 - .../datacap/service/entity/TableEntity.java | 124 --- .../service/entity/TemplateEntity.java | 55 -- .../repository/TemplateSqlRepository.java | 14 - .../repository/metadata/ColumnRepository.java | 24 - .../metadata/DatabaseRepository.java | 13 - .../repository/metadata/TableRepository.java | 32 - .../service/service/ColumnService.java | 18 - .../service/service/DatabaseService.java | 18 - .../service/service/MetadataService.java | 9 + .../service/service/SourceService.java | 2 - .../datacap/service/service/TableService.java | 46 -- .../service/service/TemplateSqlService.java | 18 - .../service/impl/ColumnServiceImpl.java | 32 - .../service/impl/DatabaseServiceImpl.java | 32 - .../service/impl/MetadataServiceImpl.java | 40 + .../service/impl/SourceServiceImpl.java | 471 +---------- .../service/impl/TableServiceImpl.java | 735 ------------------ .../service/impl/TemplateSqlServiceImpl.java | 176 ----- .../source/SyncMetadataScheduledRunnable.java | 177 ----- core/datacap-spi/pom.xml | 2 +- .../io/edurt/datacap/spi/PluginService.java | 83 ++ core/datacap-sql/pom.xml | 2 +- core/datacap-ui/package.json | 2 +- core/datacap-ui/src/services/column.ts | 27 - core/datacap-ui/src/services/database.ts | 27 - core/datacap-ui/src/services/metadata.ts | 21 + core/datacap-ui/src/services/table.ts | 77 -- .../views/components/tree/MetadataTree.vue | 2 +- .../metadata/components/MetadataSidebar.vue | 15 +- .../src/views/pages/admin/query/QueryHome.vue | 2 +- .../pages/admin/source/SourceDatabase.vue | 2 +- .../admin/source/components/ColumnChange.vue | 2 - .../admin/source/components/ColumnCreate.vue | 1 - .../admin/source/components/ColumnDrop.vue | 1 - .../admin/source/components/TableCreate.vue | 1 - .../admin/source/components/TableDrop.vue | 1 - .../admin/source/components/TableExport.vue | 1 - .../admin/source/components/TableTruncate.vue | 1 - docs/docs/api/metadata/database.md | 41 + docs/mkdocs.yml | 4 + driver/datacap-driver-mongo/pom.xml | 2 +- driver/datacap-driver-mongodb/pom.xml | 2 +- driver/datacap-driver-redis/pom.xml | 2 +- executor/datacap-executor-local/pom.xml | 2 +- executor/datacap-executor-seatunnel/pom.xml | 2 +- executor/datacap-executor-spi/pom.xml | 2 +- fs/datacap-fs-alioss/pom.xml | 2 +- fs/datacap-fs-amazon-s3/pom.xml | 2 +- fs/datacap-fs-local/pom.xml | 2 +- fs/datacap-fs-minio/pom.xml | 2 +- fs/datacap-fs-qiniu/pom.xml | 2 +- fs/datacap-fs-spi/pom.xml | 2 +- fs/datacap-fs-tencent-cos/pom.xml | 2 +- lib/datacap-http/pom.xml | 2 +- lib/datacap-logger/pom.xml | 2 +- lib/datacap-schedule/pom.xml | 2 +- lib/datacap-shell/pom.xml | 2 +- notify/datacap-notify-dingtalk/pom.xml | 2 +- notify/datacap-notify-spi/pom.xml | 2 +- parser/datacap-parser-mysql/pom.xml | 2 +- parser/datacap-parser-spi/pom.xml | 2 +- parser/datacap-parser-trino/pom.xml | 2 +- plugin/datacap-plugin-alioss/pom.xml | 2 +- plugin/datacap-plugin-cassandra/pom.xml | 2 +- plugin/datacap-plugin-ceresdb/pom.xml | 2 +- plugin/datacap-plugin-clickhouse-http/pom.xml | 2 +- plugin/datacap-plugin-clickhouse/pom.xml | 2 +- plugin/datacap-plugin-cratedb-http/pom.xml | 2 +- plugin/datacap-plugin-cratedb/pom.xml | 2 +- plugin/datacap-plugin-db2/pom.xml | 2 +- plugin/datacap-plugin-dm/pom.xml | 2 +- plugin/datacap-plugin-doris/pom.xml | 2 +- plugin/datacap-plugin-dremio/pom.xml | 2 +- plugin/datacap-plugin-druid/pom.xml | 2 +- plugin/datacap-plugin-duckdb/pom.xml | 2 +- .../datacap-plugin-elasticsearch-8x/pom.xml | 2 +- plugin/datacap-plugin-greptimedb/pom.xml | 2 +- plugin/datacap-plugin-h2-tcp/pom.xml | 2 +- plugin/datacap-plugin-h2/pom.xml | 2 +- plugin/datacap-plugin-hdfs/pom.xml | 2 +- plugin/datacap-plugin-hive-2x/pom.xml | 2 +- plugin/datacap-plugin-hologres/pom.xml | 2 +- plugin/datacap-plugin-ignite/pom.xml | 2 +- plugin/datacap-plugin-impala/pom.xml | 2 +- plugin/datacap-plugin-influxdb/pom.xml | 2 +- plugin/datacap-plugin-iotdb/pom.xml | 2 +- plugin/datacap-plugin-kafka/pom.xml | 2 +- plugin/datacap-plugin-kylin/pom.xml | 2 +- plugin/datacap-plugin-kyuubi/pom.xml | 2 +- plugin/datacap-plugin-matrixone/pom.xml | 2 +- plugin/datacap-plugin-monetdb/pom.xml | 2 +- plugin/datacap-plugin-mongo-atlas/pom.xml | 2 +- plugin/datacap-plugin-mongo-community/pom.xml | 2 +- plugin/datacap-plugin-mysql/pom.xml | 2 +- plugin/datacap-plugin-neo4j/pom.xml | 2 +- plugin/datacap-plugin-oceanbase/pom.xml | 2 +- plugin/datacap-plugin-oracle/pom.xml | 2 +- plugin/datacap-plugin-paradedb/pom.xml | 2 +- plugin/datacap-plugin-phoenix/pom.xml | 2 +- plugin/datacap-plugin-pinot/pom.xml | 2 +- plugin/datacap-plugin-postgresql/pom.xml | 2 +- plugin/datacap-plugin-presto/pom.xml | 2 +- plugin/datacap-plugin-questdb/pom.xml | 2 +- plugin/datacap-plugin-redis-jdbc/pom.xml | 2 +- plugin/datacap-plugin-redis/pom.xml | 2 +- plugin/datacap-plugin-scylladb/pom.xml | 2 +- plugin/datacap-plugin-snowflake/pom.xml | 2 +- plugin/datacap-plugin-solr/pom.xml | 2 +- plugin/datacap-plugin-sqlserver/pom.xml | 2 +- plugin/datacap-plugin-starrocks/pom.xml | 2 +- plugin/datacap-plugin-tdengine/pom.xml | 2 +- plugin/datacap-plugin-timescale/pom.xml | 2 +- plugin/datacap-plugin-trino/pom.xml | 2 +- plugin/datacap-plugin-ydb/pom.xml | 2 +- plugin/datacap-plugin-zookeeper/pom.xml | 2 +- pom.xml | 2 +- scheduler/datacap-scheduler-local/pom.xml | 2 +- scheduler/datacap-scheduler-spi/pom.xml | 2 +- shaded/datacap-shaded-neo4j/pom.xml | 2 +- shaded/datacap-shaded-pinot/pom.xml | 2 +- shaded/datacap-shaded-ydb/pom.xml | 2 +- test/datacap-test-condor/pom.xml | 2 +- test/datacap-test-convert/pom.xml | 2 +- test/datacap-test-core/pom.xml | 2 +- test/datacap-test-driver/pom.xml | 2 +- test/datacap-test-executor/pom.xml | 2 +- test/datacap-test-fs/pom.xml | 2 +- test/datacap-test-lib/pom.xml | 2 +- test/datacap-test-parser/pom.xml | 2 +- test/datacap-test-plugin/pom.xml | 2 +- test/datacap-test-scheduler/pom.xml | 2 +- 161 files changed, 564 insertions(+), 2817 deletions(-) create mode 100644 configure/schema/2025.1.0/schema.sql delete mode 100644 core/datacap-server/src/main/java/io/edurt/datacap/server/controller/ColumnController.java delete mode 100644 core/datacap-server/src/main/java/io/edurt/datacap/server/controller/DatabaseController.java create mode 100644 core/datacap-server/src/main/java/io/edurt/datacap/server/controller/MetadataController.java delete mode 100644 core/datacap-server/src/main/java/io/edurt/datacap/server/controller/TableController.java delete mode 100644 core/datacap-server/src/main/java/io/edurt/datacap/server/controller/admin/TemplateSqlController.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/entity/ColumnEntity.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/entity/DatabaseEntity.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TableEntity.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TemplateEntity.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/repository/TemplateSqlRepository.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/ColumnRepository.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/DatabaseRepository.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/TableRepository.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/ColumnService.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/DatabaseService.java create mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/MetadataService.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/TableService.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/TemplateSqlService.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/ColumnServiceImpl.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DatabaseServiceImpl.java create mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/MetadataServiceImpl.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TableServiceImpl.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TemplateSqlServiceImpl.java delete mode 100644 core/datacap-service/src/main/java/io/edurt/datacap/service/source/SyncMetadataScheduledRunnable.java delete mode 100644 core/datacap-ui/src/services/column.ts delete mode 100644 core/datacap-ui/src/services/database.ts create mode 100644 core/datacap-ui/src/services/metadata.ts delete mode 100644 core/datacap-ui/src/services/table.ts create mode 100644 docs/docs/api/metadata/database.md diff --git a/client/datacap-cli/pom.xml b/client/datacap-cli/pom.xml index a613c625bd..1e5f0a31ff 100644 --- a/client/datacap-cli/pom.xml +++ b/client/datacap-cli/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/configure/etc/bin/install-plugin.bat b/configure/etc/bin/install-plugin.bat index 7d786c80d9..5014599eb0 100644 --- a/configure/etc/bin/install-plugin.bat +++ b/configure/etc/bin/install-plugin.bat @@ -1,7 +1,7 @@ @echo off setlocal EnableDelayedExpansion set "HOME=%cd%" -set "VERSION=2024.4.1 +set "VERSION=2025.1.0 set "CDN_CENTER=https://repo1.maven.org/maven2/io/edurt/datacap" :: 检查并创建临时目录 diff --git a/configure/etc/bin/install-plugin.sh b/configure/etc/bin/install-plugin.sh index 7fb4fc0913..a1d41967f8 100644 --- a/configure/etc/bin/install-plugin.sh +++ b/configure/etc/bin/install-plugin.sh @@ -1,7 +1,7 @@ #!/bin/sh HOME=$(pwd) -VERSION=2024.4.1 +VERSION=2025.1.0 CDN_CENTER="https://repo1.maven.org/maven2/io/edurt/datacap" install_package() { diff --git a/configure/etc/conf/application.properties b/configure/etc/conf/application.properties index be0b54e23f..018dc0bad4 100644 --- a/configure/etc/conf/application.properties +++ b/configure/etc/conf/application.properties @@ -1,5 +1,5 @@ ################################### Banner configure ################################# -app.version=2024.4.1 +app.version=2025.1.0 ################################### Basic configure ################################# server.port=9096 diff --git a/configure/metadata.json b/configure/metadata.json index 1c373bf072..eeb40a0487 100644 --- a/configure/metadata.json +++ b/configure/metadata.json @@ -10,15 +10,15 @@ "description": "A powerful MySQL integration plugin that provides comprehensive database connectivity. Features include table/view management, data import/export, SQL query execution, stored procedure support, and real-time data synchronization. Optimized for high-performance data operations with connection pooling and batch processing capabilities.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/mysql.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "8.0", "5.7" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mysql/2024.4.1/datacap-plugin-mysql-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mysql/2025.1.0/datacap-plugin-mysql-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-clickhouse", @@ -26,14 +26,14 @@ "description": "ClickHouse is a distributed column-oriented database. It is a distributed database with a focus on performance, scalability, and ease of use.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/clickhouse.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-clickhouse/2024.4.1/datacap-plugin-clickhouse-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-clickhouse/2025.1.0/datacap-plugin-clickhouse-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-influxdb", @@ -41,14 +41,14 @@ "description": "InfluxDB is a time series database that stores and retrieves data points. It is a distributed database with a focus on performance, scalability, and ease of use.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/influxdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-influxdb/2024.4.1/datacap-plugin-influxdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-influxdb/2025.1.0/datacap-plugin-influxdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-solr", @@ -56,14 +56,14 @@ "description": "Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/solr.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-solr/2024.4.1/datacap-plugin-solr-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-solr/2025.1.0/datacap-plugin-solr-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-cratedb", @@ -71,14 +71,14 @@ "description": "CrateDB is a hyper-fast database for real-time analytics and hybrid search. It handles multiple types of data and combines the simplicity of SQL with the scalability of a distributed architecture.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/cratedb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cratedb/2024.4.1/datacap-plugin-cratedb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cratedb/2025.1.0/datacap-plugin-cratedb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-cratedb-http", @@ -86,14 +86,14 @@ "description": "Use HTTP to access the remote CrateDB database", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/cratedbhttp.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cratedb-http/2024.4.1/datacap-plugin-cratedb-http-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cratedb-http/2025.1.0/datacap-plugin-cratedb-http-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-zookeeper", @@ -101,14 +101,14 @@ "description": "Zookeeper is a distributed, distributed configuration service. It is a distributed database with a focus on performance, scalability, and ease of use.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/zookeeper.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-zookeeper/2024.4.1/datacap-plugin-zookeeper-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-zookeeper/2025.1.0/datacap-plugin-zookeeper-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-kafka", @@ -116,14 +116,14 @@ "description": "Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/kafka.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kafka/2024.4.1/datacap-plugin-kafka-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kafka/2025.1.0/datacap-plugin-kafka-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-redis", @@ -131,14 +131,14 @@ "description": "Redis is an in-memory data store used by millions of developers as a cache, vector database, document database, streaming engine, and message broker. Redis has built-in replication and different levels of on-disk persistence. It supports complex data types (for example, strings, hashes, lists, sets, sorted sets, and JSON), with atomic operations defined on those data types.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/redis.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-redis/2024.4.1/datacap-plugin-redis-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-redis/2025.1.0/datacap-plugin-redis-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-h2", @@ -146,14 +146,14 @@ "description": "H2 is a small, fast, and easy-to-use in-memory database.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/h2.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-h2/2024.4.1/datacap-plugin-h2-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-h2/2025.1.0/datacap-plugin-h2-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-db2", @@ -161,14 +161,14 @@ "description": "IBM® Db2® is the cloud-native database built to power low-latency transactions, real-time analytics and AI applications at scale.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/db2.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-db2/2024.4.1/datacap-plugin-db2-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-db2/2025.1.0/datacap-plugin-db2-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-dm", @@ -176,14 +176,14 @@ "description": "A professional database software developer and service provider, we provide users with technically advanced and detailed products.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/dm.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-dm/2024.4.1/datacap-plugin-dm-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-dm/2025.1.0/datacap-plugin-dm-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-hdfs", @@ -191,14 +191,14 @@ "description": "Hadoop Distributed File System (HDFS) is a distributed file system based on the Hadoop project.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/hdfs.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hdfs/2024.4.1/datacap-plugin-hdfs-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hdfs/2025.1.0/datacap-plugin-hdfs-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-alioss", @@ -206,14 +206,14 @@ "description": "Ali OSS is a cloud storage service that provides a simple, secure and efficient way to store and manage data.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/alioss.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-alioss/2024.4.1/datacap-plugin-alioss-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-alioss/2025.1.0/datacap-plugin-alioss-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-dremio", @@ -221,14 +221,14 @@ "description": "Dremio is a free, open source, distributed data platform.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/dremio.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-dremio/2024.4.1/datacap-plugin-dremio-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-dremio/2025.1.0/datacap-plugin-dremio-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-druid", @@ -236,14 +236,14 @@ "description": "A high performance, real-time analytics database that delivers sub-second queries on streaming and batch data at scale and under load.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/druid.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-druid/2024.4.1/datacap-plugin-druid-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-druid/2025.1.0/datacap-plugin-druid-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-duckdb", @@ -251,14 +251,14 @@ "description": "To use DuckDB, you must first create a connection to a database. The exact syntax varies between the client APIs but it typically involves passing an argument to configure persistence.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/duckdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-duckdb/2024.4.1/datacap-plugin-duckdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-duckdb/2025.1.0/datacap-plugin-duckdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-pinot", @@ -266,14 +266,14 @@ "description": "Apache Pinot is a real-time distributed OLAP datastore, built to deliver scalable real-time analytics with low latency. It can ingest from batch data sources (such as Hadoop HDFS, Amazon S3, Azure ADLS, Google Cloud Storage) as well as stream data sources (such as Apache Kafka).", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/pinot.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-pinot/2024.4.1/datacap-plugin-pinot-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-pinot/2025.1.0/datacap-plugin-pinot-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-cassandra", @@ -281,14 +281,14 @@ "description": "Cassandra is a distributed key-value store for the cloud.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/cassandra.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cassandra/2024.4.1/datacap-plugin-cassandra-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-cassandra/2025.1.0/datacap-plugin-cassandra-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-matrixone", @@ -296,14 +296,14 @@ "description": "MatrixOne is a hyper-converged cloud & edge native distributed database with a structure that separates storage, computation, and transactions to form a consolidated HSTAP data engine. This engine enables a single database system to accommodate diverse business loads such as OLTP, OLAP, and stream computing. It also supports deployment and utilization across public, private, and edge clouds, ensuring compatibility with diverse infrastructures.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/matrixone.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-matrixone/2024.4.1/datacap-plugin-matrixone-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-matrixone/2025.1.0/datacap-plugin-matrixone-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-scylladb", @@ -311,14 +311,14 @@ "description": "ScyllaDB is a distributed database written in C++ and designed to fully exploit modern cloud infrastructure. It utilizes a shard-per-core architecture, meaning each CPU core has dedicated resources that independently handle data for maximum efficiency. ", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/scylladb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-scylladb/2024.4.1/datacap-plugin-scylladb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-scylladb/2025.1.0/datacap-plugin-scylladb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-paradedb", @@ -326,14 +326,14 @@ "description": "ParadeDB is a modern Elasticsearch alternative built on Postgres. Built for real-time, update-heavy workloads.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/paradedb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-paradedb/2024.4.1/datacap-plugin-paradedb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-paradedb/2025.1.0/datacap-plugin-paradedb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-hive-2x", @@ -341,14 +341,14 @@ "description": "The Apache Hive ™ is a distributed, fault-tolerant data warehouse system that enables analytics at a massive scale and facilitates reading, writing, and managing petabytes of data residing in distributed storage using SQL.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/hive2x.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "2.x" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hive-2x/2024.4.1/datacap-plugin-hive-2x-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hive-2x/2025.1.0/datacap-plugin-hive-2x-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-kyuubi", @@ -356,14 +356,14 @@ "description": "Apache Kyuubi, a distributed and multi-tenant gateway to provide serverless SQL on lakehouses.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/kyuubi.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kyuubi/2024.4.1/datacap-plugin-kyuubi-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kyuubi/2025.1.0/datacap-plugin-kyuubi-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-ignite", @@ -371,14 +371,14 @@ "description": "Apache Ignite is a distributed database for high-performance computing with in-memory speed.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/ignite.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ignite/2024.4.1/datacap-plugin-ignite-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ignite/2025.1.0/datacap-plugin-ignite-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-impala", @@ -386,14 +386,14 @@ "description": "Apache Impala is the open source, native analytic database for open data and table formats.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/impala.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-impala/2024.4.1/datacap-plugin-impala-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-impala/2025.1.0/datacap-plugin-impala-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-kylin", @@ -401,14 +401,14 @@ "description": "Apache Kylin is a leading open source OLAP engine for Big Data capable for sub-second query latency on trillions of records. Since being created and open sourced by eBay in 2014, and graduated to Top Level Project of Apache Software Foundation in 2015. Kylin has quickly been adopted by thousands of organizations world widely as their critical analytics application for Big Data.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/kylin.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kylin/2024.4.1/datacap-plugin-kylin-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-kylin/2025.1.0/datacap-plugin-kylin-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-timescale", @@ -416,14 +416,14 @@ "description": "TimescaleDB is an open-source database designed to make SQL scalable for time-series data. It is engineered up from PostgreSQL and packaged as a PostgreSQL extension, providing automatic partitioning across time and space (partitioning key), as well as full SQL support.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/timescale.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-timescale/2024.4.1/datacap-plugin-timescale-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-timescale/2025.1.0/datacap-plugin-timescale-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-iotdb", @@ -431,14 +431,14 @@ "description": "Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for data management and analysis, deployable on the edge and the cloud. ", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/iotdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-iotdb/2024.4.1/datacap-plugin-iotdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-iotdb/2025.1.0/datacap-plugin-iotdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-monetdb", @@ -446,14 +446,14 @@ "description": "MonetDB is a high performance relational database system for analytics.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/monetdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-monetdb/2024.4.1/datacap-plugin-monetdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-monetdb/2025.1.0/datacap-plugin-monetdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-ydb", @@ -461,14 +461,14 @@ "description": "YDB is a versatile open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions. It accommodates transactional (OLTP), analytical (OLAP), and streaming workloads simultaneously.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/ydb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ydb/2024.4.1/datacap-plugin-ydb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ydb/2025.1.0/datacap-plugin-ydb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-neo4j", @@ -476,14 +476,14 @@ "description": "Neo4j is a graph database for knowledge management and analysis.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/neo4j.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-neo4j/2024.4.1/datacap-plugin-neo4j-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-neo4j/2025.1.0/datacap-plugin-neo4j-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-oceanbase", @@ -491,14 +491,14 @@ "description": "OceanBase is an enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/oceanbase.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-oceanbase/2024.4.1/datacap-plugin-oceanbase-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-oceanbase/2025.1.0/datacap-plugin-oceanbase-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-oracle", @@ -506,14 +506,14 @@ "description": "Oracle is an advanced, enterprise-class relational database management system.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/oracle.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-oracle/2024.4.1/datacap-plugin-oracle-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-oracle/2025.1.0/datacap-plugin-oracle-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-phoenix", @@ -521,14 +521,14 @@ "description": "Apache Phoenix is a SQL skin over HBase delivered as a client-embedded JDBC driver targeting low latency queries over HBase data. ", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/phoenix.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-phoenix/2024.4.1/datacap-plugin-phoenix-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-phoenix/2025.1.0/datacap-plugin-phoenix-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-postgresql", @@ -536,14 +536,14 @@ "description": "PostgreSQL is a powerful, open source object-relational database system.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/postgresql.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-postgresql/2024.4.1/datacap-plugin-postgresql-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-postgresql/2025.1.0/datacap-plugin-postgresql-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-presto", @@ -551,14 +551,14 @@ "description": "Presto is a distributed SQL query engine for big data.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/presto.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-presto/2024.4.1/datacap-plugin-presto-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-presto/2025.1.0/datacap-plugin-presto-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-snowflake", @@ -566,14 +566,14 @@ "description": "Snowflake is a database for analytics.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/snowflake.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-snowflake/2024.4.1/datacap-plugin-snowflake-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-snowflake/2025.1.0/datacap-plugin-snowflake-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-sqlserver", @@ -581,14 +581,14 @@ "description": "Microsoft SQL Server is a relational database management system.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/sqlserver.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-sqlserver/2024.4.1/datacap-plugin-sqlserver-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-sqlserver/2025.1.0/datacap-plugin-sqlserver-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-tdengine", @@ -596,14 +596,14 @@ "description": "TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, and Industrial IoT.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/tdengine.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-tdengine/2024.4.1/datacap-plugin-tdengine-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-tdengine/2025.1.0/datacap-plugin-tdengine-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-trino", @@ -611,14 +611,14 @@ "description": "Trino is a distributed SQL query engine for big data.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/trino.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-trino/2024.4.1/datacap-plugin-trino-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-trino/2025.1.0/datacap-plugin-trino-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-doris", @@ -626,14 +626,14 @@ "description": "Apache Doris is a distributed OLAP database.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/doris.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-doris/2024.4.1/datacap-plugin-doris-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-doris/2025.1.0/datacap-plugin-doris-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-starrocks", @@ -641,14 +641,14 @@ "description": "StarRocks is a distributed OLAP database.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/starrocks.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-starrocks/2024.4.1/datacap-plugin-starrocks-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-starrocks/2025.1.0/datacap-plugin-starrocks-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-hologres", @@ -656,14 +656,14 @@ "description": "Hologres is a unified real-time data warehousing service developed by Alibaba Cloud. You can use Hologres to write, update, process, and analyze large amounts of data in real time.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/hologres.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hologres/2024.4.1/datacap-plugin-hologres-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-hologres/2025.1.0/datacap-plugin-hologres-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-greptimedb", @@ -671,14 +671,14 @@ "description": "GreptimeDB is an open-source unified & cost-effective time-series database for Metrics, Logs, and Events (also Traces in plan). You can gain real-time insights from Edge to Cloud at Any Scale.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/greptimedb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-greptimedb/2024.4.1/datacap-plugin-greptimedb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-greptimedb/2025.1.0/datacap-plugin-greptimedb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-questdb", @@ -686,14 +686,14 @@ "description": "QuestDB is the world's fastest growing open-source time-series database. It offers massive ingestion throughput, millisecond queries, powerful time-series SQL extensions, and scales well with minimal and maximal hardware. Save costs with better performance and efficiency.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/questdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-questdb/2024.4.1/datacap-plugin-questdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-questdb/2025.1.0/datacap-plugin-questdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-h2-tcp", @@ -701,14 +701,14 @@ "description": "Use TCP to access the remote H2 database", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/h2tcp.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-h2-tcp/2024.4.1/datacap-plugin-h2-tcp-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-h2-tcp/2025.1.0/datacap-plugin-h2-tcp-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-clickhouse-http", @@ -716,14 +716,14 @@ "description": "Use HTTP to access the remote ClickHouse database", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/clickhousehttp.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-clickhouse-http/2024.4.1/datacap-plugin-clickhouse-http-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-clickhouse-http/2025.1.0/datacap-plugin-clickhouse-http-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-ceresdb", @@ -731,14 +731,14 @@ "description": "CeresDB is a database system designed to allow for the storage and retrieval of semi-structured data, i.e. data that conforms to a “top-level schema” where columns types are known, but those columns can in-turn contain dictionaries or lists.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/ceresdb.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ceresdb/2024.4.1/datacap-plugin-ceresdb-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-ceresdb/2025.1.0/datacap-plugin-ceresdb-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-redis-jdbc", @@ -746,14 +746,14 @@ "description": "Use JDBC to access Redis", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/redisjdbc.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-redis-jdbc/2024.4.1/datacap-plugin-redis-jdbc-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-redis-jdbc/2025.1.0/datacap-plugin-redis-jdbc-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-elasticsearch-8x", @@ -761,14 +761,14 @@ "description": "Use Elasticsearch 8.x", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/elasticsearch8x.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "8.x" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-elasticsearch-8x/2024.4.1/datacap-plugin-elasticsearch-8x-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-elasticsearch-8x/2025.1.0/datacap-plugin-elasticsearch-8x-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-mongo-atlas", @@ -776,14 +776,14 @@ "description": "The MongoDB Atlas SQL JDBC Driver provides SQL connectivity to MongoDB Atlas for client applications developed in Java.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/mongoatlas.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mongo-atlas/2024.4.1/datacap-plugin-mongo-atlas-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mongo-atlas/2025.1.0/datacap-plugin-mongo-atlas-2025.1.0-bin.tar.gz" }, { "key": "datacap-plugin-mongo-community", @@ -791,14 +791,14 @@ "description": "The MongoDB Community SQL JDBC Driver provides SQL connectivity to MongoDB Community for client applications developed in Java.", "i18nFormat": true, "type": "Connector", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/plugin/mongocommunity.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mongo-community/2024.4.1/datacap-plugin-mongo-community-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-plugin-mongo-community/2025.1.0/datacap-plugin-mongo-community-2025.1.0-bin.tar.gz" }, { "key": "datacap-convert-csv", @@ -806,14 +806,14 @@ "description": "A CSV file conversion plugin for DataCap.", "i18nFormat": true, "type": "Converter", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/convert/csv.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-csv/2024.4.1/datacap-convert-csv-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-csv/2025.1.0/datacap-convert-csv-2025.1.0-bin.tar.gz" }, { "key": "datacap-convert-txt", @@ -821,14 +821,14 @@ "description": "A TXT file conversion plugin for DataCap.", "i18nFormat": true, "type": "Converter", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/convert/txt.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-txt/2024.4.1/datacap-convert-txt-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-txt/2025.1.0/datacap-convert-txt-2025.1.0-bin.tar.gz" }, { "key": "datacap-convert-json", @@ -836,14 +836,14 @@ "description": "A JSON file conversion plugin for DataCap.", "i18nFormat": true, "type": "Converter", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/convert/json.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-json/2024.4.1/datacap-convert-json-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-json/2025.1.0/datacap-convert-json-2025.1.0-bin.tar.gz" }, { "key": "datacap-convert-xml", @@ -851,14 +851,14 @@ "description": "A XML file conversion plugin for DataCap.", "i18nFormat": true, "type": "Converter", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/convert/xml.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-xml/2024.4.1/datacap-convert-xml-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-xml/2025.1.0/datacap-convert-xml-2025.1.0-bin.tar.gz" }, { "key": "datacap-convert-none", @@ -866,14 +866,14 @@ "description": "A multidimensional arrays file conversion plugin for DataCap.", "i18nFormat": true, "type": "Converter", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/convert/none.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-none/2024.4.1/datacap-convert-none-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-convert-none/2025.1.0/datacap-convert-none-2025.1.0-bin.tar.gz" }, { "key": "datacap-executor-local", @@ -881,14 +881,14 @@ "description": "A local execution plugin for DataCap.", "i18nFormat": true, "type": "Executor", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/executor/local.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-executor-local/2024.4.1/datacap-executor-local-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-executor-local/2025.1.0/datacap-executor-local-2025.1.0-bin.tar.gz" }, { "key": "datacap-executor-seatunnel", @@ -896,14 +896,14 @@ "description": "A Seatunnel execution plugin for DataCap.", "i18nFormat": true, "type": "Executor", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/executor/seatunnel.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-executor-seatunnel/2024.4.1/datacap-executor-seatunnel-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-executor-seatunnel/2025.1.0/datacap-executor-seatunnel-2025.1.0-bin.tar.gz" }, { "key": "datacap-scheduler-local", @@ -911,14 +911,14 @@ "description": "A local scheduling plugin for DataCap.", "i18nFormat": true, "type": "Scheduler", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/scheduler/local.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-scheduler-local/2024.4.1/datacap-scheduler-local-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-scheduler-local/2025.1.0/datacap-scheduler-local-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-local", @@ -926,14 +926,14 @@ "description": "A local file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/local.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-local/2024.4.1/datacap-fs-local-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-local/2025.1.0/datacap-fs-local-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-qiniu", @@ -941,14 +941,14 @@ "description": "A Qiniu file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/qiniu.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-qiniu/2024.4.1/datacap-fs-qiniu-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-qiniu/2025.1.0/datacap-fs-qiniu-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-alioss", @@ -956,14 +956,14 @@ "description": "A Ali OSS file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/alioss.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-alioss/2024.4.1/datacap-fs-alioss-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-alioss/2025.1.0/datacap-fs-alioss-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-tencent-cos", @@ -971,14 +971,14 @@ "description": "A Tencent COS file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/tencent-cos.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-tencent-cos/2024.4.1/datacap-fs-tencent-cos-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-tencent-cos/2025.1.0/datacap-fs-tencent-cos-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-amazon-s3", @@ -986,14 +986,14 @@ "description": "A Amazon S3 file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/amazon-s3.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-amazon-s3/2024.4.1/datacap-fs-amazon-s3-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-amazon-s3/2025.1.0/datacap-fs-amazon-s3-2025.1.0-bin.tar.gz" }, { "key": "datacap-fs-minio", @@ -1001,14 +1001,14 @@ "description": "A Minio file system plugin for DataCap.", "i18nFormat": true, "type": "FileSystem", - "version": "2024.4.1", + "version": "2025.1.0", "author": "datacap-community", "logo": "http://devlive-cdn.oss-cn-beijing.aliyuncs.com/applications/datacap/resources/logo/fs/minio.svg", - "released": "2024-12-31 09:47:06", + "released": "2025-01-08 18:56:55", "supportVersion": [ "ALL" ], - "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-minio/2024.4.1/datacap-fs-minio-2024.4.1-bin.tar.gz" + "url": "https://repo1.maven.org/maven2/io/edurt/datacap/datacap-fs-minio/2025.1.0/datacap-fs-minio-2025.1.0-bin.tar.gz" } ] } \ No newline at end of file diff --git a/configure/schema/2025.1.0/schema.sql b/configure/schema/2025.1.0/schema.sql new file mode 100644 index 0000000000..f8648ca0a4 --- /dev/null +++ b/configure/schema/2025.1.0/schema.sql @@ -0,0 +1,10 @@ +USE +datacap; + +DROP TABLE IF EXISTS `datacap_metadata_table_database_relation`; +DROP TABLE IF EXISTS `datacap_metadata_table`; +DROP TABLE IF EXISTS `datacap_metadata_database_source_relation`; +DROP TABLE IF EXISTS `datacap_metadata_database`; +DROP TABLE IF EXISTS `datacap_metadata_column_table_relation`; +DROP TABLE IF EXISTS `datacap_metadata_column`; +DROP TABLE IF EXISTS `datacap_template`; \ No newline at end of file diff --git a/convert/datacap-convert-csv/pom.xml b/convert/datacap-convert-csv/pom.xml index b1e0f8df1a..67aa98ba53 100644 --- a/convert/datacap-convert-csv/pom.xml +++ b/convert/datacap-convert-csv/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/convert/datacap-convert-json/pom.xml b/convert/datacap-convert-json/pom.xml index 2fde23b6ea..21312fa2d0 100644 --- a/convert/datacap-convert-json/pom.xml +++ b/convert/datacap-convert-json/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/convert/datacap-convert-none/pom.xml b/convert/datacap-convert-none/pom.xml index 3edc460f50..176a6997bf 100644 --- a/convert/datacap-convert-none/pom.xml +++ b/convert/datacap-convert-none/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/convert/datacap-convert-spi/pom.xml b/convert/datacap-convert-spi/pom.xml index bd255d05a8..ef2e0ae0ee 100644 --- a/convert/datacap-convert-spi/pom.xml +++ b/convert/datacap-convert-spi/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/convert/datacap-convert-txt/pom.xml b/convert/datacap-convert-txt/pom.xml index b6f74a81aa..72342b03b3 100644 --- a/convert/datacap-convert-txt/pom.xml +++ b/convert/datacap-convert-txt/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/convert/datacap-convert-xml/pom.xml b/convert/datacap-convert-xml/pom.xml index 70b89e1402..f00bf4d073 100644 --- a/convert/datacap-convert-xml/pom.xml +++ b/convert/datacap-convert-xml/pom.xml @@ -5,7 +5,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/core/datacap-captcha/pom.xml b/core/datacap-captcha/pom.xml index 9e829b4e34..f413658691 100644 --- a/core/datacap-captcha/pom.xml +++ b/core/datacap-captcha/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-common/pom.xml b/core/datacap-common/pom.xml index e427b46ccd..b28708a01c 100644 --- a/core/datacap-common/pom.xml +++ b/core/datacap-common/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-condor/pom.xml b/core/datacap-condor/pom.xml index 6be578d8f9..727689bdc0 100644 --- a/core/datacap-condor/pom.xml +++ b/core/datacap-condor/pom.xml @@ -4,7 +4,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-parser/pom.xml b/core/datacap-parser/pom.xml index 5546e69682..37bb3f6103 100644 --- a/core/datacap-parser/pom.xml +++ b/core/datacap-parser/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-plugin/pom.xml b/core/datacap-plugin/pom.xml index cfe6f191ab..bac922e6b5 100644 --- a/core/datacap-plugin/pom.xml +++ b/core/datacap-plugin/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-security/pom.xml b/core/datacap-security/pom.xml index 8e3a976fc7..060fa107bd 100644 --- a/core/datacap-security/pom.xml +++ b/core/datacap-security/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-server/pom.xml b/core/datacap-server/pom.xml index 52f942877f..91803eff84 100644 --- a/core/datacap-server/pom.xml +++ b/core/datacap-server/pom.xml @@ -5,7 +5,7 @@ datacap io.edurt.datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/ColumnController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/ColumnController.java deleted file mode 100644 index f708333460..0000000000 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/ColumnController.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.edurt.datacap.server.controller; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.ColumnEntity; -import io.edurt.datacap.service.repository.metadata.ColumnRepository; -import io.edurt.datacap.service.service.ColumnService; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController() -@RequestMapping(value = "/api/v1/column") -public class ColumnController - extends BaseController -{ - private final ColumnRepository repository; - private final ColumnService service; - - public ColumnController(ColumnRepository repository, ColumnService service) - { - super(repository, service); - this.repository = repository; - this.service = service; - } - - @PostMapping(value = "table/{code}") - public CommonResponse> fetchByTable(@PathVariable String code) - { - return this.service.getAllByTable(code); - } -} diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/DatabaseController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/DatabaseController.java deleted file mode 100644 index 8157c3ea36..0000000000 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/DatabaseController.java +++ /dev/null @@ -1,34 +0,0 @@ -package io.edurt.datacap.server.controller; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.DatabaseEntity; -import io.edurt.datacap.service.repository.metadata.DatabaseRepository; -import io.edurt.datacap.service.service.DatabaseService; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController() -@RequestMapping(value = "/api/v1/database") -public class DatabaseController - extends BaseController -{ - private final DatabaseRepository repository; - private final DatabaseService service; - - public DatabaseController(DatabaseRepository repository, DatabaseService service) - { - super(repository, service); - this.repository = repository; - this.service = service; - } - - @PostMapping(value = "source/{code}") - public CommonResponse> fetchBySource(@PathVariable String code) - { - return this.service.getAllBySource(code); - } -} diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/MetadataController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/MetadataController.java new file mode 100644 index 0000000000..8cbeda2b5b --- /dev/null +++ b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/MetadataController.java @@ -0,0 +1,27 @@ +package io.edurt.datacap.server.controller; + +import io.edurt.datacap.common.response.CommonResponse; +import io.edurt.datacap.service.service.MetadataService; +import io.edurt.datacap.spi.model.Response; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController() +@RequestMapping(value = "/api/v1/metadata") +public class MetadataController +{ + private final MetadataService service; + + public MetadataController(MetadataService service) + { + this.service = service; + } + + @PostMapping(value = "database/{code}") + public CommonResponse fetchByDatabase(@PathVariable String code) + { + return this.service.getDatabaseSchema(code); + } +} diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/SourceController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/SourceController.java index fc5c4e4655..5b0ee3c5bf 100644 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/SourceController.java +++ b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/SourceController.java @@ -18,7 +18,6 @@ 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; @@ -59,10 +58,4 @@ public CommonResponse> getPlugins() { return service.getPlugins(); } - - @PutMapping(value = "syncMetadata/{code}") - public CommonResponse syncMetadata(@PathVariable(value = "code") String code) - { - return this.service.syncMetadata(code); - } } diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/TableController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/TableController.java deleted file mode 100644 index bcd0ddd99a..0000000000 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/TableController.java +++ /dev/null @@ -1,71 +0,0 @@ -package io.edurt.datacap.server.controller; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.body.ExportBody; -import io.edurt.datacap.service.body.TableBody; -import io.edurt.datacap.service.body.TableFilter; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.service.repository.metadata.TableRepository; -import io.edurt.datacap.service.service.TableService; -import io.edurt.datacap.spi.model.Response; -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.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController() -@RequestMapping(value = "/api/v1/table") -public class TableController - extends BaseController -{ - private final TableRepository repository; - private final TableService service; - - public TableController(TableRepository repository, TableService service) - { - super(repository, service); - this.repository = repository; - this.service = service; - } - - @PostMapping(value = "database/{code}") - public CommonResponse> fetchByDatabase(@PathVariable String code) - { - return this.service.getAllByDatabase(code); - } - - @RequestMapping(value = "{code}", method = {RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE}) - public CommonResponse fetchDataById(@PathVariable String code, @RequestBody TableFilter configure) - { - return this.service.fetchData(code, configure); - } - - @PostMapping(value = "export/{code}") - public CommonResponse exportDataByCode(@PathVariable String code, @RequestBody ExportBody configure) - { - return this.service.exportDataByCode(code, configure); - } - - @GetMapping(value = "dataDownload/{username}/{filename}") - public Object dataDownload(@PathVariable String username, @PathVariable String filename) - { - return this.service.dataDownload(username, filename); - } - - @PostMapping(value = "createTable/{id}") - public CommonResponse createTable(@PathVariable Long id, @RequestBody TableBody configure) - { - return this.service.createTable(id, configure); - } - - @PostMapping(value = "manageColumn/{code}") - public CommonResponse manageColumn(@PathVariable String code, @RequestBody TableBody configure) - { - return this.service.manageColumn(code, configure); - } -} diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/admin/TemplateSqlController.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/admin/TemplateSqlController.java deleted file mode 100644 index dd457746d1..0000000000 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/controller/admin/TemplateSqlController.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.edurt.datacap.server.controller.admin; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.body.FilterBody; -import io.edurt.datacap.service.body.TemplateSqlBody; -import io.edurt.datacap.service.entity.PageEntity; -import io.edurt.datacap.service.entity.TemplateEntity; -import io.edurt.datacap.service.service.TemplateSqlService; -import io.edurt.datacap.service.validation.ValidationGroup; -import org.springframework.http.MediaType; -import org.springframework.validation.annotation.Validated; -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; - -@RestController() -@RequestMapping(value = {"/api/v1/admin/template/sql", "/api/v1/template"}) -public class TemplateSqlController -{ - private final TemplateSqlService templateSqlService; - - public TemplateSqlController(TemplateSqlService templateSqlService) - { - this.templateSqlService = templateSqlService; - } - - @PostMapping(value = "list") - public CommonResponse> getAllByFilter(@RequestBody FilterBody filter) - { - return this.templateSqlService.getAllByFilter(filter); - } - - @PostMapping(produces = {MediaType.APPLICATION_JSON_VALUE}) - public CommonResponse save(@RequestBody @Validated(ValidationGroup.Crud.Create.class) TemplateEntity configure) - { - return this.templateSqlService.saveOrUpdate(configure); - } - - @PutMapping(produces = {MediaType.APPLICATION_JSON_VALUE}) - public CommonResponse update(@RequestBody @Validated(ValidationGroup.Crud.Update.class) TemplateEntity configure) - { - return this.templateSqlService.saveOrUpdate(configure); - } - - @GetMapping(value = "{id}") - public CommonResponse getInfo(@PathVariable(value = "id") Long id) - { - return this.templateSqlService.getById(id); - } - - @PostMapping(value = "execute") - public CommonResponse execute(@RequestBody TemplateSqlBody configure) - { - return this.templateSqlService.execute(configure); - } -} diff --git a/core/datacap-server/src/main/java/io/edurt/datacap/server/runner/ScheduleRunner.java b/core/datacap-server/src/main/java/io/edurt/datacap/server/runner/ScheduleRunner.java index 91a9d1982f..a899b3a871 100644 --- a/core/datacap-server/src/main/java/io/edurt/datacap/server/runner/ScheduleRunner.java +++ b/core/datacap-server/src/main/java/io/edurt/datacap/server/runner/ScheduleRunner.java @@ -9,7 +9,6 @@ import io.edurt.datacap.service.repository.SourceRepository; import io.edurt.datacap.service.service.SourceService; import io.edurt.datacap.service.source.CheckScheduledRunnable; -import io.edurt.datacap.service.source.SyncMetadataScheduledRunnable; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Service; @@ -60,15 +59,6 @@ private Map> initializeTaskFactories() { Map> factories = new EnumMap<>(ScheduledType.class); - factories.put(ScheduledType.SOURCE_SYNCHRONIZE, - taskName -> new SyncMetadataScheduledRunnable( - taskName, - pluginManager, - sourceRepository, - sourceService - ) - ); - factories.put(ScheduledType.SOURCE_CHECK, taskName -> new CheckScheduledRunnable( taskName, diff --git a/core/datacap-service/pom.xml b/core/datacap-service/pom.xml index 7ac894773f..db9c0a4527 100644 --- a/core/datacap-service/pom.xml +++ b/core/datacap-service/pom.xml @@ -6,7 +6,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/ColumnEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/ColumnEntity.java deleted file mode 100644 index a44687076a..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/ColumnEntity.java +++ /dev/null @@ -1,97 +0,0 @@ -package io.edurt.datacap.service.entity; - -import com.fasterxml.jackson.annotation.JsonView; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.common.view.EntityView; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; -import lombok.experimental.SuperBuilder; -import org.hibernate.annotations.OnDelete; -import org.hibernate.annotations.OnDeleteAction; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -import java.util.Date; - -@Getter -@ToString -@SuperBuilder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "datacap_metadata_column") -@EntityListeners(AuditingEntityListener.class) -@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EQ_DOESNT_OVERRIDE_EQUALS"}) -public class ColumnEntity - extends BaseEntity -{ - @Column(name = "description") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String description; - - @Column(name = "type") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String type; - - @Column(name = "comment") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String comment; - - @Column(name = "default_value") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String defaultValue; - - @Column(name = "position") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String position; - - @Column(name = "is_nullable") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String isNullable; - - @Column(name = "maximum_length") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String maximumLength; - - @Column(name = "collation") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String collation; - - @Column(name = "is_key") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String isKey; - - @Column(name = "privileges") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String privileges; - - @Column(name = "data_type") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String dataType; - - @Column(name = "extra") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String extra; - - @ManyToOne - @JoinTable(name = "datacap_metadata_column_table_relation", - joinColumns = @JoinColumn(name = "column_id"), - inverseJoinColumns = @JoinColumn(name = "table_id")) - @OnDelete(action = OnDeleteAction.CASCADE) - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private TableEntity table; - - public ColumnEntity(Long id, String name, Date createTime) - { - super(id, name, null, true, createTime, null); - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/DatabaseEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/DatabaseEntity.java deleted file mode 100644 index dc2d93005a..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/DatabaseEntity.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.edurt.datacap.service.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonView; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.common.view.EntityView; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; -import lombok.experimental.SuperBuilder; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -import java.util.List; - -@Data -@SuperBuilder -@ToString -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "datacap_metadata_database") -@EntityListeners(AuditingEntityListener.class) -@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC"}) -public class DatabaseEntity - extends BaseEntity -{ - @Column(name = "description") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String description; - - @Column(name = "catalog") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String catalog; - - @ManyToOne - @JoinTable(name = "datacap_metadata_database_source_relation", - joinColumns = @JoinColumn(name = "source_id"), - inverseJoinColumns = @JoinColumn(name = "database_id")) - @JsonIgnore - private SourceEntity source; - - @OneToMany(mappedBy = "database", cascade = CascadeType.REMOVE) - @JsonIgnore - private List tables; -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SourceEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SourceEntity.java index 02c0a9d056..e5a69ddb1b 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SourceEntity.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/SourceEntity.java @@ -143,10 +143,6 @@ public class SourceEntity @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) private UserEntity user; - @OneToMany(mappedBy = "source", cascade = CascadeType.REMOVE) - @JsonIgnore - private List databases; - @OneToMany(mappedBy = "source", cascade = CascadeType.REMOVE) @JsonIgnore private List historys; diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TableEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TableEntity.java deleted file mode 100644 index 0a37fc0777..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TableEntity.java +++ /dev/null @@ -1,124 +0,0 @@ -package io.edurt.datacap.service.entity; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonView; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.common.view.EntityView; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; -import org.hibernate.annotations.OnDelete; -import org.hibernate.annotations.OnDeleteAction; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -import java.util.Date; -import java.util.List; - -@Getter -@Setter -@ToString -@SuperBuilder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "datacap_metadata_table") -@EntityListeners(AuditingEntityListener.class) -@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EQ_DOESNT_OVERRIDE_EQUALS"}) -public class TableEntity - extends BaseEntity -{ - @Column(name = "description") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String description; - - @Column(name = "type") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String type; - - @Column(name = "engine") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String engine; - - @Column(name = "format") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String format; - - @Column(name = "in_rows") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String rows; - - @Column(name = "in_create_time") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String inCreateTime; - - @Column(name = "in_update_time") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String inUpdateTime; - - @Column(name = "collation") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String collation; - - @Column(name = "comment") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String comment; - - @Column(name = "avg_row_length") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String avgRowLength; - - @Column(name = "data_length") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String dataLength; - - @Column(name = "index_length") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String indexLength; - - @Column(name = "auto_increment") - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private String autoIncrement; - - @ManyToOne() - @JoinTable(name = "datacap_metadata_table_database_relation", - joinColumns = @JoinColumn(name = "table_id"), - inverseJoinColumns = @JoinColumn(name = "database_id")) - @OnDelete(action = OnDeleteAction.CASCADE) - @JsonView(value = {EntityView.UserView.class, EntityView.AdminView.class}) - private DatabaseEntity database; - - @OneToMany(mappedBy = "table", cascade = CascadeType.REMOVE) - @JsonIgnore - private List columns; - - public TableEntity(Long id, String name, Date createTime) - { - super(id, name, null, true, createTime, null); - } - - public String getRows() - { - if (isStringNull(rows)) { - return "0"; - } - return rows; - } - - private boolean isStringNull(String cs) - { - return "null".equals(cs); - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TemplateEntity.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TemplateEntity.java deleted file mode 100644 index e7868f4940..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/entity/TemplateEntity.java +++ /dev/null @@ -1,55 +0,0 @@ -package io.edurt.datacap.service.entity; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.service.validation.ValidationGroup; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.ToString; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.Table; -import javax.validation.constraints.NotBlank; - -@Entity -@Data -@ToString -@NoArgsConstructor -@AllArgsConstructor -@Table(name = "datacap_template") -@EntityListeners(AuditingEntityListener.class) -@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EQ_OVERRIDING_EQUALS_NOT_SYMMETRIC"}, - justification = "I prefer to suppress these FindBugs warnings") -public class TemplateEntity - extends BaseEntity -{ - @NotBlank(groups = { - ValidationGroup.Crud.Create.class, - ValidationGroup.Crud.Update.class - }) - @Column(name = "description") - private String description; - - @NotBlank(groups = { - ValidationGroup.Crud.Create.class, - ValidationGroup.Crud.Update.class - }) - @Column(name = "content") - private String content; - - @NotBlank(groups = { - ValidationGroup.Crud.Create.class, - ValidationGroup.Crud.Update.class - }) - @Column(name = "plugin") - private String plugin; - - @Column(name = "configure") - private String configure; - - @Column(name = "is_system") - private boolean system; -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/TemplateSqlRepository.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/TemplateSqlRepository.java deleted file mode 100644 index 43b46d48e3..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/TemplateSqlRepository.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.edurt.datacap.service.repository; - -import io.edurt.datacap.service.entity.TemplateEntity; -import org.springframework.data.repository.PagingAndSortingRepository; - -import java.util.List; - -public interface TemplateSqlRepository - extends PagingAndSortingRepository -{ - List findByName(String name); - - TemplateEntity findByNameAndPluginContaining(String name, String word); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/ColumnRepository.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/ColumnRepository.java deleted file mode 100644 index af2a396021..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/ColumnRepository.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.edurt.datacap.service.repository.metadata; - -import io.edurt.datacap.service.entity.ColumnEntity; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.service.repository.BaseRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -public interface ColumnRepository - extends BaseRepository -{ - @Query("SELECT c " + - "FROM ColumnEntity c " + - "WHERE c.table = ?1 " + - "ORDER BY c.position ASC ") - List findAllByTable(TableEntity table); - - @Query(value = "SELECT new ColumnEntity(c.id, c.name, c.createTime) " + - "FROM ColumnEntity c " + - "WHERE c.table = :table") - List findSimpleAllByTable(@Param(value = "table") TableEntity table); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/DatabaseRepository.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/DatabaseRepository.java deleted file mode 100644 index 7c82efb2fc..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/DatabaseRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.edurt.datacap.service.repository.metadata; - -import io.edurt.datacap.service.entity.DatabaseEntity; -import io.edurt.datacap.service.entity.SourceEntity; -import io.edurt.datacap.service.repository.BaseRepository; - -import java.util.List; - -public interface DatabaseRepository - extends BaseRepository -{ - List findAllBySource(SourceEntity source); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/TableRepository.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/TableRepository.java deleted file mode 100644 index 0ebfe32fce..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/repository/metadata/TableRepository.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.edurt.datacap.service.repository.metadata; - -import io.edurt.datacap.service.entity.DatabaseEntity; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.service.repository.BaseRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -public interface TableRepository - extends BaseRepository -{ - /** - * Retrieves a list of TableEntity objects that belong to the specified DatabaseEntity. - * - * @param database the DatabaseEntity to filter the TableEntity objects by - * @return a list of TableEntity objects that belong to the specified DatabaseEntity - */ - List findAllByDatabase(DatabaseEntity database); - - /** - * Finds all table entities associated with the specified database. - * - * @param database the database entity to search for - * @return a list of table entities - */ - @Query(value = "SELECT new TableEntity(t.id, t.name, t.createTime) " + - "FROM TableEntity AS t " + - "WHERE t.database = :database") - List findSimpleAllByDatabase(@Param(value = "database") DatabaseEntity database); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/ColumnService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/ColumnService.java deleted file mode 100644 index c9184780a9..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/ColumnService.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.edurt.datacap.service.service; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.ColumnEntity; - -import java.util.List; - -public interface ColumnService - extends BaseService -{ - /** - * Retrieves all the column entities associated with a specific table. - * - * @param code the code of the table - * @return a common response containing a list of column entities - */ - CommonResponse> getAllByTable(String code); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/DatabaseService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/DatabaseService.java deleted file mode 100644 index 9858d4b3d4..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/DatabaseService.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.edurt.datacap.service.service; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.DatabaseEntity; - -import java.util.List; - -public interface DatabaseService - extends BaseService -{ - /** - * Retrieves a list of DatabaseEntity objects based on the provided id. - * - * @param code the code used to filter the results - * @return a list of DatabaseEntity objects that match the id - */ - CommonResponse> getAllBySource(String code); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/MetadataService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/MetadataService.java new file mode 100644 index 0000000000..13410d8071 --- /dev/null +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/MetadataService.java @@ -0,0 +1,9 @@ +package io.edurt.datacap.service.service; + +import io.edurt.datacap.common.response.CommonResponse; +import io.edurt.datacap.spi.model.Response; + +public interface MetadataService +{ + CommonResponse getDatabaseSchema(String code); +} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/SourceService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/SourceService.java index 4ff8b8c73e..13c74ebf01 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/SourceService.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/SourceService.java @@ -26,6 +26,4 @@ public interface SourceService CommonResponse testConnection(SourceBody configure); CommonResponse> getHistory(String code, FilterBody filter); - - CommonResponse syncMetadata(String code); } diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TableService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TableService.java deleted file mode 100644 index 57a7db9e78..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TableService.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.edurt.datacap.service.service; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.body.ExportBody; -import io.edurt.datacap.service.body.TableBody; -import io.edurt.datacap.service.body.TableFilter; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.spi.model.Response; - -import java.util.List; - -public interface TableService - extends BaseService -{ - /** - * Retrieves all records from the specified database. - * - * @param code the code of the database - * @return a common response containing a list of table entities - */ - CommonResponse> getAllByDatabase(String code); - - /** - * Retrieves data from the database based on the provided ID and table filter. - * - * @param code the code of the data to retrieve - * @param configure the table filter to apply to the data retrieval - * @return a common response object containing the retrieved data - */ - CommonResponse fetchData(String code, TableFilter configure); - - /** - * Generates a function comment for the given function body in a markdown code block with the correct language syntax. - * - * @param id the ID of the data to be exported - * @param configure the export configuration - * @return the response containing the exported data - */ - CommonResponse exportDataByCode(String code, ExportBody configure); - - Object dataDownload(String username, String filename); - - CommonResponse createTable(Long databaseId, TableBody configure); - - CommonResponse manageColumn(String code, TableBody configure); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TemplateSqlService.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TemplateSqlService.java deleted file mode 100644 index 8805e12643..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/TemplateSqlService.java +++ /dev/null @@ -1,18 +0,0 @@ -package io.edurt.datacap.service.service; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.body.FilterBody; -import io.edurt.datacap.service.body.TemplateSqlBody; -import io.edurt.datacap.service.entity.PageEntity; -import io.edurt.datacap.service.entity.TemplateEntity; - -public interface TemplateSqlService -{ - CommonResponse saveOrUpdate(TemplateEntity configure); - - CommonResponse> getAllByFilter(FilterBody filter); - - CommonResponse getById(Long id); - - CommonResponse execute(TemplateSqlBody configure); -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/ColumnServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/ColumnServiceImpl.java deleted file mode 100644 index 3b9225485b..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/ColumnServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.edurt.datacap.service.service.impl; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.ColumnEntity; -import io.edurt.datacap.service.repository.metadata.ColumnRepository; -import io.edurt.datacap.service.repository.metadata.TableRepository; -import io.edurt.datacap.service.service.ColumnService; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class ColumnServiceImpl - implements ColumnService -{ - private final TableRepository tableRepository; - private final ColumnRepository repository; - - public ColumnServiceImpl(TableRepository tableRepository, ColumnRepository repository) - { - this.tableRepository = tableRepository; - this.repository = repository; - } - - @Override - public CommonResponse> getAllByTable(String code) - { - return tableRepository.findByCode(code) - .map(value -> CommonResponse.success(repository.findAllByTable(value))) - .orElseGet(() -> CommonResponse.failure(String.format("Table [ %s ] not found", code))); - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DatabaseServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DatabaseServiceImpl.java deleted file mode 100644 index db042b6ed0..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/DatabaseServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.edurt.datacap.service.service.impl; - -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.service.entity.DatabaseEntity; -import io.edurt.datacap.service.repository.SourceRepository; -import io.edurt.datacap.service.repository.metadata.DatabaseRepository; -import io.edurt.datacap.service.service.DatabaseService; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class DatabaseServiceImpl - implements DatabaseService -{ - private final DatabaseRepository repository; - private final SourceRepository sourceRepository; - - public DatabaseServiceImpl(DatabaseRepository repository, SourceRepository sourceRepository) - { - this.repository = repository; - this.sourceRepository = sourceRepository; - } - - @Override - public CommonResponse> getAllBySource(String code) - { - return sourceRepository.findByCode(code) - .map(value -> CommonResponse.success(this.repository.findAllBySource(value))) - .orElse(CommonResponse.failure(String.format("Source [ %s ] not found", code))); - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/MetadataServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/MetadataServiceImpl.java new file mode 100644 index 0000000000..deec2954af --- /dev/null +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/MetadataServiceImpl.java @@ -0,0 +1,40 @@ +package io.edurt.datacap.service.service.impl; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import io.edurt.datacap.common.response.CommonResponse; +import io.edurt.datacap.plugin.PluginManager; +import io.edurt.datacap.service.repository.SourceRepository; +import io.edurt.datacap.service.service.MetadataService; +import io.edurt.datacap.spi.PluginService; +import io.edurt.datacap.spi.model.Response; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@SuppressFBWarnings(value = {"EI_EXPOSE_REP2"}) +public class MetadataServiceImpl + implements MetadataService +{ + private final PluginManager pluginManager; + private final SourceRepository repository; + + public MetadataServiceImpl(PluginManager pluginManager, SourceRepository repository) + { + this.pluginManager = pluginManager; + this.repository = repository; + } + + @Override + public CommonResponse getDatabaseSchema(String code) + { + return repository.findByCode(code) + .map(entity -> pluginManager.getPlugin(entity.getType()) + .map(plugin -> { + PluginService service = plugin.getService(PluginService.class); + return CommonResponse.success(service.getDatabases(entity.toConfigure(pluginManager, plugin))); + }) + .orElseGet(() -> CommonResponse.failure(String.format("Plugin [ %s ] not found", entity.getType())))) + .orElseGet(() -> CommonResponse.failure(String.format("Resource [ %s ] not found", code))); + } +} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/SourceServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/SourceServiceImpl.java index 4be28f0bfe..292995d84d 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/SourceServiceImpl.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/SourceServiceImpl.java @@ -1,18 +1,9 @@ package io.edurt.datacap.service.service.impl; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.common.collect.Maps; import com.google.common.io.Files; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.common.enums.NodeType; import io.edurt.datacap.common.enums.ServiceState; -import io.edurt.datacap.common.enums.Type; import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.common.utils.CodeUtils; -import io.edurt.datacap.common.utils.JsonUtils; -import io.edurt.datacap.executor.common.RunState; -import io.edurt.datacap.plugin.Plugin; import io.edurt.datacap.plugin.PluginManager; import io.edurt.datacap.plugin.PluginType; import io.edurt.datacap.service.adapter.PageRequestAdapter; @@ -23,25 +14,15 @@ import io.edurt.datacap.service.common.PluginUtils; import io.edurt.datacap.service.configure.IConfigure; import io.edurt.datacap.service.configure.IConfigureField; -import io.edurt.datacap.service.entity.ColumnEntity; -import io.edurt.datacap.service.entity.DatabaseEntity; import io.edurt.datacap.service.entity.PageEntity; import io.edurt.datacap.service.entity.PluginEntity; -import io.edurt.datacap.service.entity.ScheduledEntity; import io.edurt.datacap.service.entity.ScheduledHistoryEntity; import io.edurt.datacap.service.entity.SourceEntity; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.service.entity.TemplateEntity; import io.edurt.datacap.service.entity.UserEntity; -import io.edurt.datacap.service.itransient.SqlConfigure; import io.edurt.datacap.service.repository.BaseRepository; import io.edurt.datacap.service.repository.ScheduledHistoryRepository; import io.edurt.datacap.service.repository.SourceRepository; -import io.edurt.datacap.service.repository.TemplateSqlRepository; import io.edurt.datacap.service.repository.UserRepository; -import io.edurt.datacap.service.repository.metadata.ColumnRepository; -import io.edurt.datacap.service.repository.metadata.DatabaseRepository; -import io.edurt.datacap.service.repository.metadata.TableRepository; import io.edurt.datacap.service.security.UserDetailsService; import io.edurt.datacap.service.service.SourceService; import io.edurt.datacap.service.wrapper.ResponseWrapper; @@ -54,20 +35,14 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.core.env.Environment; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import java.io.File; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Optional; -import java.util.Properties; -import java.util.concurrent.Executors; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import static java.util.Objects.requireNonNull; @@ -81,24 +56,20 @@ public class SourceServiceImpl private final SourceRepository sourceRepository; private final UserRepository userRepository; private final ScheduledHistoryRepository scheduledHistoryRepository; - private final DatabaseRepository databaseHandler; - private final TableRepository tableHandler; - private final ColumnRepository columnHandler; - private final TemplateSqlRepository templateHandler; - private final ScheduledHistoryRepository scheduledHistoryHandler; private final PluginManager pluginManager; private final Environment environment; - public SourceServiceImpl(SourceRepository sourceRepository, UserRepository userRepository, ScheduledHistoryRepository scheduledHistoryRepository, DatabaseRepository databaseHandler, TableRepository tableHandler, ColumnRepository columnHandler, TemplateSqlRepository templateHandler, ScheduledHistoryRepository scheduledHistoryHandler, PluginManager pluginManager, Environment environment) + public SourceServiceImpl( + SourceRepository sourceRepository, + UserRepository userRepository, + ScheduledHistoryRepository scheduledHistoryRepository, + PluginManager pluginManager, + Environment environment + ) { this.sourceRepository = sourceRepository; this.userRepository = userRepository; this.scheduledHistoryRepository = scheduledHistoryRepository; - this.databaseHandler = databaseHandler; - this.tableHandler = tableHandler; - this.columnHandler = columnHandler; - this.templateHandler = templateHandler; - this.scheduledHistoryHandler = scheduledHistoryHandler; this.pluginManager = pluginManager; this.environment = environment; } @@ -314,8 +285,6 @@ public CommonResponse saveOrUpdate(BaseRepository> getHistory(String code }) .orElse(CommonResponse.failure(String.format("Source [ %s ] not found", code))); } - - @Override - public CommonResponse syncMetadata(String code) - { - return this.sourceRepository.findByCode(code) - .map(entity -> { - Executors.newSingleThreadExecutor() - .submit(() -> startSyncMetadata(entity, null)); - return CommonResponse.success(entity); - }) - .orElseGet(() -> CommonResponse.failure(String.format("Source [ %s ] not found", code))); - } - - private void startSyncMetadata(SourceEntity entity, ScheduledEntity scheduled) - { - AtomicInteger databaseAddedCount = new AtomicInteger(0); - AtomicInteger databaseUpdatedCount = new AtomicInteger(0); - AtomicInteger databaseRemovedCount = new AtomicInteger(0); - AtomicInteger tableAddedCount = new AtomicInteger(0); - AtomicInteger tableUpdatedCount = new AtomicInteger(0); - AtomicInteger tableRemovedCount = new AtomicInteger(0); - AtomicInteger columnAddedCount = new AtomicInteger(0); - AtomicInteger columnUpdatedCount = new AtomicInteger(0); - AtomicInteger columnRemovedCount = new AtomicInteger(0); - Map databaseCache = Maps.newHashMap(); - Map> databaseTableCache = Maps.newHashMap(); - Map tableCache = Maps.newHashMap(); - Map> tableColumnCache = Maps.newHashMap(); - ScheduledHistoryEntity scheduledHistory = ScheduledHistoryEntity.builder().name(String.format("Sync source [ %s ]", entity.getName())).scheduled(scheduled).source(entity).state(RunState.RUNNING).build(); - scheduledHistoryHandler.save(scheduledHistory); - log.info("==================== Sync metadata [ {} ] started =================", entity.getName()); - pluginManager.getPlugin(entity.getType()) - .ifPresent(plugin -> { - try { - PluginService pluginService = plugin.getService(PluginService.class); - Configure pConfigure = entity.toConfigure(pluginManager, plugin); - pConfigure.setPluginManager(pluginManager); - Response response = pluginService.execute(pConfigure, pluginService.validator()); - if (!response.getIsSuccessful()) { - log.error("The source [ {} ] not available", entity.getName()); - } - else { - this.startSyncDatabase( - entity, - plugin, - pluginService, - databaseCache, - databaseTableCache, - tableCache, - tableColumnCache, - databaseAddedCount, - databaseUpdatedCount, - databaseRemovedCount, - tableAddedCount, - tableUpdatedCount, - tableRemovedCount, - columnAddedCount, - columnUpdatedCount, - columnRemovedCount - ); - } - scheduledHistory.setState(RunState.SUCCESS); - } - catch (Exception e) { - log.error("The scheduled task [ {} ] source [ {} ] not available ", scheduled.getName(), entity.getName(), e); - scheduledHistory.setState(RunState.FAILURE); - scheduledHistory.setMessage(ExceptionUtils.getStackTrace(e)); - } - }); - log.info("==================== Sync metadata [ {} ] finished =================", entity.getName()); - Properties info = new Properties(); - info.put("databaseAddedCount", databaseAddedCount.get()); - info.put("databaseUpdatedCount", databaseUpdatedCount.get()); - info.put("databaseRemovedCount", databaseRemovedCount.get()); - info.put("tableAddedCount", tableAddedCount.get()); - info.put("tableUpdatedCount", tableUpdatedCount.get()); - info.put("tableRemovedCount", tableRemovedCount.get()); - info.put("columnAddedCount", columnAddedCount.get()); - info.put("columnUpdatedCount", columnUpdatedCount.get()); - info.put("columnRemovedCount", columnRemovedCount.get()); - scheduledHistory.setInfo(info); - scheduledHistoryHandler.save(scheduledHistory); - databaseCache.clear(); - databaseTableCache.clear(); - tableCache.clear(); - tableColumnCache.clear(); - } - - /** - * Retrieves the SQL context for the given TemplateSqlEntity and map of key-value pairs. - * - * @param entity the TemplateSqlEntity object containing the SQL configuration and content - * @param map the map of key-value pairs used for replacing expressions in the SQL content - * @return the SQL content with the expressions replaced by the corresponding values in the map - */ - private String getSqlContext(TemplateEntity entity, Map map) - { - try { - if (ObjectUtils.isNotEmpty(entity.getConfigure())) { - final String[] content = {entity.getContent()}; - List configures = JsonUtils.objectmapper.readValue(entity.getConfigure(), List.class); - map.entrySet().forEach(value -> { - Optional sqlConfigure = configures.stream().filter(v -> String.valueOf(v.get("column")).equalsIgnoreCase(value.getKey())).map(v -> { - SqlConfigure configure = new SqlConfigure(); - configure.setColumn(String.valueOf(v.get("column"))); - configure.setType(Type.valueOf(String.valueOf(v.get("type")))); - configure.setExpression(String.valueOf(v.get("expression"))); - return configure; - }).findFirst(); - if (sqlConfigure.isPresent()) { - content[0] = content[0].replace(sqlConfigure.get().getExpression(), String.valueOf(value.getValue())); - } - }); - return content[0]; - } - } - catch (Exception e) { - log.warn("Failed to convert [ {} ] sql context", entity.getName()); - return entity.getContent(); - } - return entity.getContent(); - } - - /** - * Retrieves the text value of a specific node in a JSON object. - * - * @param json the JSON object to retrieve the node from - * @param key the type of node to retrieve - * @return the text value of the specified node, or null if the node does not exist - */ - private String getNodeText(Object json, NodeType key) - { - ObjectNode objectNode = (ObjectNode) json; - if (objectNode != null) { - JsonNode jsonNode = objectNode.get(String.join("_", key.getValue(), "NODE")); - if (jsonNode != null) { - return jsonNode.asText(); - } - } - return null; - } - - /** - * Retrieves a TemplateSqlEntity object based on the given template name and SourceEntity. - * - * @param templateName the name of the template to retrieve - * @param entity the SourceEntity object to use for filtering - * @return the TemplateSqlEntity object that matches the given criteria - */ - private TemplateEntity getTemplate(String templateName, SourceEntity entity) - { - return templateHandler.findByNameAndPluginContaining(templateName, entity.getType()); - } - - /** - * Starts the synchronization of the database. - * - * @param entity the SourceEntity object representing the entity - * @param plugin the Plugin object representing the plugin - * @param databaseCache the Map object representing the database cache - * @param databaseTableCache the Map object representing the database table cache - * @param tableCache the Map object representing the table cache - * @param tableColumnCache the Map object representing the table column cache - * @param databaseAddedCount the AtomicInteger object representing the count of added databases - * @param databaseUpdatedCount the AtomicInteger object representing the count of updated databases - * @param databaseRemovedCount the AtomicInteger object representing the count of removed databases - * @param tableAddedCount the AtomicInteger object representing the count of added tables - * @param tableUpdatedCount the AtomicInteger object representing the count of updated tables - * @param tableRemovedCount the AtomicInteger object representing the count of removed tables - * @param columnAddedCount the AtomicInteger object representing the count of added columns - * @param columnUpdatedCount the AtomicInteger object representing the count of updated columns - * @param columnRemovedCount the AtomicInteger object representing the count of removed columns - */ - private void startSyncDatabase(SourceEntity entity, Plugin plugin, PluginService pluginService, Map databaseCache, Map> databaseTableCache, Map tableCache, Map> tableColumnCache, AtomicInteger databaseAddedCount, AtomicInteger databaseUpdatedCount, AtomicInteger databaseRemovedCount, AtomicInteger tableAddedCount, AtomicInteger tableUpdatedCount, AtomicInteger tableRemovedCount, AtomicInteger columnAddedCount, AtomicInteger columnUpdatedCount, AtomicInteger columnRemovedCount) - { - String templateName = "SYSTEM_FOR_GET_ALL_DATABASES"; - TemplateEntity template = getTemplate(templateName, entity); - if (template == null) { - log.warn("The source [ {} ] protocol [ {} ] template [ {} ] is not available, skip sync database", entity.getName(), entity.getProtocol(), templateName); - } - else { - Response response = pluginService.execute(entity.toConfigure(pluginManager, plugin), getSqlContext(template, null)); - if (!response.getIsSuccessful()) { - log.error("The source [ {} ] protocol [ {} ] sync metadata [ {} ] failed", entity.getName(), entity.getProtocol(), response.getMessage()); - } - else { - List origin = databaseHandler.findAllBySource(entity); - List entities = response.getColumns() - .stream() - .map(item -> { - DatabaseEntity database = DatabaseEntity.builder().name(getNodeText(item, NodeType.SCHEMA)).catalog(getNodeText(item, NodeType.CATALOG)).description(String.format("[ %s ] of [ %s ]", getNodeText(item, NodeType.SCHEMA), getNodeText(item, NodeType.CATALOG))).source(entity).build(); - Optional optionalDatabase = origin.stream().filter(node -> node.getName().equals(database.getName())).findAny(); - if (optionalDatabase.isPresent()) { - database.setId(optionalDatabase.get().getId()); - database.setCreateTime(optionalDatabase.get().getCreateTime()); - if (StringUtils.isEmpty(database.getCode())) { - database.setCode(CodeUtils.generateCode(false)); - } - databaseUpdatedCount.addAndGet(1); - } - else { - databaseAddedCount.addAndGet(1); - } - return database; - }) - .collect(Collectors.toList()); - // Write the new data retrieved to the database - log.info("Added database size [ {} ] to source [ {} ]", entities.size(), entity.getName()); - databaseHandler.saveAll(entities); - entities.forEach(item -> { - String key = String.format("%s_%s", item.getCatalog(), item.getName()); - databaseCache.put(key, item); - databaseTableCache.put(key, this.tableHandler.findSimpleAllByDatabase(item)); - }); - // Delete invalid data that no longer exists - List deleteEntities = origin.stream() - .filter(node -> entities.stream().noneMatch(item -> node.getName().equals(item.getName()))) - .collect(Collectors.toList()); - log.info("Removed database size [ {} ] from source [ {} ]", deleteEntities.size(), entity.getName()); - databaseHandler.deleteAll(deleteEntities); - databaseRemovedCount.addAndGet(deleteEntities.size()); - } - this.startSyncTable( - entity, - plugin, - pluginService, - databaseCache, - databaseTableCache, - tableCache, - tableColumnCache, - tableAddedCount, - tableUpdatedCount, - tableRemovedCount, - columnAddedCount, - columnUpdatedCount, - columnRemovedCount - ); - } - } - - /** - * Starts the synchronization of a table. - * - * @param entity the source entity - * @param plugin the plugin - * @param databaseCache the database cache - * @param databaseTableCache the database table cache - * @param tableCache the table cache - * @param tableColumnCache the table column cache - * @param tableAddedCount the table added count - * @param tableUpdatedCount the table updated count - * @param tableRemovedCount the table removed count - * @param columnAddedCount the column added count - * @param columnUpdatedCount the column updated count - * @param columnRemovedCount the column removed count - */ - private void startSyncTable(SourceEntity entity, Plugin plugin, PluginService pluginService, Map databaseCache, Map> databaseTableCache, Map tableCache, Map> tableColumnCache, AtomicInteger tableAddedCount, AtomicInteger tableUpdatedCount, AtomicInteger tableRemovedCount, AtomicInteger columnAddedCount, AtomicInteger columnUpdatedCount, AtomicInteger columnRemovedCount) - { - String templateName = "SYSTEM_FOR_GET_ALL_TABLES"; - TemplateEntity template = getTemplate(templateName, entity); - if (template == null) { - log.warn("The source [ {} ] protocol [ {} ] template [ {} ] is not available, skip sync table", entity.getName(), entity.getProtocol(), templateName); - } - else { - Response response = pluginService.execute(entity.toConfigure(pluginManager, plugin), getSqlContext(template, null)); - if (!response.getIsSuccessful()) { - log.error("The source [ {} ] protocol [ {} ] sync metadata tables [ {} ] failed", entity.getName(), entity.getProtocol(), response.getMessage()); - } - else { - List entities = response.getColumns() - .stream() - .map(item -> { - String key = String.format("%s_%s", getNodeText(item, NodeType.CATALOG), getNodeText(item, NodeType.SCHEMA)); - DatabaseEntity database = databaseCache.get(key); - String name = getNodeText(item, NodeType.TABLE); - TableEntity configure = TableEntity.builder() - .name(name) - .description(String.format("Table [ %s ] of database [ %s ] ", name, getNodeText(item, NodeType.SCHEMA))) - .type(getNodeText(item, NodeType.TYPE)).engine(getNodeText(item, NodeType.ENGINE)) - .format(getNodeText(item, NodeType.FORMAT)) - .inCreateTime(getNodeText(item, NodeType.CREATE_TIME)) - .inUpdateTime(getNodeText(item, NodeType.UPDATE_TIME)) - .collation(getNodeText(item, NodeType.COLLATION)) - .rows(getNodeText(item, NodeType.ROWS)) - .comment(getNodeText(item, NodeType.COMMENT)) - .avgRowLength(getNodeText(item, NodeType.AVG_ROW)) - .dataLength(getNodeText(item, NodeType.DATA)) - .indexLength(getNodeText(item, NodeType.INDEX)) - .autoIncrement(getNodeText(item, NodeType.AUTO_INCREMENT)) - .database(database) - .build(); - if (StringUtils.isEmpty(configure.getCode())) { - configure.setCode(CodeUtils.generateCode(false)); - } - return configure; - }) - .collect(Collectors.toList()); - - Map> groupEntities = entities.stream().collect(Collectors.groupingBy(item -> String.format("%s_%s", item.getDatabase().getCatalog(), item.getDatabase().getName()))); - - groupEntities.forEach((key, groupItem) -> { - // Detect data that needs to be updated - List origin = databaseTableCache.get(key); - groupItem.forEach(item -> { - Optional optionalTable = origin.stream().filter(node -> node.getName().equals(item.getName())).findAny(); - if (optionalTable.isPresent()) { - TableEntity node = optionalTable.get(); - item.setId(node.getId()); - item.setCreateTime(node.getCreateTime()); - tableUpdatedCount.addAndGet(1); - } - else { - tableAddedCount.addAndGet(1); - } - }); - - log.info("Added table size [ {} ] to database [ {} ]", groupItem.size(), key); - tableHandler.saveAll(groupItem); - groupItem.forEach(item -> { - String tableCacheKey = String.format("%s_%s", item.getDatabase().getName(), item.getName()); - tableCache.put(tableCacheKey, item); - tableColumnCache.put(tableCacheKey, this.columnHandler.findSimpleAllByTable(item)); - }); - - List deleteEntities = origin.stream().filter(node -> groupItem.stream().noneMatch(item -> node.getName().equals(item.getName()))).collect(Collectors.toList()); - log.info("Removed table size [ {} ] from database [ {} ]", deleteEntities.size(), key); - tableHandler.deleteAll(deleteEntities); - tableRemovedCount.addAndGet(deleteEntities.size()); - }); - - this.startSyncColumn( - entity, - plugin, - pluginService, - tableCache, - tableColumnCache, - columnAddedCount, - columnUpdatedCount, - columnRemovedCount - ); - } - } - } - - /** - * Synchronizes the columns of a source entity with the corresponding table in the database. - * - * @param entity the source entity to sync the columns for - * @param plugin the plugin to connect to the database - * @param tableCache a cache of table entities for efficient lookup - * @param tableColumnCache a cache of column entities for efficient lookup - * @param columnAddedCount an atomic counter for tracking the number of columns added - * @param columnUpdatedCount an atomic counter for tracking the number of columns updated - * @param columnRemovedCount an atomic counter for tracking the number of columns removed - */ - private void startSyncColumn(SourceEntity entity, Plugin plugin, PluginService pluginService, Map tableCache, Map> tableColumnCache, AtomicInteger columnAddedCount, AtomicInteger columnUpdatedCount, AtomicInteger columnRemovedCount) - { - String templateName = "SYSTEM_FOR_GET_ALL_COLUMNS"; - TemplateEntity template = getTemplate(templateName, entity); - if (template == null) { - log.warn("The source [ {} ] protocol [ {} ] template [ {} ] is not available, skip sync column", entity.getName(), entity.getProtocol(), templateName); - } - else { - Response response = pluginService.execute(entity.toConfigure(pluginManager, plugin), getSqlContext(template, null)); - if (!response.getIsSuccessful()) { - log.error("The source [ {} ] protocol [ {} ] sync metadata columns [ {} ] failed", entity.getName(), entity.getProtocol(), response.getMessage()); - } - else { - List entities = response.getColumns() - .stream() - .map(item -> { - String key = String.format("%s_%s", getNodeText(item, NodeType.CATALOG), getNodeText(item, NodeType.SCHEMA)); - TableEntity table = tableCache.get(key); - String name = getNodeText(item, NodeType.COLUMN); - ColumnEntity configure = ColumnEntity.builder() - .name(name) - .description(String.format("Table [ %s ] of column [ %s ] ", table.getName(), name)) - .type(getNodeText(item, NodeType.COLUMN_TYPE)) - .comment(getNodeText(item, NodeType.COMMENT)) - .defaultValue(getNodeText(item, NodeType.DEFAULT)) - .position(getNodeText(item, NodeType.POSITION)) - .maximumLength(getNodeText(item, NodeType.MAXIMUM_LENGTH)) - .collation(getNodeText(item, NodeType.COLLATION)) - .isKey(getNodeText(item, NodeType.KEY)) - .privileges(getNodeText(item, NodeType.FORMAT)) - .dataType(getNodeText(item, NodeType.DATA_TYPE)) - .extra(getNodeText(item, NodeType.EXTRA)) - .isNullable(getNodeText(item, NodeType.NULLABLE)) - .table(table) - .build(); - if (StringUtils.isEmpty(configure.getCode())) { - configure.setCode(CodeUtils.generateCode(false)); - } - return configure; - }) - .collect(Collectors.toList()); - - Map> groupEntities = entities.stream().collect(Collectors.groupingBy(item -> String.format("%s_%s", item.getTable().getDatabase().getName(), item.getTable().getName()))); - - groupEntities.forEach((key, groupItem) -> { - // Detect data that needs to be updated - List origin = tableColumnCache.get(key); - groupItem.forEach(item -> { - Optional optionalColumn = origin.stream().filter(node -> node.getName().equals(item.getName())).findAny(); - if (optionalColumn.isPresent()) { - ColumnEntity node = optionalColumn.get(); - item.setId(node.getId()); - item.setCreateTime(node.getCreateTime()); - columnUpdatedCount.addAndGet(1); - } - else { - columnAddedCount.addAndGet(1); - } - }); - - log.info("Added column size [ {} ] to table [ {} ]", groupItem.size(), key); - columnHandler.saveAll(groupItem); - - List deleteEntities = origin.stream().filter(node -> groupItem.stream().noneMatch(item -> node.getName().equals(item.getName()))).collect(Collectors.toList()); - log.info("Removed column size [ {} ] from table [ {} ]", deleteEntities.size(), key); - columnHandler.deleteAll(deleteEntities); - columnRemovedCount.addAndGet(deleteEntities.size()); - }); - } - } - } } diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TableServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TableServiceImpl.java deleted file mode 100644 index fc910a8a3b..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TableServiceImpl.java +++ /dev/null @@ -1,735 +0,0 @@ -package io.edurt.datacap.service.service.impl; - -import com.google.common.collect.Lists; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.common.enums.ServiceState; -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.common.sql.SqlBuilder; -import io.edurt.datacap.common.sql.configure.SqlBody; -import io.edurt.datacap.common.sql.configure.SqlColumn; -import io.edurt.datacap.common.sql.configure.SqlOperator; -import io.edurt.datacap.common.sql.configure.SqlOrder; -import io.edurt.datacap.common.sql.configure.SqlType; -import io.edurt.datacap.common.utils.CSVUtils; -import io.edurt.datacap.fs.FsRequest; -import io.edurt.datacap.fs.FsResponse; -import io.edurt.datacap.fs.FsService; -import io.edurt.datacap.plugin.Plugin; -import io.edurt.datacap.plugin.PluginManager; -import io.edurt.datacap.service.body.ExportBody; -import io.edurt.datacap.service.body.TableBody; -import io.edurt.datacap.service.body.TableFilter; -import io.edurt.datacap.service.entity.BaseEntity; -import io.edurt.datacap.service.entity.ColumnEntity; -import io.edurt.datacap.service.entity.DatabaseEntity; -import io.edurt.datacap.service.entity.SourceEntity; -import io.edurt.datacap.service.entity.TableEntity; -import io.edurt.datacap.service.entity.UserEntity; -import io.edurt.datacap.service.initializer.InitializerConfigure; -import io.edurt.datacap.service.repository.metadata.ColumnRepository; -import io.edurt.datacap.service.repository.metadata.DatabaseRepository; -import io.edurt.datacap.service.repository.metadata.TableRepository; -import io.edurt.datacap.service.security.UserDetailsService; -import io.edurt.datacap.service.service.TableService; -import io.edurt.datacap.spi.PluginService; -import io.edurt.datacap.spi.model.Configure; -import io.edurt.datacap.spi.model.Pagination; -import io.edurt.datacap.spi.model.Response; -import io.edurt.datacap.sql.builder.ColumnBuilder; -import io.edurt.datacap.sql.builder.TableBuilder; -import io.edurt.datacap.sql.model.Column; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.io.Resource; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; - -import javax.servlet.http.HttpServletRequest; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; - -@Slf4j -@Service -@SuppressFBWarnings(value = {"EI_EXPOSE_REP2"}) -public class TableServiceImpl - implements TableService -{ - private final PluginManager pluginManager; - private final TableRepository repository; - private final DatabaseRepository databaseRepository; - private final ColumnRepository columnRepository; - private final InitializerConfigure initializerConfigure; - private final HttpServletRequest request; - - public TableServiceImpl(PluginManager pluginManager, TableRepository repository, DatabaseRepository databaseRepository, ColumnRepository columnRepository, InitializerConfigure initializerConfigure, HttpServletRequest request) - { - this.pluginManager = pluginManager; - this.repository = repository; - this.databaseRepository = databaseRepository; - this.columnRepository = columnRepository; - this.initializerConfigure = initializerConfigure; - this.request = request; - } - - @Override - public CommonResponse> getAllByDatabase(String code) - { - return databaseRepository.findByCode(code) - .map(value -> CommonResponse.success(this.repository.findAllByDatabase(value))) - .orElseGet(() -> CommonResponse.failure(String.format("Database [ %s ] not found", code))); - } - - @Override - public CommonResponse fetchData(String code, TableFilter configure) - { - return repository.findByCode(code) - .map(table -> { - SourceEntity source = table.getDatabase().getSource(); - return pluginManager.getPlugin(source.getType()) - .map(plugin -> { - PluginService pluginService = plugin.getService(PluginService.class); - if (configure.getType().equals(SqlType.SELECT)) { - return this.fetchSelect(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.INSERT)) { - return this.fetchInsert(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.UPDATE)) { - return this.fetchUpdate(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.DELETE)) { - return this.fetchDelete(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.ALTER)) { - return this.fetchAlter(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.SHOW)) { - return this.fetchShowCreateTable(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.TRUNCATE)) { - return this.fetchTruncateTable(plugin, pluginService, table, source, configure); - } - else if (configure.getType().equals(SqlType.DROP)) { - return this.fetchDropTable(plugin, pluginService, table, source, configure); - } - return CommonResponse.failure(String.format("Not implemented yet [ %s ]", configure.getType())); - }) - .orElseGet(() -> CommonResponse.failure(ServiceState.PLUGIN_NOT_FOUND)); - }) - .orElse(CommonResponse.failure(String.format("Table [ %s ] not found", code))); - } - - @Override - public CommonResponse exportDataByCode(String code, ExportBody configure) - { - TableEntity table = this.repository.findByCode(code) - .orElse(null); - if (table == null) { - return CommonResponse.failure(String.format("Table [ %s ] not found", code)); - } - - SourceEntity source = table.getDatabase().getSource(); - return pluginManager.getPlugin(source.getType()) - .map(plugin -> { - PluginService pluginService = plugin.getService(PluginService.class); - return pluginManager.getPlugin(initializerConfigure.getFsConfigure().getType()) - .map(fsPlugin -> { - FsService fsService = fsPlugin.getService(FsService.class); - UserEntity user = UserDetailsService.getUser(); - String endpoint = String.join(File.separator, initializerConfigure.getDataHome(), user.getUsername(), "export"); - log.info("Export data user [ {} ] home [ {} ]", user.getUsername(), endpoint); - String fileName = String.join(".", UUID.randomUUID().toString(), "csv"); - log.info("Export file name [ {} ]", fileName); - Integer count = Integer.MAX_VALUE; - if (configure.getCount() > 0) { - count = configure.getCount().intValue(); - } - Pagination pagination = Pagination.newInstance(count.intValue(), 1, count.intValue()); - TableFilter tableFilter = TableFilter.builder() - .type(SqlType.SELECT) - .pagination(pagination) - .build(); - CommonResponse tempResponse = this.fetchSelect(plugin, pluginService, table, source, tableFilter); - if (tempResponse.getStatus()) { - Response pluginResponse = (Response) tempResponse.getData(); - try { - File tempFile = CSVUtils.makeTempCSV(endpoint, fileName, pluginResponse.getHeaders(), pluginResponse.getColumns()); - log.info("Export temp file [ {} ]", tempFile.getAbsolutePath()); - FsRequest fsRequest = FsRequest.builder() - .access(initializerConfigure.getFsConfigure().getAccess()) - .secret(initializerConfigure.getFsConfigure().getSecret()) - .endpoint(endpoint) - .bucket(initializerConfigure.getFsConfigure().getBucket()) - .stream(Files.newInputStream(tempFile.toPath())) - .fileName(fileName) - .build(); - fsService.writer(fsRequest); - if (initializerConfigure.getFsConfigure().getType().equals("Local")) { - String address = request.getRequestURL() - .toString() - .replace(request.getServletPath().trim(), ""); - String remote = String.join("/", address, "api/v1/table/dataDownload", user.getUsername(), fileName); - return CommonResponse.success(remote); - } - } - catch (Exception ex) { - return CommonResponse.failure(ex.getMessage()); - } - } - return CommonResponse.failure(ServiceState.REQUEST_EXCEPTION); - }) - .orElseGet(() -> CommonResponse.failure(String.format("Not found Fs [ %s ]", initializerConfigure.getFsConfigure().getType()))); - }) - .orElseGet(() -> CommonResponse.failure(String.format("Plugin [ %s ] not found", source.getType()))); - } - - @Override - public Object dataDownload(String username, String filename) - { - return pluginManager.getPlugin(initializerConfigure.getFsConfigure().getType()) - .map(plugin -> { - String endpoint = String.join(File.separator, initializerConfigure.getDataHome(), username, "export"); - log.info("Download data user [ {} ] home [ {} ]", username, endpoint); - String filePath = String.join(File.separator, endpoint, filename); - log.info("Download file path [ {} ]", filePath); - FsRequest fsRequest = FsRequest.builder() - .access(initializerConfigure.getFsConfigure().getAccess()) - .secret(initializerConfigure.getFsConfigure().getSecret()) - .endpoint(endpoint) - .bucket(initializerConfigure.getFsConfigure().getBucket()) - .fileName(filename) - .build(); - - FsService fsService = plugin.getService(FsService.class); - FsResponse response = fsService.reader(fsRequest); - try { - Resource resource = new FileSystemResource(response.getRemote()); - HttpHeaders headers = new HttpHeaders(); - headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + resource.getFilename()); - return ResponseEntity.ok() - .headers(headers) - .contentLength(resource.contentLength()) - .contentType(MediaType.APPLICATION_OCTET_STREAM) - .body(resource); - } - catch (IOException e) { - throw new RuntimeException(e); - } - }) - .orElseThrow(() -> new RuntimeException("Not found plugin")); - } - - @Override - public CommonResponse createTable(Long databaseId, TableBody configure) - { - Optional optionalDatabase = this.databaseRepository.findById(databaseId); - if (!optionalDatabase.isPresent()) { - return CommonResponse.failure(String.format("Database [ %s ] not found", databaseId)); - } - - DatabaseEntity database = optionalDatabase.get(); - SourceEntity source = database.getSource(); - return pluginManager.getPlugin(source.getType()) - .map(plugin -> { - PluginService pluginService = plugin.getService(PluginService.class); - TableBuilder.Companion.BEGIN(); - TableBuilder.Companion.CREATE_TABLE(String.format("`%s`.`%s`", database.getName(), configure.getName())); - TableBuilder.Companion.COLUMNS(configure.getColumns().stream().map(item -> item.toColumnVar()).collect(Collectors.toList())); - String sql = TableBuilder.Companion.SQL(); - log.info("Create table sql \n {} \n on database [ {} ]", sql, database.getName()); - Configure pConfigure = source.toConfigure(pluginManager, plugin); - pConfigure.setPluginManager(pluginManager); - Response response = pluginService.execute(pConfigure, sql); - response.setContent(sql); - return CommonResponse.success(response); - }) - .orElseGet(() -> CommonResponse.failure("Not found plugin")); - } - - @Override - public CommonResponse manageColumn(String code, TableBody configure) - { - return repository.findByCode(code) - .map(table -> { - SourceEntity source = table.getDatabase().getSource(); - return pluginManager.getPlugin(source.getType()) - .map(plugin -> { - AtomicReference atomicReference = new AtomicReference<>(null); - - // 根据操作类型构建 SQL - if (configure.getType().equals(SqlType.CREATE)) { - ColumnBuilder.Companion.BEGIN(); - ColumnBuilder.Companion.CREATE_COLUMN(String.format("`%s`.`%s`", - table.getDatabase().getName(), table.getName())); - ColumnBuilder.Companion.COLUMNS(configure.getColumns().stream() - .map(Column::toColumnVar) - .collect(Collectors.toList())); - atomicReference.set(ColumnBuilder.Companion.SQL()); - log.info("Create column sql \n {} \n on table [ {} ]", - atomicReference.get(), table.getName()); - } - else if (configure.getType().equals(SqlType.DROP)) { - columnRepository.findById(configure.getColumnId()) - .ifPresent(column -> { - ColumnBuilder.Companion.BEGIN(); - ColumnBuilder.Companion.DROP_COLUMN(String.format("`%s`.`%s`", - table.getDatabase().getName(), table.getName())); - ColumnBuilder.Companion.COLUMNS(Lists.newArrayList(column.getName())); - atomicReference.set(ColumnBuilder.Companion.SQL()); - }); - log.info("Drop column sql \n {} \n on table [ {} ]", - atomicReference.get(), table.getName()); - } - else if (configure.getType().equals(SqlType.MODIFY)) { - ColumnBuilder.Companion.BEGIN(); - ColumnBuilder.Companion.MODIFY_COLUMN(String.format("`%s`.`%s`", - table.getDatabase().getName(), table.getName())); - ColumnBuilder.Companion.COLUMNS(configure.getColumns().stream() - .map(Column::toColumnVar) - .collect(Collectors.toList())); - atomicReference.set(ColumnBuilder.Companion.SQL()); - log.info("Modify column sql \n {} \n on table [ {} ]", - atomicReference.get(), table.getName()); - } - - // 处理 SQL 执行或预览 - Response response; - if (configure.isPreview()) { - response = Response.builder() - .isSuccessful(true) - .isConnected(true) - .headers(Lists.newArrayList()) - .columns(Lists.newArrayList()) - .types(Lists.newArrayList()) - .content(atomicReference.get()) - .build(); - } - else { - Configure pConfigure = source.toConfigure(pluginManager, plugin); - pConfigure.setPluginManager(pluginManager); - PluginService pluginService = plugin.getService(PluginService.class); - response = pluginService.execute(pConfigure, atomicReference.get()); - response.setContent(atomicReference.get()); - } - return CommonResponse.success(response); - }) - .orElse(CommonResponse.failure(ServiceState.PLUGIN_NOT_FOUND)); - }) - .orElse(CommonResponse.failure(String.format("Table [ %s ] not found", code))); - } - - /** - * Fetches the selected data from the specified table in a database. - * - * @param plugin the plugin instance - * @param table the table entity - * @param source the source entity - * @param configure the table filter configuration - * @return the common response object containing the fetched data - */ - private CommonResponse fetchSelect(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - List columns = Lists.newArrayList(); - int totalRows = Integer.parseInt(table.getRows()); - Configure countConfigure = source.toConfigure(pluginManager, plugin); - countConfigure.setFormat("NoneConvert"); - SqlBody countBody = SqlBody.builder() - .type(SqlType.SELECT) - .database(table.getDatabase().getName()) - .table(table.getName()) - .columns(Collections.singletonList(SqlColumn.builder() - .column("COUNT(1)") - .build())) - .build(); - if (configure.getFilter() != null) { - countBody.setCondition(configure.getFilter().getCondition()); - countBody.setWhere(configure.getFilter().getFilters()); - } - SqlBuilder countBuilder = new SqlBuilder(countBody); - String countSql = countBuilder.getSql(); - Response countResponse = pluginService.execute( - countConfigure, - countSql - ); - if (countResponse.getIsSuccessful() && !countResponse.getColumns().isEmpty()) { - List applyResponse = (ArrayList) countResponse.getColumns().get(0); - int applyTotal = Integer.parseInt(String.valueOf(applyResponse.get(0))); - if (totalRows != applyTotal) { - totalRows = applyTotal; - table.setRows(String.valueOf(totalRows)); - this.repository.save(table); - } - } - - // If the columns of the query are not passed, they are obtained through metadata - if (configure.getColumns() == null || configure.getColumns().size() == 0) { - table.getColumns() - .stream() - .sorted(Comparator.comparing(item -> Integer.parseInt(item.getPosition()))) - .forEach(column -> columns.add(SqlColumn.builder() - .column(String.format("`%s`", column.getName())) - .build())); - } - else { - configure.getColumns() - .forEach(column -> columns.add(SqlColumn.builder() - .column(String.format("`%s`", column.getColumn())) - .build())); - } - int offset = configure.getPagination().getPageSize() * (configure.getPagination().getCurrentPage() - 1); - SqlBody body = SqlBody.builder() - .type(SqlType.SELECT) - .database(table.getDatabase().getName()) - .table(table.getName()) - .columns(columns) - .limit(configure.getPagination().getPageSize()) - .offset(offset) - .build(); - - if (configure.getOrders() != null) { - List orderColumns = Lists.newArrayList(); - configure.getOrders() - .stream() - .filter(item -> StringUtils.isNotEmpty(item.getOrder())) - .forEach(item -> orderColumns.add(SqlColumn.builder() - .column(item.getColumn()) - .order(SqlOrder.valueOf(item.getOrder().toUpperCase())) - .build())); - body.setOrders(orderColumns); - } - - if (configure.getFilter() != null) { - body.setCondition(configure.getFilter().getCondition()); - body.setWhere(configure.getFilter().getFilters()); - } - - SqlBuilder builder = new SqlBuilder(body); - String sql = builder.getSql(); - Configure pConfigure = source.toConfigure(pluginManager, plugin); - Response response = pluginService.execute( - pConfigure, - sql - ); - Pagination pagination = Pagination.newInstance(configure.getPagination().getPageSize(), configure.getPagination().getCurrentPage(), totalRows); - response.setPagination(pagination); - return CommonResponse.success(response); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches and inserts data into the database table. - * - * @param plugin the plugin object - * @param table the table entity object - * @param source the source entity object - * @param configure the table filter object - * @return the common response object containing the result of the operation - */ - private CommonResponse fetchInsert(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure updateConfigure = source.toConfigure(pluginManager, plugin); - updateConfigure.setFormat("NoneConvert"); - List allSql = Lists.newArrayList(); - // Gets the auto-increment column for the current row - List autoIncrementColumns = table.getColumns() - .stream() - .filter(v -> v.getExtra().toLowerCase().contains("auto_increment")) - .map(BaseEntity::getName) - .collect(Collectors.toList()); - configure.getNewColumns().forEach(v -> { - List columns = Lists.newArrayList(); - v.entrySet().forEach(entry -> { - SqlColumn column = SqlColumn.builder() - .column(String.format("`%s`", entry.getKey())) - .build(); - if (entry.getValue() == null) { - column.setValue(null); - } - else { - if (autoIncrementColumns.contains(entry.getKey())) { - column.setValue(null); - } - else { - column.setValue(String.format("'%s'", StringEscapeUtils.escapeSql(entry.getValue()))); - } - } - columns.add(column); - }); - SqlBody body = SqlBody.builder() - .type(SqlType.INSERT) - .database(table.getDatabase().getName()) - .table(table.getName()) - .columns(columns) - .build(); - allSql.add(new SqlBuilder(body).getSql()); - }); - String sql = String.join("\n\n", allSql); - return CommonResponse.success(getResponse(configure, pluginService, sql, updateConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches and updates data from a table using the specified plugin, table, source, and configure. - * - * @param plugin the plugin to be used for fetching and updating data - * @param table the table from which the data will be fetched and updated - * @param source the source entity containing the data source configuration - * @param configure the table filter configuration for fetching and updating the data - * @return the response containing the fetched and updated data - */ - private CommonResponse fetchUpdate(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure updateConfigure = source.toConfigure(pluginManager, plugin); - updateConfigure.setFormat("NoneConvert"); - List allSql = Lists.newArrayList(); - configure.getColumns().forEach(v -> { - SqlBody body = SqlBody.builder() - .type(SqlType.UPDATE) - .database(table.getDatabase().getName()) - .table(table.getName()) - .columns(Arrays.asList(v)) - .where(applyColumns(table, configure, v) - .stream() - .distinct() - .collect(Collectors.toList())) - .build(); - allSql.add(new SqlBuilder(body).getSql()); - }); - String sql = String.join("\n\n", allSql); - return CommonResponse.success(getResponse(configure, pluginService, sql, updateConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches and deletes data from the database. - * - * @param plugin the plugin to use for connecting to the database - * @param table the table from which to delete the data - * @param source the source entity to use for configuring the connection - * @param configure the table filter to use for filtering the data to be deleted - * @return the response containing the result of the delete operation - */ - private CommonResponse fetchDelete(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure updateConfigure = source.toConfigure(pluginManager, plugin); - updateConfigure.setFormat("NoneConvert"); - List allSql = Lists.newArrayList(); - configure.getColumns().forEach(v -> { - SqlBody body = SqlBody.builder() - .type(SqlType.DELETE) - .database(table.getDatabase().getName()) - .table(table.getName()) - .where(applyColumns(table, configure, v)) - .build(); - allSql.add(new SqlBuilder(body).getSql()); - }); - String sql = String.join("\n\n", allSql); - return CommonResponse.success(getResponse(configure, pluginService, sql, updateConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches an alter operation for a given plugin, table, source, and table filter. - * - * @param plugin the plugin to use for the alter operation - * @param table the table entity to perform the alter operation on - * @param source the source entity to configure the alter operation - * @param configure the table filter to apply to the alter operation - * @return a CommonResponse object containing the result of the alter operation - */ - private CommonResponse fetchAlter(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure alterConfigure = source.toConfigure(pluginManager, plugin); - alterConfigure.setFormat("NoneConvert"); - SqlBody body = SqlBody.builder() - .type(SqlType.ALTER) - .database(table.getDatabase().getName()) - .table(table.getName()) - .value(configure.getValue()) - .build(); - return CommonResponse.success(getResponse(configure, pluginService, new SqlBuilder(body).getSql(), alterConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches the "SHOW CREATE TABLE" query for a given table. - * - * @param plugin the plugin to use for connecting to the database - * @param table the table entity for which to fetch the query - * @param source the source entity containing the database configuration - * @param configure the table filter configuration - * @return the common response object containing the result of the query - */ - private CommonResponse fetchShowCreateTable(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure alterConfigure = source.toConfigure(pluginManager, plugin); - alterConfigure.setFormat("NoneConvert"); - SqlBody body = SqlBody.builder() - .type(SqlType.SHOW) - .database(table.getDatabase().getName()) - .table(table.getName()) - .build(); - return CommonResponse.success(getResponse(configure, pluginService, new SqlBuilder(body).getSql(), alterConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches and truncates a table. - * - * @param plugin the plugin associated with the table - * @param table the table entity to fetch and truncate - * @param source the source entity associated with the table - * @param configure the table filter configuration - * @return the common response object containing the fetch and truncate result - */ - private CommonResponse fetchTruncateTable(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure alterConfigure = source.toConfigure(pluginManager, plugin); - alterConfigure.setFormat("NoneConvert"); - SqlBody body = SqlBody.builder() - .type(SqlType.TRUNCATE) - .database(table.getDatabase().getName()) - .table(table.getName()) - .build(); - return CommonResponse.success(getResponse(configure, pluginService, new SqlBuilder(body).getSql(), alterConfigure)); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Fetches the drop table operation for the given table and source. - * - * @param plugin the plugin instance - * @param table the table entity - * @param source the source entity - * @param configure the table filter configuration - * @return the common response object containing the fetched result - */ - private CommonResponse fetchDropTable(Plugin plugin, PluginService pluginService, TableEntity table, SourceEntity source, TableFilter configure) - { - try { - Configure alterConfigure = source.toConfigure(pluginManager, plugin); - alterConfigure.setFormat("NoneConvert"); - SqlBody body = SqlBody.builder() - .type(SqlType.DROP) - .database(table.getDatabase().getName()) - .table(table.getName()) - .value(configure.getValue()) - .build(); - Response response = getResponse(configure, pluginService, new SqlBuilder(body).getSql(), alterConfigure); - if (!configure.isPreview() && response.getIsSuccessful()) { - repository.delete(table); - } - return CommonResponse.success(response); - } - catch (Exception ex) { - return CommonResponse.failure(ExceptionUtils.getMessage(ex)); - } - } - - /** - * Applies the columns of a table to a given configuration. - * - * @param table the table entity containing the columns - * @param configure the table filter configuration to apply the columns to - * @param column the SQL column to apply - * @return a list of SQL columns that match the applied configuration - */ - private List applyColumns(TableEntity table, TableFilter configure, SqlColumn column) - { - List wheres = Lists.newArrayList(); - List originColumns = table.getColumns() - .stream() - .filter(item -> item.getIsKey().equals("PRI")) - .collect(Collectors.toList()); - if (!originColumns.isEmpty()) { - // If the table contains a primary key, update the data using the primary key as a condition - originColumns.forEach(item -> wheres.add(SqlColumn.builder() - .column(item.getName()) - .operator(SqlOperator.EQ) - .value(String.valueOf(column.getOriginal().get(item.getName()))) - .build())); - } - else { - // If the current data does not have a primary key, it is updated based on all data columns - table.getColumns() - .forEach(item -> wheres.add(SqlColumn.builder() - .column(item.getName()) - .operator(SqlOperator.EQ) - .value(String.valueOf(column.getOriginal().get(item.getName()))) - .build())); - } - return wheres; - } - - /** - * Retrieves a response based on the provided table filter, plugin, and SQL query. - * - * @param configure the table filter to configure the response - * @param plugin the plugin to execute the SQL query - * @param sql the SQL query to execute - * @return the response containing the result of the SQL query - */ - private Response getResponse(TableFilter filter, PluginService plugin, String sql, Configure configure) - { - Response response; - if (filter.isPreview()) { - response = Response.builder() - .isSuccessful(true) - .isConnected(true) - .headers(Lists.newArrayList()) - .columns(Lists.newArrayList()) - .types(Lists.newArrayList()) - .content(sql) - .build(); - } - else { - response = plugin.execute(configure, sql); - response.setContent(sql); - } - return response; - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TemplateSqlServiceImpl.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TemplateSqlServiceImpl.java deleted file mode 100644 index 6ee9b760d4..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/service/impl/TemplateSqlServiceImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -package io.edurt.datacap.service.service.impl; - -import com.fasterxml.jackson.core.JsonProcessingException; -import io.edurt.datacap.common.enums.ServiceState; -import io.edurt.datacap.common.enums.Type; -import io.edurt.datacap.common.response.CommonResponse; -import io.edurt.datacap.common.utils.JsonUtils; -import io.edurt.datacap.service.adapter.PageRequestAdapter; -import io.edurt.datacap.service.body.FilterBody; -import io.edurt.datacap.service.body.TemplateSqlBody; -import io.edurt.datacap.service.entity.ExecuteEntity; -import io.edurt.datacap.service.entity.PageEntity; -import io.edurt.datacap.service.entity.SourceEntity; -import io.edurt.datacap.service.entity.TemplateEntity; -import io.edurt.datacap.service.itransient.SqlConfigure; -import io.edurt.datacap.service.repository.SourceRepository; -import io.edurt.datacap.service.repository.TemplateSqlRepository; -import io.edurt.datacap.service.service.ExecuteService; -import io.edurt.datacap.service.service.TemplateSqlService; -import org.apache.commons.lang3.EnumUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -@Service -public class TemplateSqlServiceImpl - implements TemplateSqlService -{ - private static String regex = "\\$\\{\\s*\\S*\\}"; - - private final TemplateSqlRepository templateSqlRepository; - private final SourceRepository sourceRepository; - private final ExecuteService executeService; - - public TemplateSqlServiceImpl(TemplateSqlRepository templateSqlRepository, SourceRepository sourceRepository, ExecuteService executeService) - { - this.templateSqlRepository = templateSqlRepository; - this.sourceRepository = sourceRepository; - this.executeService = executeService; - } - - @Override - public CommonResponse saveOrUpdate(TemplateEntity configure) - { - if (ObjectUtils.isEmpty(configure.getId())) { - List templateEntities = this.templateSqlRepository.findByName(configure.getName()); - boolean skip = false; - if (!templateEntities.isEmpty()) { - for (TemplateEntity templateEntity : templateEntities) { - for (String plugin : templateEntity.getPlugin().split(",")) { - if (configure.getPlugin().contains(plugin)) { - skip = true; - break; - } - } - } - } - if (skip) { - return CommonResponse.failure(ServiceState.PLUGIN_ONLY_ONE_TEMPLATE); - } - } - // Building configure - String json; - if (StringUtils.isEmpty(configure.getConfigure()) || ObjectUtils.isEmpty(configure.getConfigure())) { - List sqlConfigureList = new ArrayList<>(); - String[] fieldAndTypes = configure.getContent().split("\n"); - for (int i = 0; i < fieldAndTypes.length; i++) { - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(fieldAndTypes[i]); - if (matcher.find()) { - String matcherValue = matcher.group(0).replace("${", "").replace("}", ""); - if (matcherValue.contains(":")) { - String[] fieldAndType = matcherValue.split(":"); - if (fieldAndType.length == 2) { - Optional sqlConfigure = sqlConfigureList.stream().filter(v -> v.getColumn().equalsIgnoreCase(fieldAndType[0])).findFirst(); - if (!sqlConfigure.isPresent()) { - if (ObjectUtils.isEmpty(EnumUtils.getEnum(Type.class, fieldAndType[1]))) { - StringBuffer buffer = new StringBuffer(); - buffer.append(ServiceState.REQUEST_VALID_TYPE.getValue()); - buffer.append("
"); - buffer.append(String.format("Field : %s", fieldAndType[0])); - buffer.append("
"); - buffer.append(String.format("Type : %s", fieldAndType[1])); - buffer.append("
"); - buffer.append(String.format("Line : %s", (i + 1))); - return CommonResponse.failure(ServiceState.REQUEST_VALID_TYPE, buffer.toString()); - } - SqlConfigure s = new SqlConfigure(); - s.setColumn(fieldAndType[0]); - s.setType(Type.valueOf(fieldAndType[1])); - s.setExpression(matcher.group(0)); - sqlConfigureList.add(s); - } - } - } - } - } - json = JsonUtils.toJSON(sqlConfigureList); - } - else { - json = JsonUtils.toJSON(configure.getConfigure()); - } - configure.setConfigure(json); - return CommonResponse.success(this.templateSqlRepository.save(configure)); - } - - @Override - public CommonResponse> getAllByFilter(FilterBody filter) - { - Pageable pageable = PageRequestAdapter.of(filter); - return CommonResponse.success(PageEntity.build(this.templateSqlRepository.findAll(pageable))); - } - - @Override - public CommonResponse getById(Long id) - { - return templateSqlRepository.findById(id) - .map(CommonResponse::success) - .orElse(CommonResponse.failure(String.format("Template [ %s ] not found", id))); - } - - @Override - public CommonResponse execute(TemplateSqlBody configure) - { - Optional sourceEntity = this.sourceRepository.findById(configure.getSourceId()); - if (sourceEntity.isEmpty()) { - return CommonResponse.failure(ServiceState.SOURCE_NOT_FOUND); - } - - TemplateEntity sqlEntity = this.templateSqlRepository.findByNameAndPluginContaining(configure.getTemplateName(), sourceEntity.get().getType()); - if (ObjectUtils.isEmpty(sqlEntity)) { - return CommonResponse.failure(ServiceState.SOURCE_NOT_SUPPORTED); - } - if (sqlEntity.getPlugin().indexOf(sourceEntity.get().getType()) == -1) { - return CommonResponse.failure(ServiceState.SOURCE_NOT_SUPPORTED); - } - - ExecuteEntity executeConfigure = new ExecuteEntity(); - final String[] content = {sqlEntity.getContent()}; - try { - if (ObjectUtils.isNotEmpty(configure.getConfigure())) { - List configures = JsonUtils.objectmapper.readValue(sqlEntity.getConfigure(), List.class); - configure.getConfigure().entrySet().forEach(value -> { - Optional sqlConfigure = configures.stream() - .filter(v -> String.valueOf(v.get("column")).equalsIgnoreCase(value.getKey())) - .map(v -> { - SqlConfigure configure1 = new SqlConfigure(); - configure1.setColumn(v.get("column").toString()); - configure1.setType(Type.valueOf(String.valueOf(v.get("type")))); - configure1.setExpression(String.valueOf(v.get("expression"))); - return configure1; - }) - .findFirst(); - if (sqlConfigure.isPresent()) { - content[0] = content[0].replace(sqlConfigure.get().getExpression(), String.valueOf(value.getValue())); - } - }); - } - executeConfigure.setContent(content[0]); - executeConfigure.setFormat("JsonConvert"); - executeConfigure.setName(String.valueOf(configure.getSourceId())); - } - catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - return this.executeService.execute(executeConfigure); - } -} diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/source/SyncMetadataScheduledRunnable.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/source/SyncMetadataScheduledRunnable.java deleted file mode 100644 index 96f856e991..0000000000 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/source/SyncMetadataScheduledRunnable.java +++ /dev/null @@ -1,177 +0,0 @@ -package io.edurt.datacap.service.source; - -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import io.edurt.datacap.plugin.PluginManager; -import io.edurt.datacap.schedule.ScheduledRunnable; -import io.edurt.datacap.service.entity.SourceEntity; -import io.edurt.datacap.service.repository.SourceRepository; -import io.edurt.datacap.service.service.SourceService; -import lombok.extern.slf4j.Slf4j; - -import java.util.List; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * 数据源元数据同步定时任务运行器 - * Scheduled task runner for synchronizing data source metadata - * - *

- * 该类使用函数式编程方式实现数据源元数据的并行同步 - * This class implements parallel synchronization of data source metadata using functional programming - *

- */ -@Slf4j -@SuppressFBWarnings(value = {"REC_CATCH_EXCEPTION", "EI_EXPOSE_REP2"}) -public class SyncMetadataScheduledRunnable - extends ScheduledRunnable -{ - /** - * 插件管理器 Plugin manager - */ - private final PluginManager pluginManager; - - /** - * 数据源仓库 Source repository - */ - private final SourceRepository sourceRepository; - - /** - * 数据源服务 Source service - */ - private final SourceService sourceService; - - /** - * 构造函数 Constructor - */ - public SyncMetadataScheduledRunnable(String name, - PluginManager pluginManager, - SourceRepository sourceRepository, - SourceService sourceService) - { - super(name); - this.pluginManager = pluginManager; - this.sourceRepository = sourceRepository; - this.sourceService = sourceService; - } - - /** - * 执行元数据同步任务 - * Execute metadata synchronization task - */ - @Override - public void run() - { - logTaskStart() - .andThen(this::executeSyncTask) - .andThen(this::logTaskEnd) - .accept(getName()); - } - - /** - * 记录任务开始 - * Log task start - * - * @return 返回一个消费者函数 Returns a consumer function - */ - private Consumer logTaskStart() - { - return taskName -> log.info("==================== {} started =================", taskName); - } - - /** - * 记录任务结束 - * Log task end - */ - private void logTaskEnd(String taskName) - { - log.info("==================== {} ended =================", taskName); - } - - /** - * 执行同步任务 - * Execute synchronization task - * - * @param taskName 任务名称 Task name - */ - private void executeSyncTask(String taskName) - { - try { - sourceRepository.findAll() - .stream() - .map(this::createSyncOperation) - .collect(Collectors.collectingAndThen( - Collectors.toList(), - this::executeParallelSync - )); - } - catch (Exception e) { - log.error("Failed to execute metadata sync task: {}", e.getMessage(), e); - } - } - - /** - * 创建同步操作 - * Create synchronization operation - * - * @param source 数据源 Source - * @return 返回一个异步操作 Returns an async operation - */ - private CompletableFuture createSyncOperation(SourceEntity source) - { - return CompletableFuture.runAsync(() -> - Optional.of(source) - .map(SourceEntity::getCode) - .ifPresent(this::syncSourceMetadata) - ); - } - - /** - * 执行并行同步 - * Execute parallel synchronization - * - * @param futures 异步操作列表 List of async operations - */ - private Void executeParallelSync(List> futures) - { - try { - CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])) - .join(); - } - catch (Exception e) { - log.error("Error in parallel execution: {}", e.getMessage(), e); - } - return null; - } - - /** - * 同步单个数据源的元数据 - * Synchronize metadata for a single data source - * - * @param code 数据源ID Source ID - */ - private void syncSourceMetadata(String code) - { - Function getSourceName = id -> - sourceRepository.findByCode(id) - .map(SourceEntity::getName) - .orElse("Unknown"); - - Consumer syncOperation = id -> { - String sourceName = getSourceName.apply(id); - try { - log.debug("Starting metadata sync for source: {}", sourceName); - sourceService.syncMetadata(id); - log.debug("Completed metadata sync for source: {}", sourceName); - } - catch (Exception e) { - log.error("Failed to sync metadata for source {}: {}", sourceName, e.getMessage(), e); - } - }; - - syncOperation.accept(code); - } -} diff --git a/core/datacap-spi/pom.xml b/core/datacap-spi/pom.xml index c130b79733..56ae114916 100644 --- a/core/datacap-spi/pom.xml +++ b/core/datacap-spi/pom.xml @@ -5,7 +5,7 @@ datacap io.edurt.datacap - 2024.4.1 + 2025.1.0 ../../pom.xml 4.0.0 diff --git a/core/datacap-spi/src/main/java/io/edurt/datacap/spi/PluginService.java b/core/datacap-spi/src/main/java/io/edurt/datacap/spi/PluginService.java index 11349ef6b7..07f6cdb733 100644 --- a/core/datacap-spi/src/main/java/io/edurt/datacap/spi/PluginService.java +++ b/core/datacap-spi/src/main/java/io/edurt/datacap/spi/PluginService.java @@ -12,6 +12,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.text.MessageFormat; import java.util.List; import java.util.Map; import java.util.Optional; @@ -146,6 +147,88 @@ default Response execute(Configure configure, String content) return this.execute(content); } + default Response getDatabases(Configure configure) + { + String sql = "SELECT\n" + + " SCHEMA_NAME AS object_name,\n" + + " 'DATABASE' AS object_type,\n" + + " '' AS object_comment\n" + + "FROM information_schema.SCHEMATA;"; + return this.execute(configure, sql); + } + + /** + * 根据数据库获取数据表结构 + * Get table structure by database + * + * @param configure 配置信息 | Configuration information + * @param database 数据库 | Database + * @return 数据表结构 | Table structure + */ + default Response getTablesForTable(Configure configure, String database) + { + String sql = MessageFormat.format( + "SELECT\n" + + " CASE\n" + + " WHEN type = 'BASE TABLE' THEN '表'\n" + + " WHEN type = 'VIEW' THEN '视图'\n" + + " WHEN type = 'FUNCTION' THEN '函数'\n" + + " WHEN type = 'PROCEDURE' THEN '存储过程'\n" + + " END AS type_name,\n" + + " object_name,\n" + + " object_comment\n" + + "FROM (\n" + + " -- 表\n" + + " SELECT\n" + + " 'BASE TABLE' as type,\n" + + " TABLE_NAME as object_name,\n" + + " TABLE_COMMENT as object_comment\n" + + " FROM information_schema.TABLES\n" + + " WHERE TABLE_SCHEMA = '{0}'\n" + + " AND TABLE_TYPE = 'BASE TABLE'\n" + + "\n" + + " UNION ALL\n" + + "\n" + + " -- 视图\n" + + " SELECT\n" + + " 'VIEW' as type,\n" + + " TABLE_NAME as object_name,\n" + + " TABLE_COMMENT as object_comment\n" + + " FROM information_schema.TABLES\n" + + " WHERE TABLE_SCHEMA = '{0}'\n" + + " AND TABLE_TYPE = 'VIEW'\n" + + "\n" + + " UNION ALL\n" + + "\n" + + " -- 函数\n" + + " SELECT\n" + + " 'FUNCTION' as type,\n" + + " ROUTINE_NAME as object_name,\n" + + " ROUTINE_COMMENT as object_comment\n" + + " FROM information_schema.ROUTINES\n" + + " WHERE ROUTINE_SCHEMA = '{0}'\n" + + " AND ROUTINE_TYPE = 'FUNCTION'\n" + + "\n" + + " UNION ALL\n" + + "\n" + + " -- 存储过程(查询)\n" + + " SELECT\n" + + " 'PROCEDURE' as type,\n" + + " ROUTINE_NAME as object_name,\n" + + " ROUTINE_COMMENT as object_comment\n" + + " FROM information_schema.ROUTINES\n" + + " WHERE ROUTINE_SCHEMA = '{0}'\n" + + " AND ROUTINE_TYPE = 'PROCEDURE'\n" + + ") AS combined_objects\n" + + "ORDER BY\n" + + " FIELD(type, 'BASE TABLE', 'VIEW', 'FUNCTION', 'PROCEDURE'),\n" + + " object_name;", + database + ); + + return this.execute(configure, sql); + } + default void destroy() { Connection connection = local.get(); diff --git a/core/datacap-sql/pom.xml b/core/datacap-sql/pom.xml index fb9e5459e6..320707c37a 100644 --- a/core/datacap-sql/pom.xml +++ b/core/datacap-sql/pom.xml @@ -4,7 +4,7 @@ io.edurt.datacap datacap - 2024.4.1 + 2025.1.0 ../../pom.xml diff --git a/core/datacap-ui/package.json b/core/datacap-ui/package.json index 82daccbb7c..9fdd4e43c2 100644 --- a/core/datacap-ui/package.json +++ b/core/datacap-ui/package.json @@ -1,7 +1,7 @@ { "name": "datacap-ui", "description": "DataCap console", - "version": "2024.4.1", + "version": "2025.1.0", "private": true, "scripts": { "dev": "vite", diff --git a/core/datacap-ui/src/services/column.ts b/core/datacap-ui/src/services/column.ts deleted file mode 100644 index 3dd8e43200..0000000000 --- a/core/datacap-ui/src/services/column.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ResponseModel } from '@/model/response'; -import { BaseService } from '@/services/base' -import { HttpUtils } from '@/utils/http' - -const DEFAULT_PATH = '/api/v1/column' - -class ColumnService - extends BaseService -{ - constructor() - { - super(DEFAULT_PATH) - } - - /** - * Fetches all items from a table based on the provided ID. - * - * @param {number} code - The code of the table. - * @return {Promise} A Promise that resolves with the response from the API. - */ - getAllByTable(code: string): Promise - { - return new HttpUtils().post(`${DEFAULT_PATH}/table/${code}`) - } -} - -export default new ColumnService() \ No newline at end of file diff --git a/core/datacap-ui/src/services/database.ts b/core/datacap-ui/src/services/database.ts deleted file mode 100644 index 96e59a812c..0000000000 --- a/core/datacap-ui/src/services/database.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { BaseService } from '@/services/base' -import { ResponseModel } from '@/model/response' -import { HttpUtils } from '@/utils/http' - -const DEFAULT_PATH = '/api/v1/database' - -class DatabaseService - extends BaseService -{ - constructor() - { - super(DEFAULT_PATH) - } - - /** - * Retrieves all items by source ID. - * - * @param {number} code - The ID of the source. - * @return {Promise} A promise that resolves to the response model. - */ - getAllBySource(code: string): Promise - { - return new HttpUtils().post(`${DEFAULT_PATH}/source/${code}`) - } -} - -export default new DatabaseService() \ No newline at end of file diff --git a/core/datacap-ui/src/services/metadata.ts b/core/datacap-ui/src/services/metadata.ts new file mode 100644 index 0000000000..7df21b19d8 --- /dev/null +++ b/core/datacap-ui/src/services/metadata.ts @@ -0,0 +1,21 @@ +import { BaseService } from '@/services/base' +import { ResponseModel } from '@/model/response' +import HttpUtils from '@/utils/http' + +const DEFAULT_PATH = '/api/v1/metadata' + +class MetadataService + extends BaseService +{ + constructor() + { + super(DEFAULT_PATH) + } + + getDatabaseBySource(code: string): Promise + { + return HttpUtils.post(`${ DEFAULT_PATH }/database/${ code }`) + } +} + +export default new MetadataService() \ No newline at end of file diff --git a/core/datacap-ui/src/services/table.ts b/core/datacap-ui/src/services/table.ts deleted file mode 100644 index f7aef0d63b..0000000000 --- a/core/datacap-ui/src/services/table.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { ResponseModel } from '@/model/response' -import { BaseService } from '@/services/base' -import { HttpUtils } from '@/utils/http' -import { TableExportModel, TableFilter, TableModel } from '@/model/table' - -const DEFAULT_PATH = '/api/v1/table' - -class TableService - extends BaseService -{ - constructor() - { - super(DEFAULT_PATH) - } - - /** - * Retrieves all data from the database by the specified ID. - * - * @param {number} code - The code of the database. - * @return {Promise} A promise that resolves to a ResponseModel object. - */ - getAllByDatabase(code: string): Promise - { - return new HttpUtils().post(`${ DEFAULT_PATH }/database/${ code }`) - } - - /** - * Retrieves data for a specific ID using the provided table filter configuration. - * - * @param {number} code - The code of the data to retrieve. - * @param {TableFilter} configure - The table filter configuration. - * @return {Promise} - A promise that resolves to the response model. - */ - getData(code: string, configure: TableFilter): Promise - { - if (!configure) { - configure = {} - } - return new HttpUtils().post(`${ DEFAULT_PATH }/${ code }`, configure) - } - - /** - * A description of the entire function. - * - * @param {string} code - The identifier of the data. - * @param {any} configure - The configuration object. - * @return {Promise} A promise that resolves to the response model. - */ - putData(code: string, configure: TableFilter): Promise - { - return new HttpUtils().put(`${ DEFAULT_PATH }/${ code }`, configure) - } - - /** - * Export data with the given id and configuration. - * - * @param {number} id - The id of the data to export. - * @param {TableExportModel} configure - The configuration for the export. - * @return {Promise} - A promise that resolves to a ResponseModel. - */ - exportData(id: number, configure: TableExportModel): Promise - { - return new HttpUtils().post(`${ DEFAULT_PATH }/export/${ id }`, configure) - } - - createTable(databaseId: number, configure: TableModel): Promise - { - return new HttpUtils().post(`${ DEFAULT_PATH }/createTable/${ databaseId }`, configure) - } - - manageColumn(code: string, configure: any): Promise - { - return new HttpUtils().post(`${ DEFAULT_PATH }/manageColumn/${ code }`, configure) - } -} - -export default new TableService() \ No newline at end of file diff --git a/core/datacap-ui/src/views/components/tree/MetadataTree.vue b/core/datacap-ui/src/views/components/tree/MetadataTree.vue index 47993574f8..5827b81ecc 100644 --- a/core/datacap-ui/src/views/components/tree/MetadataTree.vue +++ b/core/datacap-ui/src/views/components/tree/MetadataTree.vue @@ -21,7 +21,7 @@ import { defineComponent, watch } from 'vue' import { StructureEnum, StructureModel } from '@/model/structure' -import DatabaseService from '@/services/database' +import DatabaseService from '@/services/metadata.ts' import TableService from '@/services/table' import ColumnService from '@/services/column' diff --git a/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue b/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue index 66388aeef2..bd7da78c8e 100644 --- a/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue +++ b/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue @@ -121,10 +121,8 @@ diff --git a/docs/docs/api/metadata/column.md b/docs/docs/api/metadata/column.md index 1b95679e92..8d57c5b394 100644 --- a/docs/docs/api/metadata/column.md +++ b/docs/docs/api/metadata/column.md @@ -2,7 +2,7 @@ title: 数据列列表 --- -请求地址: `/api/v1/metadata/{code}/db/{db}/columns/{table}` +请求地址: `/api/v1/metadata/{code}/{database}/{table}/columns` 请求方式: `POST` @@ -11,7 +11,7 @@ title: 数据列列表 === "示例" ``` - /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/db/datacap/columns/datacap_chat + /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/datacap/datacap_chat/columns ``` === "参数" @@ -19,7 +19,7 @@ title: 数据列列表 |参数|类型|描述| |---|---|---| |`code`|String|数据源编码| - |`db`|String|数据库名称| + |`database`|String|数据库名称| |`table`|String|数据表名称| ## Response diff --git a/docs/docs/api/metadata/database.md b/docs/docs/api/metadata/database.md index 5044c0e01e..34be537e8b 100644 --- a/docs/docs/api/metadata/database.md +++ b/docs/docs/api/metadata/database.md @@ -2,7 +2,7 @@ title: 数据库列表 --- -请求地址: `/api/v1/metadata/database/{code}` +请求地址: `/api/v1/metadata/{code}/databases` 请求方式: `POST` @@ -11,7 +11,7 @@ title: 数据库列表 === "示例" ``` - /api/v1/metadata/database/8ee2171b5d014779a45901fb9c2428c9 + /api/v1/metadata/8ee2171b5d014779a45901fb9c2428c9/databases ``` === "参数" diff --git a/docs/docs/api/metadata/databaseInfo.md b/docs/docs/api/metadata/databaseInfo.md index d7d75e57ec..08bfd9f1da 100644 --- a/docs/docs/api/metadata/databaseInfo.md +++ b/docs/docs/api/metadata/databaseInfo.md @@ -2,7 +2,7 @@ title: 数据库详情 --- -请求地址: `/api/v1/metadata/{code}/db/{database}` +请求地址: `/api/v1/metadata/{code}/{database}` 请求方式: `POST` @@ -11,7 +11,7 @@ title: 数据库详情 === "示例" ``` - /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/db/sys + /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/sys ``` === "参数" diff --git a/docs/docs/api/metadata/table.md b/docs/docs/api/metadata/table.md index c1992d7b33..b19380b21a 100644 --- a/docs/docs/api/metadata/table.md +++ b/docs/docs/api/metadata/table.md @@ -2,7 +2,7 @@ title: 数据表列表 --- -请求地址: `/api/v1/metadata/{code}/tables/{db}` +请求地址: `/api/v1/metadata/{code}/{database}/tables` 请求方式: `POST` @@ -11,7 +11,7 @@ title: 数据表列表 === "示例" ``` - /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/tables/infosphere + /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/infosphere/tables ``` === "参数" @@ -19,7 +19,7 @@ title: 数据表列表 |参数|类型|描述| |---|---|---| |`code`|String|数据源编码| - |`db`|String|数据库名称| + |`database`|String|数据库名称| ## Response diff --git a/docs/docs/api/metadata/tableAutoIncrement.md b/docs/docs/api/metadata/tableAutoIncrement.md new file mode 100644 index 0000000000..9bfd926325 --- /dev/null +++ b/docs/docs/api/metadata/tableAutoIncrement.md @@ -0,0 +1,39 @@ +--- +title: 更新表自增键 +--- + +请求地址: `/api/v1/metadata/{code}/{database}/{table}/auto-increment` + +请求方式: `PUT` + +## Path + +=== "示例" + + ``` + /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/dc1/datacap_menu/auto-increment + ``` + +=== "参数" + + |参数|类型|描述| + |---|---|---| + |`code`|String|数据源编码| + |`database`|String|数据库名称| + |`table`|String|数据表名称| + +## Response + +=== "示例" + + ```json + { + "result": 0 + } + ``` + +=== "参数" + + |参数|类型|描述| + |---|---|---| + |`result`|Integer|操作结果| \ No newline at end of file diff --git a/docs/docs/api/metadata/tableInfo.md b/docs/docs/api/metadata/tableInfo.md index ff4efb598a..3447ce260f 100644 --- a/docs/docs/api/metadata/tableInfo.md +++ b/docs/docs/api/metadata/tableInfo.md @@ -2,7 +2,7 @@ title: 数据表详情 --- -请求地址: `/api/v1/metadata/{code}/db/{database}/tb/{table}` +请求地址: `/api/v1/metadata/{code}/{database}/{table}` 请求方式: `POST` @@ -11,7 +11,7 @@ title: 数据表详情 === "示例" ``` - /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/db/datacap/tb/datacap_chat + /api/v1/metadata/e98ef92476a94ce5ae28115d2eb7ff40/datacap/datacap_chat ``` === "参数" diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 72b54eb712..b3a2726c94 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -341,6 +341,7 @@ nav: - api/metadata/databaseInfo.md - api/metadata/table.md - api/metadata/tableInfo.md + - api/metadata/tableAutoIncrement.md - api/metadata/column.md - NavDriver: - driver/mongodb.md From bfc9c018f8a78c19d3d0b0eca0ba40f6b49aeec1 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Thu, 9 Jan 2025 17:41:26 +0800 Subject: [PATCH 07/19] refactor(metadata): restructure the table --- .../etc/conf/i18n/messages_en.properties | 1 + .../etc/conf/i18n/messages_zh-cn.properties | 1 + .../layouts/metadata/MetadataContainer.vue | 2 - .../admin/source/SourceTableStructure.vue | 47 ++++++++++++------- .../admin/source/components/TableUtils.ts | 14 +++--- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/configure/etc/conf/i18n/messages_en.properties b/configure/etc/conf/i18n/messages_en.properties index 650d348f50..48f53a733a 100644 --- a/configure/etc/conf/i18n/messages_en.properties +++ b/configure/etc/conf/i18n/messages_en.properties @@ -462,6 +462,7 @@ common.procedureCount=Procedure Count common.triggerCount=Trigger Count common.foreignKeyCount=Foreign Key Count common.totalCount=Total Count +common.position=Position ## User i18n user.common.username=Username user.common.password=Password diff --git a/configure/etc/conf/i18n/messages_zh-cn.properties b/configure/etc/conf/i18n/messages_zh-cn.properties index a3c665b731..44aa3fbe64 100644 --- a/configure/etc/conf/i18n/messages_zh-cn.properties +++ b/configure/etc/conf/i18n/messages_zh-cn.properties @@ -462,6 +462,7 @@ common.procedureCount=存储过程数量 common.triggerCount=触发器数量 common.foreignKeyCount=外键数量 common.totalCount=总数量 +common.position=位置 ## User i18n user.common.username=用户名 user.common.password=密码 diff --git a/core/datacap-ui/src/views/layouts/metadata/MetadataContainer.vue b/core/datacap-ui/src/views/layouts/metadata/MetadataContainer.vue index a41d738fdb..6377a71949 100644 --- a/core/datacap-ui/src/views/layouts/metadata/MetadataContainer.vue +++ b/core/datacap-ui/src/views/layouts/metadata/MetadataContainer.vue @@ -13,7 +13,6 @@ - @@ -21,6 +20,5 @@ diff --git a/core/datacap-ui/src/views/pages/admin/source/SourceTableStructure.vue b/core/datacap-ui/src/views/pages/admin/source/SourceTableStructure.vue index 00bba6c2b1..ecb20dc1a9 100644 --- a/core/datacap-ui/src/views/pages/admin/source/SourceTableStructure.vue +++ b/core/datacap-ui/src/views/pages/admin/source/SourceTableStructure.vue @@ -2,41 +2,56 @@
- - diff --git a/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue b/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue index f895ea6bbc..1d28d5b4d1 100644 --- a/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue +++ b/core/datacap-ui/src/views/layouts/metadata/components/MetadataSidebar.vue @@ -119,10 +119,7 @@
- + - + + @@ -24,7 +26,15 @@ - + + + @@ -71,7 +81,15 @@ - + + + @@ -139,7 +157,8 @@