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

spring:
  application:
    name: product-service
  
  # 数据源配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3307/erp_java?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: erp_user
    password: erp123456
    hikari:
      connection-timeout: 30000
      maximum-pool-size: 20
      minimum-idle: 5
  
  # Redis配置
  redis:
    host: localhost
    port: 6379
    password: redis123456
    database: 0
    timeout: 3000ms
    lettuce:
      pool:
        max-active: 20
        max-idle: 10
        min-idle: 5
  
  # MyBatis Plus配置
  mybatis-plus:
    configuration:
      map-underscore-to-camel-case: true
      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    global-config:
      db-config:
        logic-delete-field: deletedAt
        logic-delete-value: NOW()
        logic-not-delete-value: NULL
        id-type: auto
    mapper-locations: classpath*:/mapper/**/*.xml
  
  # Nacos配置
  cloud:
      discovery:
        group: DEFAULT_GROUP
      config:
        group: DEFAULT_GROUP

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

# 服务配置
service:
  product:
    # 商品编码前缀
    goods-code-prefix: "G"
