application.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # 环境配置
  2. server:
  3. port: 8094
  4. servlet:
  5. context-path: /api # 全局接口前缀: 同一个域名提供转发不同路径到不同端口方案
  6. # 条件注入
  7. spel:
  8. scheduling: true # 定时任务是否执行
  9. multiSource: false # 是否多数据源配置
  10. # 资源配置
  11. spring:
  12. profiles:
  13. active: prod
  14. # 热部署
  15. devtools:
  16. restart:
  17. enabled: false
  18. additional-paths: src/main/java # 设置重启的目录
  19. exclude: WEB-INF/** # classpath目录下的WEB-INF文件夹内容修改不重启
  20. # 文件上传
  21. servlet:
  22. multipart:
  23. max-file-size: 10MB
  24. max-request-size: 20MB
  25. # 数据库
  26. datasource:
  27. type: com.zaxxer.hikari.HikariDataSource
  28. hikari:
  29. connection-init-sql: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
  30. pool-name: DateHikariCP
  31. minimum-idle: 0
  32. maximum-pool-size: 10
  33. idle-timeout: 30000
  34. max-lifetime: 120000 # 小于数据库超时大于业务执行返回时间[hikari默认30m, mysql默认10m]
  35. connection-timeout: 30000 # 数据库连接超时时间,默认30秒,即30000
  36. # JPA
  37. jpa:
  38. hibernate:
  39. ddl-auto: none # 对表没有任何操作. 若不设置为 non, flyway.enabled 配置会无效, 在没有数据库连接情况下程序无法启动
  40. show-sql: false
  41. open-in-view: false # 开启可用于多对一懒加载, 但可能存在并发缓存问题
  42. properties:
  43. hibernate:
  44. format_sql: true
  45. generate_statistics: false # 生产环境有效
  46. jdbc:
  47. batch_size: 500 # 开启批量更新与删除
  48. batch_versioned_data: true
  49. order_inserts: true
  50. order_updates: true
  51. query:
  52. plan_cache_max_size: 64 # hibernate会缓存sql语句以减少重复编译
  53. plan_parameter_metadata_max_size: 32
  54. plan_cache_max_soft_references: 1024
  55. plan_cache_max_strong_references: 64
  56. # 数据库版本
  57. flyway:
  58. enabled: false # 需要配置 jpa.hibernate.ddl-auto 为 none. 否则 flyway.enabled 配置会无效, 在没有数库连接情况下程序无法启动
  59. encoding: UTF-8
  60. locations: classpath:db/migration # 迁移sql脚本文件存放路径,默认db/migration
  61. sql-migration-prefix: V # 迁移sql脚本文件名称的前缀,默认V
  62. sql-migration-separator: __ # 迁移sql脚本文件名称的分隔符,默认2个下划线__
  63. sql-migration-suffixes: .sql # 迁移sql脚本文件名称的后缀
  64. validate-on-migrate: true # 迁移时是否进行校验,默认true
  65. baseline-on-migrate: true # 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
  66. # jsp
  67. mvc:
  68. view:
  69. prefix: /WEB-INF/jsp/
  70. suffix: .jsp
  71. # swagger3
  72. application:
  73. name: mjava
  74. # swagger3
  75. swagger:
  76. enable: false
  77. application-name: ${spring.application.name}
  78. application-version: 1.0
  79. application-description: mjava-mcli ~> springfox swagger 3.0
  80. try-host: http://localhost:${server.port}/${server.servlet.context-path}
  81. # 日志配置
  82. logging:
  83. level:
  84. com.malk: debug
  85. org.springframework: warn
  86. file:
  87. path: ./log
  88. # 路径配置
  89. file:
  90. path:
  91. file: ./tmp/file
  92. image: ./tmp/image
  93. tmp: ./tmp
  94. source:
  95. fonts: ./sys/fonts/simsun.ttc.ttc
  96. # 企业配置
  97. corp:
  98. # 公共服务
  99. servlet:
  100. aliwork: false
  101. dingtalk: false
  102. diwork: true
  103. feishu: true
  104. teambition: true
  105. # 通用设置
  106. timeOut: 300
  107. timeAwait: 600