spring:
  application:
    name: gameplatform-server

  datasource:
    url: jdbc:mysql://120.46.74.24:3306/login_task_db?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&sessionVariables=innodb_lock_wait_timeout=30
    username: login_task_db
    password: 3MaXfeWJ4d6cGMrL
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 50
      minimum-idle: 10
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000
      leak-detection-threshold: 60000
      validation-timeout: 5000
      connection-test-query: SELECT 1
      # 连接池健康监控和自动重连
      initialization-fail-timeout: 1
      register-mbeans: true
      # 自动重连配置
      auto-commit: true
  task:
    detection:
      poll:
        size: 4
  transaction:
    default-timeout: 30

mybatis-plus:
  mapper-locations: classpath:mapper/**/*.xml
  type-aliases-package: com.gameplatform.server.model.entity
  configuration:
    map-underscore-to-camel-case: true
    # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl  # 注释掉以关闭SQL日志
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deleted
      logic-delete-value: 1
      logic-not-delete-value: 0

server:
  port: 18080

management:
  endpoints:
    web:
      exposure:
        include: health,info

logging:
  level:
    root: info
    com.gameplatform.server: debug  # 保持整体调试
    # 仅保留设备解析最终汇总（INFO），其余降级
#    com.gameplatform.server.service.device.DeviceStatusService: info
#    com.gameplatform.server.service.device.DeviceStatusCheckService: info
#    # 脚本客户端与定时任务降噪
#    com.gameplatform.server.service.external.ScriptClient: warn
#    com.gameplatform.server.task.DeviceStatusCheckTask: warn
#    com.gameplatform.server.task.UsingLinkCheckTask: warn
#    # 完成检测服务降噪（屏蔽debug“置信度低”之类日志）
#    com.gameplatform.server.service.detection.GameCompletionDetectionService: warn
#    # 设备任务更新服务：只保留警告/错误（不输出“开始处理设备/点数已更新为”等调试信息）
#    com.gameplatform.server.service.link.DeviceTaskUpdateService: warn
    # Mapper 与 SQL 调用降噪（屏蔽 MyBatis 的参数/SQL DEBUG）
    com.gameplatform.server.mapper: warn
    com.baomidou.mybatisplus: warn
    org.apache.ibatis: warn
    org.mybatis: warn
    com.zaxxer.hikari: warn
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  console:
    enabled: true

security:
  jwt:
    secret: "change-this-secret-to-a-long-random-string-please"
    access-token-minutes: 1440
    refresh-token-days: 7

# Swagger/OpenAPI 配置
springdoc:
  api-docs:
    path: /api-docs
  swagger-ui:
    path: /swagger-ui.html
    tags-sorter: alpha
    operations-sorter: alpha
    doc-expansion: none
    disable-swagger-default-url: true
    display-request-duration: true
  packages-to-scan: com.gameplatform.server.controller

# 外部脚本端配置与链接过期时间
script:
  base-url: "http://36.138.184.60:12345"
  api-base-url: "http://36.138.184.60:1234"
  connect-timeout-ms: 3000
  read-timeout-ms: 5000

# 服务器配置
app:
  base-url: "https://uzi1.cn"  # 生产环境需要配置为实际域名
#  base-url: "http://localhost:18080"  # 本地测试环境
  
link:
  expire-hours: 2
