2025-03-19 15:04:57 +08:00

41 lines
1.4 KiB
YAML

databaseName: mall4cloud_payment
dataSources:
ds:
url: jdbc:mysql://192.168.193.128:3306/mall4cloud_payment?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true&useAffectedRows=true
username: root
password: hn02le.34lkdLKD
minPoolSize: 0
maxPoolSize: 100
idleTimeoutMilliseconds: 25000
rules:
- !SHARDING
tables:
# 正向订单业务表
pay_info:
actualDataNodes: ds.pay_info_$->{0..49}
tableStrategy:
complex:
shardingColumns: order_id,user_id,refund_id,pay_id
shardingAlgorithmName: customTableComplexKeysShardingAlgorithm
refund_info:
actualDataNodes: ds.refund_info_$->{0..49}
tableStrategy:
complex:
shardingColumns: user_id,refund_id,pay_id
shardingAlgorithmName: customTableComplexKeysShardingAlgorithm
# 绑定表配置
bindingTables:
- pay_info,refund_info
shardingAlgorithms:
customTableComplexKeysShardingAlgorithm : # 分片算法名称
type: class_based
props:
strategy: complex
algorithmClassName: com.mall4j.cloud.common.sharding.proxy.payment.CustomTableComplexKeysShardingAlgorithm
- !SINGLE
tables:
- ds.*
defaultDataSource: ds