spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lesingle-creation}?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=true
    username: ${DB_USERNAME:root}
    password: ${DB_PASSWORD:haidiAdminq1w2e3}
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      initial-size: 10
      min-idle: 10
      max-active: 50
      max-wait: 60000

  data:
    redis:
      host: ${REDIS_HOST:127.0.0.1}
      port: ${REDIS_PORT:6379}
      password: ${REDIS_PASSWORD:laomo_redis123}
      database: 8

  flyway:
    clean-disabled: true

# CORS 跨域配置（生产环境必须通过环境变量注入）
cors:
  allowed-origins: ${CORS_ALLOWED_ORIGINS}

# 生产环境关闭 SQL 日志和 Swagger
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl

springdoc:
  api-docs:
    enabled: false
  swagger-ui:
    enabled: false

knife4j:
  enable: false

logging:
  level:
    com.lesingle: info

# JWT 配置（生产环境必须通过环境变量注入密钥）
jwt:
  secret: ${JWT_SECRET:Kht8CH2Ky98cnK2Hkhf9UHF9Hiks8h234b}

# 乐读派 AI 创作系统配置
leai:
  org-id: ${LEAI_ORG_ID:gdlib}
  app-secret: ${LEAI_APP_SECRET:leai_mnoi9q1a_mtcawrn8y}
  api-url: ${LEAI_API_URL:http://121.40.20.224:8267}
  reconcile-interval: 1800000      # B3对账间隔：30分钟（生产环境）
  reconcile-initial-delay: 60000   # 初始延迟：60秒

# 阿里云 OSS 配置（开发环境）
aliyun:
  oss:
    endpoint: ${OSS_ENDPOINT:oss-cn-shenzhen.aliyuncs.com}
    access-key-id: ${OSS_ACCESS_KEY_ID:LTAI5tKZhPofbThbSzDSiWoK}
    access-key-secret: ${OSS_ACCESS_KEY_SECRET:FtcsC7oQX3T0NaChaa9FYq2aoysQFM}
    bucket-name: ${OSS_BUCKET_NAME:lesingle-creation}
    max-file-size: ${OSS_MAX_FILE_SIZE:10485760}
    # 前端直传跨域：启动时自动配置 OSS CORS
    cors-enabled: ${OSS_CORS_ENABLED:true}
    cors-allowed-origins: ${OSS_CORS_ORIGINS:*}
  # 短信服务配置（生产环境）
  sms:
    access-key-id: ${SMS_ACCESS_KEY_ID:LTAI5tKZhPofbThbSzDSiWoK}
    access-key-secret: ${SMS_ACCESS_KEY_SECRET:FtcsC7oQX3T0NaChaa9FYq2aoysQFM}
    sign-name: ${SMS_SIGN_NAME:乐读派}
    template-code: ${SMS_TEMPLATE_CODE:SMS_490225426}
    enabled: true
