server:
  port: 8088
  servlet:
    context-path: /data-import

spring:
  application:
    name: data-import-export-service

  # 数据源配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://${DB_HOST:mysql}:${DB_PORT:3306}/${DB_NAME:erp_java}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: ${DB_USER:erp_user}
    password: ${DB_PASSWORD:erp123456}
    hikari:
      connection-timeout: 30000
      maximum-pool-size: 20
      minimum-idle: 5

  # Redis配置
  redis:
    host: ${REDIS_HOST:redis}
    port: ${REDIS_PORT:6379}
    password: ${REDIS_PASSWORD:redis123456}
    database: 0
    timeout: 3000ms
    lettuce:
      pool:
        max-active: 20
        max-idle: 10
        min-idle: 5

  # MyBatis Plus配置
  mybatis-plus:
    configuration:
      map-underscore-to-camel-case: true
      log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
    global-config:
      db-config:
        logic-delete-field: deletedAt
        logic-delete-value: NOW()
        logic-not-delete-value: NULL
        id-type: auto
    mapper-locations: classpath*:/mapper/**/*.xml

  # 文件上传配置
  servlet:
    multipart:
      enabled: true
      max-file-size: 100MB
      max-request-size: 100MB

# 日志配置
logging:
  level:
    com.erp.dataimport: INFO
    org.springframework.web: WARN
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
  file:
    name: /app/logs/data-import-export-service.log

# 服务配置
service:
  import-export:
    temp-dir: /tmp/import-export
    batch-size: 1000
    max-excel-rows: 100000
    template-dir: templates
