# report-service
spring:
  application:
    name: report-service
  profiles:
    active: ${SPRING_PROFILES_ACTIVE:dev}
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:erp_db}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: ${DB_USERNAME:root}
    password: ${DB_PASSWORD:Admin1234}
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      initial-size: 5
      min-idle: 5
      max-active: 20
      max-wait: 60000
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      validation-query: SELECT 1
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      pool-prepared-statements: true
      max-pool-prepared-statement-per-connection-size: 20
      filters: stat,wall,slf4j
  data:
    redis:
      host: ${REDIS_HOST:localhost}
      port: ${REDIS_PORT:6379}
      password: ${REDIS_PASSWORD:Y(@r5tGk9$Lp2}
      database: 0
      timeout: 5000ms
      lettuce:
        pool:
          max-active: 20
          max-idle: 10
          min-idle: 5
          max-wait: -1ms
  servlet:
    multipart:
      enabled: true
      max-file-size: 100MB
      max-request-size: 100MB
  zipkin:
    base-url: ${ZIPKIN_SERVER_URL:http://localhost:9411}
  sleuth:
    sampler:
      probability: 1.0
mybatis-plus:
  mapper-locations: classpath*:/mapper/**/*.xml
  type-aliases-package: com.erp.report.entity
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deletedAt
      logic-delete-value: now()
      logic-not-delete-value: '0'
  configuration:
    map-underscore-to-camel-case: true
    cache-enabled: false
    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
server:
  port: ${SERVER_PORT:8084}
  tomcat:
    threads:
      max: 200
      min-spare: 10
    accept-count: 100
    max-connections: 10000
export:
  base-path: ${EXPORT_BASE_PATH:/data/exports}
  max-rows: 10000
  async:
    core-pool-size: 4
    max-pool-size: 8
    queue-capacity: 100
  cleanup:
    cron: 0 0 2 * * ?
    retention-days: 7
alibaba:
  cloud:
    nacos:
      discovery:
        server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848}
        namespace: ${NACOS_NAMESPACE:public}
      config:
        server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848}
        file-extension: yml
        namespace: ${NACOS_NAMESPACE:public}
spring.cloud:
  nacos:
    discovery:
      server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848}
    config:
      server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848}
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,caches,beans,env,loggers,threaddump,heapdump,scheduledtasks
  endpoint:
    health:
      show-details: always
      probes:
        enabled: true
    prometheus:
      enabled: true
    info:
      enabled: true
  metrics:
    tags:
      application: ${spring.application.name}
    export:
      prometheus:
        enabled: true
logging:
  level:
    root: INFO
    com.erp.report: DEBUG
    com.erp.report.export: DEBUG
  pattern:
    console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n'
    file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n'
  file:
    name: /var/log/report-service/application.log
    max-size: 100MB
    max-history: 30
springdoc:
  api-docs:
    enabled: true
    path: /v3/api-docs
  swagger-ui:
    enabled: true
    path: /swagger-ui.html
knife4j:
  enable: true
  setting:
    language: zh_cn
