server:
  port: 8083
  servlet:
    context-path: /product

spring:
  application:
    name: product-service
  
  # 数据源配置（生产环境）
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:erp_java}?useUnicode=true&characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: ${DB_USERNAME:erp_user}
    password: ${DB_PASSWORD:erp123456}
    hikari:
      connection-timeout: 30000
      maximum-pool-size: 50
      minimum-idle: 10
      idle-timeout: 600000
      max-lifetime: 1800000
  
  # Redis配置（生产环境）
  redis:
    host: ${REDIS_HOST:localhost}
    port: ${REDIS_PORT:6379}
    password: ${REDIS_PASSWORD:redis123456}
    database: ${REDIS_DB:0}
    timeout: 3000ms
    lettuce:
      pool:
        max-active: 50
        max-idle: 20
        min-idle: 10
  
  # MyBatis Plus配置
  mybatis-plus:
    configuration:
      map-underscore-to-camel-case: true
      log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
    global-config:
      db-config:
        logic-delete-field: deletedAt
        logic-delete-value: NOW()
        logic-not-delete-value: NULL
        id-type: auto
  
  # Nacos配置
  cloud:
    nacos:
      discovery:
        server-addr: ${NACOS_SERVER:localhost:8848}
        namespace: ${NACOS_NAMESPACE:public}
        group: DEFAULT_GROUP
      config:
        server-addr: ${NACOS_SERVER:localhost:8848}
        file-extension: yaml
        group: DEFAULT_GROUP
        namespace: ${NACOS_NAMESPACE:public}

# 日志配置
logging:
  level:
    com.erp.product: INFO
    org.springframework.web: WARN
  pattern:
    console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
  file:
    name: /var/log/product-service/application.log

# 服务配置
service:
  product:
    goods-code-prefix: "G"
