修订分布式锁配置

This commit is contained in:
DB 2023-10-30 21:06:35 +08:00
parent 31e612cf3e
commit 09c7669533
3 changed files with 113 additions and 3 deletions

View File

@ -16,6 +16,6 @@ public class RedisLockConfig {
//第一个参数redisConnectionFactory //第一个参数redisConnectionFactory
//第二个参数registryKey分布式锁前缀设置为项目名称会好些 //第二个参数registryKey分布式锁前缀设置为项目名称会好些
//该构造方法对应的分布式锁默认有效期是60秒.可以自定义 //该构造方法对应的分布式锁默认有效期是60秒.可以自定义
return new RedisLockRegistry(redisConnectionFactory, "Cpop-"); return new RedisLockRegistry(redisConnectionFactory, "Cpop-",5000);
} }
} }

View File

@ -0,0 +1,110 @@
# 项目相关配置
cpop:
# 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPathLinux配置 /home/baseFramework/uploadPath
profile: D:\WorkSpace\Cpop\uploadPath
jwt:
#白名单
whiteList: /login,/miniLogin,/wxPay/callback/notify/**,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources
gateway:
rsa-keypair:
# 公钥文件
publicKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey
# 公钥文件
privateKeyFile: D:\WorkSpace\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey
# DataSource Config
spring:
application:
name: Cpop-Mall-Dev
#redis配置
redis:
#地址
host: 106.52.49.102
#端口
port: 6333
#数据库
database: 10
#密码
password: Jambox.123*
#连接超时
timeout: 5000
jedis:
pool:
#
min-idle: 0
#
max-idle: 8
#
max-active: 8
#
max-wait: -1ms
data:
mongodb:
host: localhost
port: 27017
database: cpop-union
server:
port: 9430
servlet:
context-path: /Cpop-Mall
#Mybatis-Flex
mybatis-flex:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
datasource:
mall:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Customer0401
jambox:
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
username: root
password: Customer0401
# springdoc-openapi项目配置
knife4j:
enable: true
openapi:
title: Cpop-Mall开发API
description: Cpop-Mall开发API
email:
concat: DB
url: https://api.jamboxsys.com
version: 1.0.0
license: Apache 2.0
license-url: https://stackoverflow.com/
terms-of-service-url: https://api.jamboxsys.com
group:
#商城
Mall-Backstage:
#后台
group-name: Mall-Backstage
api-rule: package
api-rule-resources:
- com.cpop.mall.business.controller.backstage
Mall-Mini:
#后台
group-name: Mall-Mini
api-rule: package
api-rule-resources:
- com.cpop.mall.business.controller.mini
#系统
System:
group-name: System
api-rule: package
api-rule-resources:
- com.cpop.system
logging:
level:
com.github.binarywang.wxpay: debug
#微信支付
wx:
pay:
#通知地址
notifyUrl: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/order
#支付成功
notifyRefund: https://frp-oak.top:11899/Cpop-Mall/wxPay/callback/notify/refund

View File

@ -6,12 +6,12 @@ package com.cpop.mall.framework.constant;
public interface MallRedisConstant { public interface MallRedisConstant {
/** /**
* redis库存 * 库存记录redis
*/ */
String STOCK_RECORD_NUM = "mall:stock:recordNum:"; String STOCK_RECORD_NUM = "mall:stock:recordNum:";
/** /**
* 用户支付幂等键 * 用户下单幂等锁(用户id)
*/ */
String IDEMPOTENT_LOCK_USER_PAY = "mall:idempotentLock:userPay:"; String IDEMPOTENT_LOCK_USER_PAY = "mall:idempotentLock:userPay:";
} }