server:
  port: 8085
  servlet:
    context-path: /
  tomcat:
    max-http-form-post-size: 100MB

spring:
  application:
    name: music-houduan

  # 数据库配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/music_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
    hikari:
      minimum-idle: 5
      maximum-pool-size: 20
      idle-timeout: 30000
      max-lifetime: 1800000
      connection-timeout: 30000

  # JPA配置
#  jpa:
#    database-platform: org.hibernate.dialect.MySQL8Dialect
#    hibernate:
#      ddl-auto: update
#    show-sql: false
#    properties:
#      hibernate:
#        format_sql: false

  # Redis配置
  data:
    redis:
      host: 127.0.0.1
      password: 123456
      timeout: 10000
      lettuce:
        pool:
          max-active: 8
          max-wait: -1
          max-idle: 8
          min-idle: 0

  # 文件上传配置
  servlet:
    multipart:
      enabled: true
      max-file-size: 100MB
      max-request-size: 100MB

  # Jackson配置
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
    serialization:
      write-dates-as-timestamps: false


# Sa-Token配置
sa-token:
  # token名称 (同时也是cookie名称)
  token-name: satoken
  # token有效期，单位s 默认30天, -1代表永不过期
  timeout: 2592000
  # token临时有效期 (指定时间内无操作就过期) 单位: 秒
  active-timeout: -1
  # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
  is-concurrent: true
  # 在多人登录同一账号时，是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
  is-share: false
  # token风格
  token-style: uuid
  # 是否输出操作日志
  is-log: true
  # 是否从cookie中读取token
  is-read-cookie: true
  # 是否从请求头中读取token
  is-read-header: true
  # 是否从请求体里读取token
  is-read-body: false
  # 是否在初始化配置时打印版本字符画
  is-print: false

# 文件上传配置
file:
  # 上传路径
#  upload-path: C:/it/music-houduan/
  upload-path: ${user.dir}/music-houduan/upload
  # 访问路径
  access-path: /upload/
  # 允许的文件类型
  allowed-types: jpg,jpeg,png,gif,mp3,wav,lrc,txt

# 日志配置
logging:
  level:
    root: info
    com.test.musichouduan: debug
    cn.dev33.satoken: debug
    org.hibernate: warn
    org.hibernate.SQL: off
    org.hibernate.type.descriptor.sql: off
    org.springframework: warn
  file:
    name: logs/music-houduan.log

# Knife4j配置
knife4j:
  enable: true
  setting:
    language: zh_cn
    enable-swagger-models: true
    enable-document-manage: true
    swagger-model-name: 数据模型
    enable-version: true
    enable-footer: false
    enable-footer-custom: true
    footer-custom-content: 音乐应用API文档
  documents:
    - group: 默认
      name: 项目介绍
      locations: classpath:markdown/*
  production: false

# Swagger配置
springdoc:
  swagger-ui:
    path: /swagger-ui/index.html
    tags-sorter: alpha
    operations-sorter: alpha
    disable-swagger-default-url: true
    display-request-duration: true
  api-docs:
    path: /v3/api-docs
  group-configs:
    - group: '默认'
      paths-to-match: '/**'
  default-flat-param-object: true
