server:
  port: 8089
spring:
  application:
    name: RandomMatch
  # config:
  #   import: optional:nacos:mysql-dev.yml?group=zk-parent&namespace=dev&refresh=true  # Nacos已禁用，注释此配置
  cloud:
    nacos:
      discovery:
        server-addr: 115.190.125.125:8848
        enabled: false
        namespace: dev
        group: zk-parent
      config:
        server-addr: 115.190.125.125:8848
        namespace: dev
        group: zk-parent
        prefix: mysql-dev
        file-extension: yml
        import-check:
          enabled: false
  # 数据库配置
  datasource:
    url: jdbc:mysql://115.190.125.125:3306/hunlian?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true
    username: root
    password: lsx@hfs?gln.lsc
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 1        # 暂时降到 1，缓解 Too many connections
      minimum-idle: 0             # 不保留空闲连接
      idle-timeout: 60000         # 1min
      max-lifetime: 300000        # 5min，需小于 DB wait_timeout
      connection-timeout: 30000   # 30s
      leak-detection-threshold: 20000  # 启用泄漏检测日志（20s）
  redis:
    host: 115.190.125.125
    port: 6377
    password: 
    database: 0
    timeout: 3000ms
    lettuce:
      pool:
        max-active: 8
        max-idle: 8
        min-idle: 0
        max-wait: -1ms

# MyBatis Plus配置
mybatis-plus:
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      logic-delete-field: isDeleted
      logic-delete-value: 1
      logic-not-delete-value: 0

recommend:
  cache:
    enabled: true
    ttl-seconds: 600
  rank:
    mmr-lambda: 0.7