# =========================================
# Inventory Service 配置
# 库存服务 - 分布式事务参与方
# =========================================

server:
  port: 8082

spring:
  application:
    name: inventory-service
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/inventory_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: root
    password: root123
    hikari:
      maximum-pool-size: 20
      minimum-idle: 5
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000
  cloud:
    nacos:
      discovery:
        enabled: true
        server-addr: ${NACOS_SERVER:localhost:8848}
        namespace: ${NACOS_NAMESPACE:public}
      config:
        enabled: true
        server-addr: ${NACOS_SERVER:localhost:8848}
        namespace: ${NACOS_NAMESPACE:public}
        file-extension: yaml

# Seata配置
seata:
  enabled: true
  tx-service-group: default_tx_group
  service:
    vgroup-mapping:
      default_tx_group: default
    grouplist:
      default: 127.0.0.1:8091
  client:
    rm:
      async-commit-retry-count: 5
      report-success-enable: false
      lock:
        retry-interval: 30
        retry-times: 100
    tm:
      commit-retry-count: 5
      rollback-retry-count: 5
    undo:
      data-validation: true
      log-serialization: jackson
      log-table: undo_log
  registry:
    type: file
    file:
      name: file.conf
  config:
    type: file
    file:
      name: file.conf

mybatis-plus:
  mapper-locations: classpath*:/mapper/**/*.xml
  type-aliases-package: com.erp.inventory.entity
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

logging:
  level:
    com.erp.inventory: DEBUG
    io.seata: DEBUG
