From c0f6294b0be6789fddd652f89f820fcf6d5526cf Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 06 七月 2023 17:32:39 +0800 Subject: [PATCH] 合并代码 --- cloud-server-course/src/main/java/com/dsh/config/Sharding_jdbc/ShardingConfig.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud-server-course/src/main/java/com/dsh/config/Sharding_jdbc/ShardingConfig.java b/cloud-server-course/src/main/java/com/dsh/config/Sharding_jdbc/ShardingConfig.java index dbac4e9..1dc9751 100644 --- a/cloud-server-course/src/main/java/com/dsh/config/Sharding_jdbc/ShardingConfig.java +++ b/cloud-server-course/src/main/java/com/dsh/config/Sharding_jdbc/ShardingConfig.java @@ -68,7 +68,7 @@ //分片规则配置 ShardingRuleConfiguration result1 = new ShardingRuleConfiguration(); - result1.getTables().add(gettCoursePackagePaymentTableRuleConfiguration()); + result1.getTables().add(getCoursePackagePaymentTableRuleConfiguration()); Properties props1 = new Properties(); props1.setProperty("algorithm-expression", "t_course_package_payment$->{appUserId % 5 + 1}"); result1.getShardingAlgorithms().put("t_course_package_payment-inline", new AlgorithmConfiguration("INLINE", props1)); @@ -90,8 +90,8 @@ * 分片算法配置 * @return */ - private ShardingTableRuleConfiguration gettCoursePackagePaymentTableRuleConfiguration() { - ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_payment", "m$->{0}.t_course_package_payment$->{1..5}");//50 + private ShardingTableRuleConfiguration getCoursePackagePaymentTableRuleConfiguration() { + ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_payment", "m_$->{0}.t_course_package_payment$->{1..5}");//50 result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("appUserId", "t_course_package_payment-inline")); result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_payment-snowflake")); return result; @@ -104,7 +104,7 @@ * @return */ private ShardingTableRuleConfiguration getCoursePackageStudentTableRuleConfiguration() { - ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_student", "m$->{0}.t_course_package_student$->{1..5}");//30 + ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_student", "m_$->{0}.t_course_package_student$->{1..5}");//30 result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("appUserId", "t_course_package_student-inline")); result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_student-snowflake")); return result; -- Gitblit v1.7.1