spring:
  application:
    name: mqtt-charging-system
  # DataSource Config
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://yuyun-hk1.stormrain.cn:3306/mqtt_power?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
    username: root
    password: mysql_3wdCbm
  mvc:
    pathmatch:
      matching-strategy: ANT_PATH_MATCHER
  # session 失效时间（秒）
  session:
    timeout: 86400
server:
  port: 7529
  servlet:
    context-path: /api
    session:
      timeout: 86400 # 设置session的过期时间，单位为秒，这里设置为1天
mybatis-plus:
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      logic-delete-field: isDelete # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
      logic-delete-value: 1 # 逻辑已删除值(默认为 1)
      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)

# Logging configuration
logging:
  level:
    # Set root logger level (e.g., INFO, WARN, ERROR, DEBUG)
    root: INFO
    # Set specific package levels
    com.yupi.project: DEBUG # Example: Set your project's base package to DEBUG
    org.springframework.web: INFO # Set Spring Web logging level
    org.springframework.security: DEBUG # Enable Spring Security DEBUG logging
    org.mybatis: INFO # Set MyBatis logging level
    # ... other specific loggers
  #file:
    #name: logs/application.log # Log file name
    #path: ./logs # Log file path
  #pattern:
    #console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
    #file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"

# ===================================================================
# MQTT Configurations
# ===================================================================
mqtt:
  broker-url: tcp://yuyun-hk1.stormrain.cn:1883
  username:  # Public broker, no credentials specified for connection
  password:  # Public broker, no credentials specified for connection
  client-id-prefix: backend-yupi-mqtt-power- # Unique client ID prefix for our project
  default-qos: 1 # Default Quality of Service (0, 1, 2)
  connection-timeout: 30 # Connection timeout in seconds
  keep-alive-interval: 60 # Keep alive interval in seconds
  command-topic-base: yupi_mqtt_power_project/robot/command # Prefixed base topic for sending commands
  status-topic-base: yupi_mqtt_power_project/robot/status   # Prefixed base topic for receiving status
  task: # Task specific configurations
    timeoutSeconds: 300 # Default 300 seconds (5 minutes) for a task to be considered timed out
    timeoutCheckRateMs: 60000 # Default 60000 ms (1 minute) for how often to check for timed out tasks
  logger:
    enabled: true
    client-id-prefix: backend-yupi-mqtt-power-logger- # Ensure this is different from the main client-id-prefix
    # Topics to subscribe to for logging. Use '#' for all sub-topics.
    # These should cover all topics the main application interacts with for upstream messages.
    topics:
      - "yupi_mqtt_power_project/robot/status/#" # Example: status messages from robots
      # Add other topics for upstream messages (e.g., heartbeats, specific acknowledgements if not covered by status)
      # - "yupi_mqtt_power_project/robot/heartbeat/#" # If heartbeats are on a separate root
    async: # Async properties for logging tasks
      core-pool-size: 2
      max-pool-size: 5
      queue-capacity: 1000 # Queue for logging tasks
      thread-name-prefix: "mqtt-log-async-"
    retention:
      days: 30 # Log retention period in days (for future cleanup tasks)