spring:
  application:
    name: cattleTends
  
  # 数据库配置
  datasource:
    url: jdbc:mysql://129.211.213.226:3306/cattleTends?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    username: root
    password: Aiotagro@741
    # 如果密码包含特殊字符导致连接失败，可以尝试在URL中编码密码
    # 或者检查数据库服务器是否允许当前IP访问
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 10
      minimum-idle: 5
      connection-timeout: 30000
      idle-timeout: 600000
      max-lifetime: 1800000

  # JPA配置
  jpa:
    hibernate:
      ddl-auto: none
      naming:
        physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
    show-sql: true
    properties:
      hibernate:
        dialect: org.hibernate.dialect.MySQLDialect
        format_sql: true
    open-in-view: false

# 服务器配置
server:
  port: 12240
  servlet:
    context-path: /

# 日志配置
logging:
  level:
    root: INFO
    com.example.cattletends: DEBUG
    com.example.cattletends.controller: DEBUG
    com.example.cattletends.service: DEBUG
    org.springframework.web: DEBUG
    org.springframework.web.servlet.DispatcherServlet: DEBUG
    org.hibernate.SQL: DEBUG
    org.hibernate.type.descriptor.sql.BasicBinder: TRACE
  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"

# Swagger配置（Springfox 2.9.2）
# 无需额外配置，使用默认路径 /swagger-ui.html

