浏览代码

refactor(national-motion-system-start): 优化应用配置和 Redis 连接

- 更新了应用配置文件中的多个参数,包括数据库连接、Redis 配置、邮件设置等
- 添加了微信小程序和支付配置
- 新增了 HTTP连接池配置
- 更新了 Redisson 配置文件中的地址和密码
SheepHy 1 周之前
父节点
当前提交
5225c025d0

+ 112 - 34
national-motion-module-system/national-motion-system-start/src/main/resources/application-prod.yml

@@ -1,10 +1,11 @@
 server:
   port: 8080
   undertow:
-    worker-threads: 16
+    # max-http-post-size: 10MB # 平替 tomcat server.tomcat.max-swallow-siz, undertow该值默认为-1
+    worker-threads: 16  # 4核CPU标准配置
     buffers:
-      websocket: 8192
-      io: 16384
+      websocket: 8192 # WebSocket缓冲 以字节为单位,这里设置为8 KB
+      io: 16384 # IO操作缓冲 以字节为单位,这里设置为16 KB
   error:
     include-exception: true
     include-stacktrace: ALWAYS
@@ -39,13 +40,17 @@ spring:
     username: jeecgos@163.com
     password: ??
     properties:
+      mail.smtp.timeout: 10000  # 连接超时(毫秒)
+      mail.smtp.connectiontimeout: 10000  # 连接超时(毫秒)
+      mail.smtp.writetimeout: 10000  # 写入超时(毫秒)
       mail.smtp.auth: true
       smtp.ssl.enable: true
+      mail.debug: true  # 启用调试模式(查看详细日志)
   ## quartz定时任务,采用数据库方式
   quartz:
     job-store-type: jdbc
     initialize-schema: embedded
-    #定时任务开关,true-开  false-关
+    #定时任务启动开关,true-开  false-关
     auto-startup: true
     #延迟1秒启动定时任务
     startup-delay: 1s
@@ -126,7 +131,7 @@ spring:
         timeBetweenEvictionRunsMillis: 60000
         # 配置一个连接在池中最小生存的时间,单位是毫秒
         minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
+        validationQuery: SELECT 1
         testWhileIdle: true
         testOnBorrow: false
         testOnReturn: false
@@ -140,26 +145,30 @@ spring:
           selectWhereAlwayTrueCheck: false
         # 打开mergeSql功能;慢SQL记录
         stat:
-          merge-sql: true
+          merge-sql: false
           slow-sql-millis: 5000
       datasource:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          #          url: jdbc:mysql://192.168.110.241:3306/national_motion?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          #          username: root
+          #          password: c7ix0bJv2GvyhbkRw6
+          url: jdbc:mysql://rm-bp15g68z8j527q9n9xo.mysql.rds.aliyuncs.com:3306/national_motion?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           username: root
-          password: root
-          driver-class-name: com.mysql.cj.jdbc.Driver
+          password: BXyzm3RKR2nA9vn5ZkeP!
           # 多数据源配置
           #multi-datasource1:
           #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
           #username: root
           #password: root
-          #driver-class-name: com.mysql.cj.jdbc.Driver
+          driver-class-name: com.mysql.cj.jdbc.Driver
   #redis 配置
   redis:
     database: 0
-    host: 127.0.0.1
+    host: 47.109.18.141
     port: 6379
-    password: ''
+    password: BXyzm3RKR2nA9vn5ZkeP
+    redisson:
+      file: classpath:redisson.yml
 #mybatis plus 设置
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml
@@ -171,9 +180,12 @@ mybatis-plus:
       id-type: ASSIGN_ID
       # 默认数据库表下划线命名
       table-underline: true
+      logic-delete-field: delFlag # 逻辑删除字段名
+      logic-delete-value: 1 # 已删除值
+      logic-not-delete-value: 0 # 未删除值
   configuration:
     # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     # 返回类型为Map,显示null对应的字段
     call-setters-on-nulls: true
 #jeecg专用配置
@@ -185,7 +197,7 @@ jeecg:
     enabled: true
     model: deepseek-chat
     apiKey: ??
-    apiHost: https://api.deepseek.com
+    apiHost: https://api.deepseek.com/v1
     timeout: 60
   # AIRag向量库
   ai-rag:
@@ -199,14 +211,14 @@ jeecg:
   # 平台上线安全配置
   firewall:
     # 数据源安全 (开启后,Online报表和图表的数据源为必填)
-    dataSourceSafe: true
+    dataSourceSafe: false
     # 低代码模式(dev:开发模式,prod:发布模式——关闭所有在线开发配置能力)
-    lowCodeMode: prod
+    lowCodeMode: dev
   # 签名密钥串(前后端要一致,正式发布请自行修改)
   signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
   #签名拦截接口
   signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
-  # local\minio\alioss
+  # 本地:local、Minio:minio、阿里云:alioss
   uploadType: alioss
   # 前端访问地址
   domainUrl:
@@ -214,18 +226,17 @@ jeecg:
     app: http://localhost:8051
   path:
     #文件上传根目录 设置
-    upload: /opt/jeecg-boot/upload
+    upload: /opt/upFiles
     #webapp文件路径
-    webapp: /opt/jeecg-boot/webapp
+    webapp: /opt/webapp
   shiro:
-    excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
+    excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
   #阿里云oss存储和大鱼短信秘钥配置
   oss:
