server:
  port: 8082

spring:
  application:
    name: file-service
  servlet:
    multipart:
      enabled: true
      max-file-size: 10MB
      max-request-size: 100MB
  
  # 数据库配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://111.229.80.149:3306/erp_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
    username: root
    password: nihao588+
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      initial-size: 5
      min-idle: 5
      max-active: 20
      max-wait: 60000
  
  # Redis配置
  data:
    redis:
      host: 111.229.80.149
      port: 6379
      password: Y(@r5tGk9$Lp2
      database: 0
      timeout: 5000

# MyBatis Plus配置
mybatis-plus:
  mapper-locations: classpath*:/mapper/**/*.xml
  type-aliases-package: com.erp.file.entity
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deletedAt
      logic-delete-value: now()
      logic-not-delete-value: null
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl

# 文件存储配置
file:
  storage:
    # 默认存储类型：local/oss/minio
    default: local
    
    # 本地存储配置
    local:
      base-path: /var/erp/uploads
      base-url: http://localhost:8082/files
    
    # 阿里云OSS配置（可选）
    oss:
      endpoint: ${OSS_ENDPOINT:}
      access-key-id: ${OSS_ACCESS_KEY_ID:}
      access-key-secret: ${OSS_ACCESS_KEY_SECRET:}
      bucket-name: ${OSS_BUCKET_NAME:}
      base-url: ${OSS_BASE_URL:}
      custom-domain: ${OSS_CUSTOM_DOMAIN:}
    
    # MinIO配置（可选）
    minio:
      endpoint: ${MINIO_ENDPOINT:}
      access-key: ${MINIO_ACCESS_KEY:}
      secret-key: ${MINIO_SECRET_KEY:}
      bucket-name: erp-files
      base-url: ${MINIO_BASE_URL:}
      secure: false
  
  # 上传配置
  upload:
    max-size: 10485760  # 10MB
    max-files-per-request: 10

# Spring Cloud Nacos配置
spring.cloud:
    discovery:
    config:

# Actuator配置
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics
  endpoint:
    health:
      show-details: always

# 日志配置
logging:
  level:
    com.erp.file: DEBUG
    org.springframework.web: INFO
