server:
  port: 8086
spring:
  application:
    name: supplier-service
  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=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: ${DB_USER:root}
    password: ${DB_PASSWORD:root}
    hikari:
      minimum-idle: 5
      maximum-pool-size: 20
      idle-timeout: 30000
      connection-timeout: 30000
      max-lifetime: 1800000
  redis:
    host: ${REDIS_HOST:localhost}
    port: ${REDIS_PORT:6379}
    password: ${REDIS_PASSWORD:}
    database: 0
    timeout: 10000
    lettuce:
      pool:
        max-active: 8
        max-idle: 8
        min-idle: 0
        max-wait: -1
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
    serialization:
      write-dates-as-timestamps: false
  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.supplier.entity
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
  global-config:
    db-config:
      id-type: auto
      logic-delete-field: deleted
      logic-delete-value: 1
      logic-not-delete-value: 0
supplier:
  code-prefix: S
purchase:
  service:
    url: ${PURCHASE_SERVICE_URL:http://purchase-service}
product:
  service:
    url: ${PRODUCT_SERVICE_URL:http://product-service}
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: supplier-service
    export:
      prometheus:
        enabled: true
  health:
    livenessstate:
      enabled: true
    readinessstate:
      enabled: true
logging:
  level:
    com.erp.supplier: DEBUG
    com.baomidou.mybatisplus: INFO
  pattern:
    console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %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: supplier-service API
      description: API Documentation
      version: 1.0.0
      contact:
        name: ERP Team
        email: dev@erpzbbh.cn

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