server:
  port: ${SERVER_PORT:18090}

spring:
  application:
    name: ocr-platform
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: ${SPRING_DATASOURCE_URL:jdbc:mysql://127.0.0.1:13306/ocrplatform?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true}
    username: ${SPRING_DATASOURCE_USERNAME:ocrplatform_app}
    password: ${SPRING_DATASOURCE_PASSWORD:change-me}
  flyway:
    enabled: true
    locations: classpath:db/migration
  jpa:
    hibernate:
      ddl-auto: validate
    open-in-view: false
    properties:
      hibernate:
        jdbc:
          time_zone: Asia/Shanghai
  servlet:
    multipart:
      max-file-size: ${OCR_MAX_FILE_SIZE:50MB}
      max-request-size: ${OCR_MAX_REQUEST_SIZE:60MB}

management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus
  endpoint:
    health:
      probes:
        enabled: true

ocr-platform:
  product-name: OCR Platform
  package-prefix: com.zhengmeng
  integration:
    plugin-api:
      enabled: ${OCR_PLUGIN_API_ENABLED:true}
      client-code-header: ${OCR_PLUGIN_CLIENT_CODE_HEADER:X-API-CLIENT-CODE}
      client-secret-header: ${OCR_PLUGIN_CLIENT_SECRET_HEADER:X-API-CLIENT-SECRET}
      default-rate-limit-per-minute: ${OCR_PLUGIN_RATE_LIMIT_PER_MINUTE:60}
      unauthenticated-rate-limit-per-minute: ${OCR_PLUGIN_UNAUTH_RATE_LIMIT_PER_MINUTE:20}
      audit-enabled: ${OCR_PLUGIN_AUDIT_ENABLED:true}
  storage:
    root-path: ${OCR_STORAGE_ROOT:/tmp/ocr-platform/documents}
  engine:
    default-code: ${OCR_ENGINE_DEFAULT_CODE:paddle-layout}
    paddle-layout:
      enabled: ${PADDLE_LAYOUT_ENABLED:false}
      endpoint: ${PADDLE_LAYOUT_ENDPOINT:http://192.168.1.13:18080/layout-parsing}
      timeout: ${PADDLE_LAYOUT_TIMEOUT:60s}
    pp-chat-ocr:
      enabled: ${PP_CHAT_OCR_ENABLED:false}
      visual-endpoint: ${PP_CHAT_OCR_VISUAL_ENDPOINT:http://192.168.1.13:18083/chatocr-visual}
      chat-endpoint: ${PP_CHAT_OCR_CHAT_ENDPOINT:http://192.168.1.13:18083/chatocr-chat}
      timeout: ${PP_CHAT_OCR_TIMEOUT:120s}
      extraction-keys: ${PP_CHAT_OCR_EXTRACTION_KEYS:}
  worker:
    enabled: ${OCR_WORKER_ENABLED:true}
    batch-size: ${OCR_WORKER_BATCH_SIZE:5}
    poll-interval-ms: ${OCR_WORKER_POLL_INTERVAL_MS:5000}
    max-retry-attempts: ${OCR_WORKER_MAX_RETRY_ATTEMPTS:2}
    recognizing-timeout-ms: ${OCR_TASK_RECOGNIZING_TIMEOUT_MS:120000}
