diff --git a/assets/小说精品屋开源项目交流群群聊二维码.png b/assets/小说精品屋开源项目交流群群聊二维码.png index c314a7e..73204e0 100644 Binary files a/assets/小说精品屋开源项目交流群群聊二维码.png and b/assets/小说精品屋开源项目交流群群聊二维码.png differ diff --git a/novel-common/src/main/resources/application-common-dev.yml b/novel-common/src/main/resources/application-common-dev.yml index e4321d0..c6c8e87 100644 --- a/novel-common/src/main/resources/application-common-dev.yml +++ b/novel-common/src/main/resources/application-common-dev.yml @@ -35,19 +35,19 @@ spring: sharding: jdbc: datasource: - names: ds0 #,ds1 + names: ds0 ,ds1 ds0: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai username: root password: test123456 -# ds1: -# type: com.alibaba.druid.pool.DruidDataSource -# driver-class-name: com.mysql.jdbc.Driver -# url: jdbc:mysql://localhost:3306/novel_plus2 -# username: root -# password: test123456 + ds1: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + username: root + password: test123456 config: sharding: props: @@ -55,15 +55,16 @@ sharding: tables: book_content: #book_content表 key-generator-column-name: id #主键 - actual-data-nodes: ds${0}.book_content${0..9} #数据节点 -# database-strategy: #分库策略 -# inline: -# sharding-column: book_id -# algorithm-expression: ds${book_id % 10} + actual-data-nodes: ds${0..1}.book_content${0..1} #数据节点 + database-strategy: #分库策略 + inline: + sharding-column: index_id + algorithm-expression: ds${index_id % 2} table-strategy: #分表策略 inline: shardingColumn: index_id - algorithm-expression: book_content${index_id % 10} + algorithm-expression: book_content${index_id % 2} + default-data-source-name: db0 diff --git a/novel-common/src/main/resources/mybatis/generatorConfig.xml b/novel-common/src/main/resources/mybatis/generatorConfig.xml index 51283c7..c4fafbf 100644 --- a/novel-common/src/main/resources/mybatis/generatorConfig.xml +++ b/novel-common/src/main/resources/mybatis/generatorConfig.xml @@ -9,7 +9,7 @@