# File Service 配置文件
# 用于配置中心或独立部署

# ==================== 服务配置 ====================
service:
  name: file-service
  port: 8082
  host: 0.0.0.0

# ==================== 数据库配置 ====================
database:
  host: 111.229.80.149
  port: 3306
  name: erp_db
  username: root
  password: nihao588+
  pool:
    initial-size: 10
    min-idle: 10
    max-active: 50

# ==================== Redis配置 ====================
redis:
  host: 111.229.80.149
  port: 6379
  password: "Y(@r5tGk9\$Lp2"
  database: 0

# ==================== 文件存储配置 ====================
storage:
  # 默认存储类型: local, oss, minio
  default: local
  
  # 本地存储
  local:
    enabled: true
    base-path: /var/erp/uploads
    base-url: https://erp.erpzbbh.cn/files
  
  # 阿里云OSS（可选）
  oss:
    enabled: false
    endpoint: ""
    access-key-id: ""
    access-key-secret: ""
    bucket-name: ""
    base-url: ""
    custom-domain: ""
  
  # MinIO（可选）
  minio:
    enabled: false
    endpoint: ""
    access-key: ""
    secret-key: ""
    bucket-name: erp-files
    base-url: ""
    secure: false

# ==================== 上传配置 ====================
upload:
  max-size: 10485760  # 10MB
  max-files-per-request: 10
  allowed-types:
    - image/jpeg
    - image/png
    - image/gif
    - image/bmp
    - image/svg+xml
    - image/webp
    - application/pdf
    - application/msword
    - application/vnd.openxmlformats-officedocument.wordprocessingml.document
    - application/vnd.ms-excel
    - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    - application/vnd.ms-powerpoint
    - application/vnd.openxmlformats-officedocument.presentationml.presentation
    - text/plain
    - text/csv
    - application/zip
    - application/x-rar-compressed
    - application/x-7z-compressed
  allowed-extensions:
    - jpg
    - jpeg
    - png
    - gif
    - bmp
    - svg
    - webp
    - pdf
    - doc
    - docx
    - xls
    - xlsx
    - ppt
    - pptx
    - txt
    - csv
    - zip
    - rar
    - 7z

# ==================== Nacos配置中心 ====================
nacos:
  server: 127.0.0.1:8848
  namespace: public
  group: ERP_GROUP

# ==================== 日志配置 ====================
logging:
  level: INFO
  path: /app/logs
  max-file-size: 100MB
  max-history: 30
