134 lines
3.1 KiB
YAML
134 lines
3.1 KiB
YAML
# ========================================
|
|
# 陪读服务后端配置 - 生产环境
|
|
# 文件位置: /www/wwwroot/px.ddn-ai.cloud/jar/application.yml
|
|
# ========================================
|
|
|
|
server:
|
|
port: 8089
|
|
servlet:
|
|
context-path: /
|
|
tomcat:
|
|
uri-encoding: UTF-8
|
|
|
|
spring:
|
|
application:
|
|
name: peidu-backend
|
|
|
|
profiles:
|
|
active: prod
|
|
|
|
# 解决Springfox与Spring Boot 2.6+兼容性问题
|
|
mvc:
|
|
pathmatch:
|
|
matching-strategy: ant_path_matcher
|
|
|
|
# 文件上传大小限制
|
|
servlet:
|
|
multipart:
|
|
max-file-size: 10MB
|
|
max-request-size: 10MB
|
|
|
|
# JSON日期格式
|
|
jackson:
|
|
date-format: yyyy-MM-dd HH:mm:ss
|
|
time-zone: GMT+8
|
|
|
|
# HTTP编码配置
|
|
http:
|
|
encoding:
|
|
charset: UTF-8
|
|
enabled: true
|
|
force: true
|
|
|
|
# 数据源配置 (从环境变量读取)
|
|
datasource:
|
|
url: ${SPRING_DATASOURCE_URL}
|
|
username: ${DB_USERNAME}
|
|
password: ${DB_PASSWORD}
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
hikari:
|
|
minimum-idle: 5
|
|
maximum-pool-size: 20
|
|
connection-timeout: 30000
|
|
idle-timeout: 600000
|
|
max-lifetime: 1800000
|
|
|
|
# MyBatis Plus配置
|
|
mybatis-plus:
|
|
mapper-locations: classpath*:/mapper/**/*.xml
|
|
type-aliases-package: com.peidu.entity
|
|
configuration:
|
|
map-underscore-to-camel-case: true
|
|
cache-enabled: false
|
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
|
global-config:
|
|
db-config:
|
|
id-type: auto
|
|
logic-delete-field: deleted
|
|
logic-delete-value: 1
|
|
logic-not-delete-value: 0
|
|
|
|
# 日志配置
|
|
logging:
|
|
level:
|
|
com.peidu: info
|
|
root: info
|
|
pattern:
|
|
console: '%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n'
|
|
file:
|
|
name: /www/wwwroot/px.ddn-ai.cloud/jar/logs/app.log
|
|
|
|
# ========================================
|
|
# 文件上传配置 (关键配置)
|
|
# ========================================
|
|
file:
|
|
upload:
|
|
# 上传模式: local(本地保存)
|
|
mode: local
|
|
# 本地保存路径
|
|
local-path: /www/wwwroot/px.ddn-ai.cloud/Image/
|
|
# 访问URL前缀 (必须是远程地址)
|
|
url-prefix: https://px.ddn-ai.cloud/uploads/
|
|
# 允许的文件类型
|
|
allowed-types: jpg,jpeg,png,gif,bmp,webp,pdf,doc,docx,xls,xlsx
|
|
# 最大文件大小(MB)
|
|
max-size: 10
|
|
|
|
# JWT配置
|
|
jwt:
|
|
secret: ${JWT_SECRET}
|
|
expiration: 604800
|
|
|
|
# 微信小程序配置
|
|
wx:
|
|
appid: ${WX_APPID}
|
|
secret: ${WX_SECRET}
|
|
|
|
# 微信支付配置
|
|
wechat:
|
|
pay:
|
|
appid: ${WX_PAY_APPID}
|
|
mchid: ${WX_PAY_MCHID}
|
|
key: ${WX_PAY_KEY}
|
|
cert-path: classpath:cert/apiclient_cert.p12
|
|
notify-url: https://px.ddn-ai.cloud/api/payment/notify/wechat
|
|
|
|
# 短信配置
|
|
sms:
|
|
skip-send: false
|
|
aliyun:
|
|
access-key-id: ${ALIYUN_SMS_ACCESS_KEY}
|
|
access-key-secret: ${ALIYUN_SMS_ACCESS_SECRET}
|
|
sign-name: ${SMS_SIGN_NAME}
|
|
template-code: ${SMS_TEMPLATE_VERIFY_CODE}
|
|
region: cn-hangzhou
|
|
|
|
# 阿里云OSS配置 (如果使用)
|
|
aliyun:
|
|
oss:
|
|
endpoint: ${ALIYUN_OSS_ENDPOINT:}
|
|
access-key-id: ${ALIYUN_OSS_ACCESS_KEY:}
|
|
access-key-secret: ${ALIYUN_OSS_ACCESS_SECRET:}
|
|
bucket-name: ${ALIYUN_OSS_BUCKET:}
|
|
domain: ${ALIYUN_OSS_DOMAIN:}
|