spring:
  application:
    name: haha-miniapp

  # 数据库配置
  datasource:
    url: jdbc:mysql://server.kuaiyuman.cn:3306/haha?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=250&prepStmtCacheSqlLimit=2048
    username: root
    password: KuaiyuMan/*-
    driver-class-name: com.mysql.cj.jdbc.Driver
    # HikariCP 连接池配置
    hikari:
      minimum-idle: 3
      maximum-pool-size: 10
      max-lifetime: 1800000
      idle-timeout: 300000
      connection-timeout: 30000
      connection-test-query: SELECT 1
      keepalive-time: 30000

  # Redis 配置
  data:
    redis:
      host: server.kuaiyuman.cn
      port: 6379
      password: "KtXA^Zx!TZmLEy(@JjB@2(TVG0kdy5)&"
      database: 8
      timeout: 10000
      lettuce:
        pool:
          max-active: 10
          max-wait: 3000
          max-idle: 8
          min-idle: 2
          time-between-eviction-runs: 30000
        shutdown-timeout: 100

  # 数据库初始化
  sql:
    init:
      enabled: true
      mode: always
      schema-locations: classpath:sql/user.sql
      encoding: UTF-8

# MyBatis-Plus 配置
mybatis-plus:
  configuration:
    map-underscore-to-camel-case: true
  global-config:
    enable-sql-runner: false

# PageHelper 分页插件配置
pagehelper:
  # 指定数据库方言
  helper-dialect: mysql
  # 分页合理化参数，默认false。当设置为true时，pageNum<=0时会查询第一页，pageNum>pages（超过总数时），会查询最后一页
  reasonable: true
  # 支持通过Mapper接口参数来传递分页参数，默认false
  support-methods-arguments: true
  # 为了支持startPage(Object params)方法，增加了一个"params"参数来配置参数映射，用于从Map或ServletRequest中取值
  params: count=countSql
  # 总是返回PageInfo类型，默认false
  return-page-info: check

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

# 微信相关配置
wechat:
  # 支付配置 - 暂时屏蔽，等微信商户注册好后再配置
  # pay:
  #   app-id: wxef6ffc2591d04b1b
  #   mch-id: 1888888888
  #   mch-key: 88888888888888888888888888888888
  #   v3-api-key: 88888888888888888888888888888888
  #   notify-url: http://localhost:7077/api/payment/callback/wechat
  #   private-key-path: classpath:cert/apiclient_key.pem
  #   merchant-serial-number: YOUR_MERCHANT_SERIAL_NUMBER
  #   service-id: YOUR_PAY_SCORE_SERVICE_ID
  #   pay-score-notify-url: http://localhost:7077/api/payment/callback/wechat_payscore
  # 小程序配置
  miniapp:
    app-id: your_wechat_miniapp_appid
    secret: your_wechat_miniapp_secret
    token: your_wechat_miniapp_token
    aes-key: your_wechat_miniapp_aes_key

# 哈哈零兽配置
haha:
  api:
    app-id: 2601051549145878
    app-secret: 06e1be59332b00de0baad82002cdbcb5
    base-url: http://api.hahabianli.com/

# Sa-Token 配置
sa-token:
  # token 名称（同时也是 cookie 名称）
  token-name: accessToken
  # token 有效期（单位：秒）- 7天
  timeout: 604800
  # token 临时有效期（单位：秒）
  active-timeout: -1
  # 是否允许同一账号多地同时登录
  is-concurrent: true
  # 同一账号最大登录数量
  max-login-count: 10
  # token 风格
  token-style: uuid
  # 是否输出操作日志
  is-log: true

# 日志配置
logging:
  level:
    root: info
    com.haha.miniapp: debug
  file:
    # 日志文件路径（相对于项目启动目录）
    path: ./logs
    name: ./logs/haha-miniapp.log
