server:
  port: 8084
spring:
  application:
    name: warehouse-service
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://${DB_HOST:111.229.80.149}:3306/erp_db?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false
    username: ${DB_USER:root}
    password: ${DB_PASS:nihao588+}
    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
  redis:
    host: ${REDIS_HOST:111.229.80.149}
    port: ${REDIS_PORT:6379}
    password: ${REDIS_PASS:Y(@r5tGk9$Lp2}
    database: 0
    timeout: 3000
    lettuce:
      pool:
        max-active: 8
        max-idle: 8
        min-idle: 0
        max-wait: -1ms
  zipkin:
    base-url: ${ZIPKIN_SERVER_URL:http://localhost:9411}
    sender:
      type: web
  sleuth:
    sampler:
      probability: 1.0
      rate: 100
    trace-id128: true
mybatis-plus:
  mapper-locations: classpath*:/mapper/**/*.xml
  type-aliases-package: com.erp.warehouse.entity
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deleted
      logic-delete-value: 1
      logic-not-delete-value: 0
stock-alert:
  auto-check:
    enabled: ${STOCK_ALERT_AUTO_CHECK:false}
    cron: 0 */30 * * * ?
warehouse:
  stock:
    default-warning-threshold: 10
    lock-retry-times: 5
    reserve-token-prefix: RSV_
  inbound:
    order-no-prefix:
      purchase: CGRK
      return: THRK
      transfer: DBRK
  outbound:
    order-no-prefix:
      sale: XSCK
      transfer: DBCK
nacos:
  discovery:
    server-addr: ${NACOS_HOST:111.229.80.149}:8848
    namespace: ${NACOS_NAMESPACE:public}
    group: ERP_GROUP
  config:
    server-addr: ${NACOS_HOST:111.229.80.149}:8848
    namespace: ${NACOS_NAMESPACE:public}
    group: ERP_GROUP
    file-extension: yaml
feign:
  client:
    config:
      default:
        connect-timeout: 10000
        read-timeout: 30000
  compression:
    request:
      enabled: true
    response:
      enabled: true
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,prometheus,caches,beans,env,loggers,threaddump,heapdump,scheduledtasks
        base-path: /actuator
  endpoint:
    health:
      show-details: always
      probes:
        enabled: true
    prometheus:
      enabled: true
    info:
      enabled: true
  metrics:
    tags:
      application: warehouse-service
    export:
      prometheus:
        enabled: true
  health:
    livenessstate:
      enabled: true
    readinessstate:
      enabled: true
logging:
  level:
    root: INFO
    com.erp.warehouse: DEBUG
    com.erp.warehouse.client: DEBUG
  pattern:
    console: '%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n'
springdoc:
  api-docs:
    enabled: true
    path: /v3/api-docs
  swagger-ui:
    enabled: true
    path: /swagger-ui.html
    tags-sorter: alpha
    operations-sorter: alpha
    display-request-duration: true
knife4j:
  enable: true
  setting:
    language: zh_cn
  openapi:
    info:
      title: warehouse-service API
      description: API Documentation
      version: 1.0.0
      contact:
        name: ERP Team
        email: dev@erpzbbh.cn

# 公共OpenAPI配置（来自 common-config）
erp:
  openapi:
    title: warehouse-service API
    description: 仓库服务API文档
    version: 1.0.0
    service-url: ${warehouse_service_SERVICE_URL:https://api.erpzbbh.cn}
