From d9f9fd8bd23847ae14a4d5827f57f7ae335f7bae Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Tue, 18 Mar 2025 21:39:01 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E4=BC=98=E5=8C=96=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- novel-admin/pom.xml | 5 -- .../main/build/config/shardingsphere-jdbc.yml | 47 +++++++++++++++++++ novel-crawl/pom.xml | 5 -- .../main/build/config/shardingsphere-jdbc.yml | 47 +++++++++++++++++++ novel-front/pom.xml | 5 -- .../main/build/config/shardingsphere-jdbc.yml | 47 +++++++++++++++++++ 6 files changed, 141 insertions(+), 15 deletions(-) create mode 100644 novel-admin/src/main/build/config/shardingsphere-jdbc.yml create mode 100644 novel-crawl/src/main/build/config/shardingsphere-jdbc.yml create mode 100644 novel-front/src/main/build/config/shardingsphere-jdbc.yml diff --git a/novel-admin/pom.xml b/novel-admin/pom.xml index e483397..b1d9fad 100644 --- a/novel-admin/pom.xml +++ b/novel-admin/pom.xml @@ -284,11 +284,6 @@ - - - - - diff --git a/novel-admin/src/main/build/config/shardingsphere-jdbc.yml b/novel-admin/src/main/build/config/shardingsphere-jdbc.yml new file mode 100644 index 0000000..8659c28 --- /dev/null +++ b/novel-admin/src/main/build/config/shardingsphere-jdbc.yml @@ -0,0 +1,47 @@ +mode: + # 单机模式 + type: Standalone + # 元数据持久化 + repository: + # 数据库持久化 + type: JDBC + +# 数据源配置 +dataSources: + ds_1: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.cj.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: test123456 +# 规则配置 +rules: + - !SINGLE + tables: + - "*.*" + - !SHARDING + tables: # 数据分片规则配置 + book_content: + # 分库策略,缺省表示使用默认分库策略 + actualDataNodes: ds_${1}.book_content${0..9} + # 分表策略 + tableStrategy: + standard: + # 分片列名称 + shardingColumn: index_id + # 分片算法名称 + shardingAlgorithmName: bookContentSharding + + shardingAlgorithms: + bookContentSharding: + # 行表达式分片算法,使用 Groovy 的表达式,提供对 SQL 语句中的 = 和 IN 的分片操作支持 + type: INLINE + props: + # 分片算法的行表达式 + algorithm-expression: book_content${index_id % 10} + + + +props: + # 是否在日志中打印 SQL + sql-show: true diff --git a/novel-crawl/pom.xml b/novel-crawl/pom.xml index bbbd895..f0e6a6a 100644 --- a/novel-crawl/pom.xml +++ b/novel-crawl/pom.xml @@ -63,11 +63,6 @@ - - - - - diff --git a/novel-crawl/src/main/build/config/shardingsphere-jdbc.yml b/novel-crawl/src/main/build/config/shardingsphere-jdbc.yml new file mode 100644 index 0000000..8659c28 --- /dev/null +++ b/novel-crawl/src/main/build/config/shardingsphere-jdbc.yml @@ -0,0 +1,47 @@ +mode: + # 单机模式 + type: Standalone + # 元数据持久化 + repository: + # 数据库持久化 + type: JDBC + +# 数据源配置 +dataSources: + ds_1: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.cj.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: test123456 +# 规则配置 +rules: + - !SINGLE + tables: + - "*.*" + - !SHARDING + tables: # 数据分片规则配置 + book_content: + # 分库策略,缺省表示使用默认分库策略 + actualDataNodes: ds_${1}.book_content${0..9} + # 分表策略 + tableStrategy: + standard: + # 分片列名称 + shardingColumn: index_id + # 分片算法名称 + shardingAlgorithmName: bookContentSharding + + shardingAlgorithms: + bookContentSharding: + # 行表达式分片算法,使用 Groovy 的表达式,提供对 SQL 语句中的 = 和 IN 的分片操作支持 + type: INLINE + props: + # 分片算法的行表达式 + algorithm-expression: book_content${index_id % 10} + + + +props: + # 是否在日志中打印 SQL + sql-show: true diff --git a/novel-front/pom.xml b/novel-front/pom.xml index 8640766..c5e315a 100644 --- a/novel-front/pom.xml +++ b/novel-front/pom.xml @@ -90,11 +90,6 @@ - - - - - diff --git a/novel-front/src/main/build/config/shardingsphere-jdbc.yml b/novel-front/src/main/build/config/shardingsphere-jdbc.yml new file mode 100644 index 0000000..8659c28 --- /dev/null +++ b/novel-front/src/main/build/config/shardingsphere-jdbc.yml @@ -0,0 +1,47 @@ +mode: + # 单机模式 + type: Standalone + # 元数据持久化 + repository: + # 数据库持久化 + type: JDBC + +# 数据源配置 +dataSources: + ds_1: + dataSourceClassName: com.zaxxer.hikari.HikariDataSource + driverClassName: com.mysql.cj.jdbc.Driver + jdbcUrl: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: test123456 +# 规则配置 +rules: + - !SINGLE + tables: + - "*.*" + - !SHARDING + tables: # 数据分片规则配置 + book_content: + # 分库策略,缺省表示使用默认分库策略 + actualDataNodes: ds_${1}.book_content${0..9} + # 分表策略 + tableStrategy: + standard: + # 分片列名称 + shardingColumn: index_id + # 分片算法名称 + shardingAlgorithmName: bookContentSharding + + shardingAlgorithms: + bookContentSharding: + # 行表达式分片算法,使用 Groovy 的表达式,提供对 SQL 语句中的 = 和 IN 的分片操作支持 + type: INLINE + props: + # 分片算法的行表达式 + algorithm-expression: book_content${index_id % 10} + + + +props: + # 是否在日志中打印 SQL + sql-show: true