server:
  port: 8080

spring:
  application:
    name: server-snack

  # 数据源配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/snack_mall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
    username: root
    password: 123456

  # Redis 配置
  data:
    redis:
      host: localhost
      port: 6379
      password: 123456
      database: 0
      lettuce:
        pool:
          max-active: 8
          max-idle: 8
          min-idle: 0
          max-wait: -1ms

  # 文件上传大小限制
  servlet:
    multipart:
      max-file-size: 10MB
      max-request-size: 20MB

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

# Sa-Token 配置
sa-token:
  # token 名称（同时也是 cookie 名称）
  token-name: Authorization
  # token 有效期（单位：秒），默认30天，-1 代表永不过期
  timeout: 2592000
  # token 最低活跃频率（单位：秒），-1 表示不限制
  active-timeout: -1
  # 是否允许同一账号多地同时登录（为 true 时允许一起登录，为 false 时新登录挤掉旧登录）
  is-concurrent: true
  # 在多人登录同一账号时，是否共用一个 token
  is-share: false
  # token 风格（默认可取值：uuid、simple-uuid、random-32、random-64、random-128、tik）
  token-style: uuid
  # 是否输出操作日志
  is-log: false
  token-prefix: Bearer

# Knife4j 配置
knife4j:
  enable: true
  setting:
    language: zh_cn

# 文件上传本地存储路径（本地存储时使用）
snack:
  storage:
    # 存储类型：local | s3
    #  local：存储到 ./uploads/ 目录（适合本地开发 / 单机部署）
    #  s3  ：存储到 S3 协议的对象存储（RustFS / MinIO / AWS S3 / 阿里云 OSS）
    type: s3

  upload:
    # 文件上传根路径（仅 local 模式生效）
    path: ./uploads/
    # 访问域名前缀（仅 local 模式生效）
    domain: http://localhost:8080/uploads/

  # S3 / 对象存储配置（仅 storage.type=s3 生效）
  s3:
    # S3 兼容服务端点（RustFS / MinIO 示例：http://localhost:9000）
    endpoint: http://localhost:9000
    # 区域（AWS S3 必填，RustFS / MinIO 填 us-east-1 即可）
    region: us-east-1
    # 是否使用路径风格访问（RustFS / MinIO = true，AWS S3 = false）
    path-style-access: true
    # AccessKey
    access-key: WbpIY0VtEZyTgZ9efQHv
    # SecretKey
    secret-key: jhgQ1SXnk599tPqe784GjnH4VJ8K20jK1E5Zht5I
    # 存储桶名称（bucket 不存在时会自动尝试创建）
    bucket: snack-mall
    # 公网访问域名（用于拼接文件 URL；可配合 CDN 域名）
    public-domain: http://localhost:9000/snack-mall

  seckill:
    # 抢购用户限购记录在 Redis 中的过期时间（秒）—— 用于活动结束后清理
    record-ttl-seconds: 86400

alipay:
  appId: 9021000129648617
  #  沙箱网关（旧 openapi.alipaydev.com 证书已过期，2026-06 起须用新网关）
  gateway: https://openapi-sandbox.dl.alipaydev.com/gateway.do
  #  应用私钥
  appPrivateKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDFR2RFzPaCeO0o8ajYOnvSLgekKJ1RKiqUPx2Yw5olXvHIBzEn3Amkyy0SRIQDjoAXdvAsKkOFXLMbEHEAEkCOJLfm5/RQP9hY7jaCrLBV4rH/uJsFkHInPJmUXwOZk7CYdPS5vivW82LqXb8qFpYOETr/6dB074X2smk1r8hISm01TPDsGYr/z5ry8t+JtMTKkPioO32OvaG0ZeksPnHGdgZFoFboaVkOM/jbFSnURlhtVfw6RxnQWMSL7zrtDreLJjJ6CyZI4dEaUcJFyb77QVb+jbDmBhO9/1ul1n65jjRD1YgRyhZg8B9+nvCj7nM60R82PbD0ZzA16R/mW9xfAgMBAAECggEAWx2PHYH99OLfPoLm5f+VAs1JsDMl/b/I7LF9/PmSr2H7r9RKisthFODWT1Kf2nithqjjYrKefvECtCRS3KKReFVTLu3A9HOYe/KB8LbLts8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9UG7ASvQFXVeQAgIhQ3yZ/nHvcrY7y
  #  支付宝公钥
  alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl54qsMxRkuisHTif0XyMG/ct3+Dx44gC5yj5k729AAJxXd5Y7uFit+FeN805W7ltm0sXB/gFNKsxe0ZJv5N+CO3/GfFtxDZK3FGxgkzH+6isXOI2pl2bOv5jWh/LcyOckA0SAq/p0AUjy0m8/FNJmq321q9SCz8UYSq188iYgawPdUtbuhwUlX2pJTWW25c5qSyNBeiXViODqkeQ9PhBYaEivRa/iY536ypRpEJ8QKcWcfj0INhh7gvDdbCSveRakCAxTkklMtahmkSuUlzVRhAkzhShX+1U2l7tUScimqEzjYJ2FdvhYYRQxjOt054hPug67ptNxPutGhPOI4L8FwIDAQAB
  #  回调地址
  notifyUrl: http://47.113.122.255:10080
  #  返回地址
  returnUrl: http://127.0.0.1:5174/user
