AIGC/AIGC-admin/backend/src/main/resources/application.yml
2026-02-28 18:04:09 +08:00

103 lines
2.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

spring:
datasource:
url: jdbc:mysql://120.24.227.27:3306/aigc?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: aigc
password: ne3sahjfsK36Xj6p
driver-class-name: com.mysql.cj.jdbc.Driver
# HikariCP连接池配置
hikari:
connection-timeout: 30000 # 连接超时30秒
idle-timeout: 600000 # 空闲超时10分钟
max-lifetime: 1800000 # 最大生命周期30分钟
maximum-pool-size: 20 # 最大连接数
minimum-idle: 5 # 最小空闲连接数
connection-test-query: SELECT 1 # 连接测试查询
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
servlet:
multipart:
# 文件上传配置
max-file-size: 50MB
max-request-size: 50MB
# 设置较大的阈值,小文件直接存内存,避免临时文件锁定问题
file-size-threshold: 10MB
# Redis配置
redis:
host: 127.0.0.1
port: 6379
password: GEmYoQJV2xhONS1t
database: 0
timeout: 5000ms
lettuce:
pool:
max-active: 20
max-idle: 10
min-idle: 5
max-wait: 3000ms
shutdown-timeout: 100ms
# 缓存配置
cache:
type: redis
redis:
# 缓存默认过期时间(毫秒)
time-to-live: 1800000 # 30分钟
# 是否缓存null值
cache-null-values: false
# Key前缀
key-prefix: "aigc:"
# 是否使用前缀
use-key-prefix: true
# 日志配置
logging:
level:
root: INFO
com.example.aigc: DEBUG
com.example.aigc.service: DEBUG
com.example.aigc.controller: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
# MyBatis配置
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.example.aigc.entity
configuration:
map-underscore-to-camel-case: true
server:
port: 20006
address: 0.0.0.0 # 监听所有网络接口,允许外部访问
# Tomcat连接超时配置
tomcat:
connection-timeout: 300000 # 连接超时5分钟300秒
threads:
max: 200 # 最大线程数
min-spare: 10 # 最小空闲线程数
max-connections: 10000 # 最大连接数
accept-count: 100 # 等待队列长度
# 异步请求超时(用于长时间运行的任务)
servlet:
session:
timeout: 30m # Session超时30分钟
# 支付配置(示例)
payment:
wechat:
app-id: your_wechat_app_id
mch-id: your_merchant_id
api-key: your_api_key
notify-url: https://your-domain.com/api/payment/wechat-callback
alipay:
app-id: your_alipay_app_id
private-key: your_private_key
public-key: alipay_public_key
notify-url: https://your-domain.com/api/payment/alipay-callback