application.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. connection-init-sql: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci # SqlServer若设置类型不一致, 需关闭才可连接
  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. # jsp
  57. mvc:
  58. view:
  59. prefix: /WEB-INF/jsp/
  60. suffix: .jsp
  61. # 日志配置
  62. logging:
  63. level:
  64. com.malk: debug
  65. org.springframework: warn
  66. file:
  67. path: ./log
  68. # 路径配置
  69. file:
  70. path:
  71. file: ./tmp/file/
  72. image: ./tmp/image/
  73. tmp: ./tmp/
  74. source:
  75. fonts: ./sys/fonts/simsun.ttc.ttc
  76. # 企业配置
  77. corp:
  78. # 公共服务
  79. servlet:
  80. aliwork: false
  81. dingtalk: false
  82. diwork: true
  83. feishu: true
  84. teambition: true
  85. # 通用设置
  86. timeOut: 300
  87. timeAwait: 600