spring: datasource: url: jdbc:mysql://127.0.0.1:3306/aigc?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai username: abcdef password: abcdef123 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