application.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # 环境配置
  2. server:
  3. port: 9001
  4. servlet:
  5. context-path: /api # 全局接口前缀: 同一个域名提供转发不同路径到不同端口方案
  6. # 条件注入
  7. spel:
  8. scheduling: true # 定时任务是否执行
  9. multiSource: true # 是否多数据源配置
  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. pool-name: DateHikariCP
  30. minimum-idle: 0
  31. maximum-pool-size: 10
  32. idle-timeout: 30000
  33. max-lifetime: 120000 # 小于数据库超时大于业务执行返回时间[hikari默认30m, mysql默认10m]
  34. connection-timeout: 30000 # 数据库连接超时时间,默认30秒,即30000
  35. # JPA
  36. jpa:
  37. hibernate:
  38. ddl-auto: none # 对表没有任何操作. 若不设置为 non, flyway.enabled 配置会无效, 在没有数据库连接情况下程序无法启动
  39. show-sql: false
  40. open-in-view: false # 开启可用于多对一懒加载, 但可能存在并发缓存问题
  41. properties:
  42. hibernate:
  43. format_sql: true
  44. generate_statistics: false # 生产环境有效
  45. jdbc:
  46. batch_size: 500 # 开启批量更新与删除
  47. batch_versioned_data: true
  48. order_inserts: true
  49. order_updates: true
  50. query:
  51. plan_cache_max_size: 64 # hibernate会缓存sql语句以减少重复编译
  52. plan_parameter_metadata_max_size: 32
  53. plan_cache_max_soft_references: 1024
  54. plan_cache_max_strong_references: 64
  55. # jsp
  56. mvc:
  57. view:
  58. prefix: /WEB-INF/jsp/
  59. suffix: .jsp
  60. # 日志配置
  61. logging:
  62. level:
  63. com.malk: debug
  64. org.springframework: warn
  65. file:
  66. path: ./log
  67. # 路径配置
  68. file:
  69. path:
  70. file: ./tmp/file/
  71. image: ./tmp/image/
  72. tmp: ./tmp/
  73. source:
  74. fonts: ./sys/fonts/simsun.ttc.ttc
  75. # 企业配置
  76. corp:
  77. # 公共服务
  78. servlet:
  79. aliwork: false
  80. dingtalk: false
  81. diwork: true
  82. feishu: true
  83. teambition: true
  84. # 通用设置
  85. timeOut: 300
  86. timeAwait: 600