server:
  port: 8082

spring:
  application:
    name: hzhub-erp
  
  # 多数据源配置
  datasource:
    # 主数据源 - SQL Server 2008 R2 (ERP直连)
    primary:
      url: jdbc:sqlserver://192.168.x.x:1433;database=ERP;encrypt=false;trustServerCertificate=true
      username: ${ERP_DB_USERNAME:sa}
      password: ${ERP_DB_PASSWORD:}
      driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
      hikari:
        maximum-pool-size: 10
        minimum-idle: 5
        connection-timeout: 30000
    
    #  secondary数据源 - MySQL (预留)
    secondary:
      url: jdbc:mysql://localhost:3306/hzhub_erp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
      username: ${MYSQL_USERNAME:root}
      password: ${MYSQL_PASSWORD:}
      driver-class-name: com.mysql.cj.jdbc.Driver
      hikari:
        maximum-pool-size: 10
        minimum-idle: 5

# MyBatis Plus配置
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true
  global-config:
    db-config:
      logic-delete-field: deleted
      logic-delete-value: 1
      logic-not-delete-value: 0
  mapper-locations: classpath*:mapper/**/*.xml

# Sa-Token配置
sa-token:
  token-name: Authorization
  timeout: 86400
  activity-timeout: -1
  is-concurrent: true
  is-share: false
  token-style: uuid
  is-log: false

# 日志配置
logging:
  level:
    com.foshanhuiya.erp: debug
    org.springframework.jdbc: debug