-    accessKey: ??
-    secretKey: ??
+    accessKey: LTAI5tJscqbev7wSugGCrEtt
+    secretKey: xJkoJR1ILpXNSF2ERnxNq71UZTQNcB
     endpoint: oss-cn-beijing.aliyuncs.com
-    bucketName: jeecgdev
-    staticDomain: https://static.jeecg.com
+    bucketName: national-motion
     # 短信模板
     sms-template:
       # 签名
@@ -238,7 +249,6 @@ jeecg:
         SMS_465391221:
         # 注册账号短信模板编码
         SMS_175430166:
-        SMS_461885023:
   # 在线预览文件服务器地址配置
   file-view-domain: http://fileview.jeecg.com
   # minio文件上传
@@ -254,9 +264,9 @@ jeecg:
     # 平台上线安全配置(v1.6.2+ 新增)
     firewall:
       # 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
-      dataSourceSafe: true
+      dataSourceSafe: false
       # 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
-      lowCodeMode: prod
+      lowCodeMode: dev
   #xxl-job配置
   xxljob:
     enabled: false
@@ -269,17 +279,16 @@ jeecg:
     logPath: logs/jeecg/job/jobhandler/
     logRetentionDays: 30
   #分布式锁配置
-  redisson:
-    address: 127.0.0.1:6379
-    password:
-    type: STANDALONE
-    enabled: true
+  #  redisson:
+  #    address: 127.0.0.1:6379
+  #    password:
+  #    type: STANDALONE
+  #    enabled: true
   # 百度开放API配置
   baidu-api:
     app-id: ??
     api-key: ??
     secret-key: ??
-
 #cas单点登录
 cas:
   prefixUrl: http://cas.example.org:8443/cas
@@ -295,7 +304,7 @@ knife4j:
   #开启生产环境屏蔽
   production: true
   basic:
-    enable: true
+    enable: false
     username: jeecg
     password: jeecg1314
 #第三方登录
@@ -323,3 +332,72 @@ justauth:
     type: default
     prefix: 'demo::'
     timeout: 1h
+# 微信相关
+#wx:
+#  # 微信小程序
+#  miniapp:
+#    configs:
+#      - appid: wx6260718c6fd46efb
+#        secret: 353c9d6d84347de7af9a7788a00a725e
+#        token: #微信小程序消息服务器配置的token
+#        aesKey: #微信小程序消息服务器配置的EncodingAESKey
+#        msgDataFormat: JSON
+wx:
+  # 微信小程序
+  miniapp:
+    configs:
+      - appid: wxc032a09413289004
+        secret: 453c5047ae43288f1d015d48df32a5c0
+        token: #微信小程序消息服务器配置的token
+        aesKey: #微信小程序消息服务器配置的EncodingAESKey
+        msgDataFormat: JSON
+  # 微信支付配置
+  pay:
+    #服务商微信支付商户号
+    mchId: 1649629687
+    #证书
+    keyPath: classpath:cert/apiclient_cert.p12
+    #服务商微信公众号或者小程序等的appid
+    appId: wx43b5b906cc30ed0b
+    #支付回调通知地址
+    notifyUrl:
+    #服务商key的密钥
+    mchKey:
+    #特约商户微信公众号或者小程序等的appid
+    subAppId:
+    #apiV3秘钥
+    apiV3Key: 4b64e17419689527b256f07cdf6bd60c
+    #证书号
+    certSerialNo: 5EB65CC0F912EA2ADD3363EA3DA0230DF6DA90BC
+    #apiclient_key.pem证书文件的绝对路径或者以classpath:开头的类路径
+    privateKeyPath: classpath:cert/apiclient_key.pem
+    #apiclient_cert.pem证书文件的绝对路径或者以classpath:开头的类路径
+    privateCertPath: classpath:cert/apiclient_cert.pem
+
+baidu:
+  map:
+    keys:
+      - ak: muOeefnWVcMymKORaYmGVNEx9ZtCsOoS
+        sk: ZDoHSoYoTvynHB6Gw3SxVQ7KpgcoLNJs
+# 微信小程序配置
+wechat:
+  miniprogram:
+    appid: wxc032a09413289004
+    #    appid: wx6260718c6fd46efb
+    appsecret: 453c5047ae43288f1d015d48df32a5c0
+    #    appsecret: 353c9d6d84347de7af9a7788a00a725e
+    token:
+      cache:
+        enabled: true
+        timeout: 7000  # 单位秒(2小时=7200秒,提前200秒刷新)
+
+# HTTP连接池配置
+http:
+  pool:
+    max:
+      total: 200
+    default:
+      max:
+        per_route: 50
+    validate:
+      after_inactivity: 30000

+ 2 - 2
national-motion-module-system/national-motion-system-start/src/main/resources/redisson.yml

@@ -19,11 +19,11 @@ singleServerConfig:
   #客户端名称
   clientName: null
   #地址
-  address: "redis://47.109.67.112:6379"
+  address: "redis://47.109.18.141:6379"
   #数据库编号
   database: 0
   #密码
-  password: RUw3C4tAF0aE4PVC
+  password: BXyzm3RKR2nA9vn5ZkeP
   #发布和订阅连接的最小空闲连接数
   subscriptionConnectionMinimumIdleSize: 1
   #发布和订阅连接池大小