feat(config): 初始化项目配置文件

- 添加 application.yml 主配置文件,配置 Spring、Druid、MyBatis-Plus 等基础设置
- 添加 application-dev.yml 开发环境配置,配置数据源及 PingPong 沙箱参数
- 添加数据库建表及配置说明文档(README.md、README_DATABASE.md、README_PRODUCT.md)
- 添加商品表结构定义及示例数据说明
- 添加支付相关枚举类 RecordType 和充值信息 DTO RechargeDTO
- 添加日志文件 mt-pay.2025-12-19.log 用于记录系统启动异常信息
This commit is contained in:
2025-12-22 10:18:59 +08:00
parent 2d00e72637
commit 19b53f0ed1
8 changed files with 728 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源(开发环境)
master:
url: jdbc:mysql://rm-j6c3u06k2afwn8hxw6o.mysql.rds.aliyuncs.com:3306/mtpay?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: mtkj2025
password: aXs-Q876#pxBesA
# 初始连接数
initial-size: 5
# 最小连接池数量
min-idle: 10
# 最大连接池数量
max-active: 200
# 配置获取连接等待超时的时间
max-wait: 60000
# 配置连接超时时间
connect-timeout: 30000
# 配置网络超时时间
socket-timeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
max-evictable-idle-time-millis: 900000
# 配置检测连接是否有效
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# Druid监控配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: false
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# PingPong支付配置开发环境使用沙箱
pingpong:
gateway: https://sandbox-acquirer-payment.pingpongx.com
mode: sandbox

View File

@@ -0,0 +1,101 @@
spring:
application:
name: MTKJPAY
profiles:
active: dev
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# Druid监控配置
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: false
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# MyBatis-Plus配置
mybatis-plus:
# 配置扫描mapper.xml文件路径
mapper-locations: classpath*:/mapper/**/*.xml
# 配置实体类包路径
type-aliases-package: com.mtkj.mtpay.entity
# 配置MyBatis-Plus全局配置
configuration:
# 开启驼峰命名转换
map-underscore-to-camel-case: true
# 开启二级缓存
cache-enabled: false
# 日志实现
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 全局配置
global-config:
db-config:
# 主键类型AUTO-数据库自增
id-type: auto
# 逻辑删除字段
logic-delete-field: deleted
# 逻辑删除值
logic-delete-value: 1
# 逻辑未删除值
logic-not-delete-value: 0
# PingPong支付配置
pingpong:
client-id: your-client-id
acc-id: your-acc-id
secret: your-secret-key
sign-type: MD5
gateway: https://sandbox-acquirer-payment.pingpongx.com
mode: sandbox
enabled: true
# 服务器配置
server:
port: 8082
servlet:
context-path: /
# 文件上传配置
multipart:
# 单个文件最大大小10MB
max-file-size: 10MB
# 请求最大大小50MB支持多文件上传
max-request-size: 50MB
# 文件写入磁盘的阈值(超过此大小会写入临时文件)
file-size-threshold: 2MB
# 应用配置
app:
# 前端访问地址用于生成商品详情页URL等
frontend:
url: http://localhost:3000
# 阿里云OSS相关配置
aliyun:
oss:
accessId: LTAI5tHbwvzWfANvNxju2yN1
accessKey: sAQR2swByBgmMOofH97hSJT638aVcJ
endpoint: https://oss-cn-hangzhou.aliyuncs.com
bucketName: mtkj2025