application.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. flyway:
  62. enabled: false # 需要配置 jpa.hibernate.ddl-auto 为 none. 否则 flyway.enabled 配置会无效, 在没有数库连接情况下程序无法启动
  63. # 日志配置
  64. logging:
  65. level:
  66. com.malk: debug
  67. org.springframework: warn
  68. file:
  69. path: ./log
  70. # 路径配置
  71. file:
  72. path:
  73. file: ./tmp/file/
  74. image: ./tmp/image/
  75. tmp: ./tmp/
  76. source:
  77. fonts: ./sys/fonts/simsun.ttc.ttc
  78. # 企业配置
  79. corp:
  80. # 公共服务
  81. servlet:
  82. aliwork: false
  83. dingtalk: false
  84. diwork: true
  85. feishu: true
  86. teambition: true
  87. # 通用设置
  88. timeOut: 300
  89. timeAwait: 600