application.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. server:
  2. port: 8091
  3. netty:
  4. port: 8808
  5. bossThread: 1
  6. logging:
  7. level:
  8. root: INFO
  9. management:
  10. endpoints:
  11. web:
  12. exposure:
  13. include: "*"
  14. endpoint:
  15. shutdown:
  16. enabled: true
  17. # 服务名称配置(同时测名称也是注册到eureka中心的名称)
  18. spring:
  19. application:
  20. name: hatech-bcms-core
  21. zipkin:
  22. #base-url:当你设置sleuth-cli收集信息后通过http传输到zinkin-server时,需要在这里配置
  23. base-url: http://10.27.5.129:9411
  24. enabled: true
  25. sleuth:
  26. sampler:
  27. #收集追踪信息的比率,如果是0.1则表示只记录10%的追踪数据,如果要全部追踪,设置为1(实际场景不推荐,因为会造成不小的性能消耗)
  28. probability: 1
  29. # 异常配置 SpringBoot 当出现 404 错误时, 直接抛出异常
  30. mvc:
  31. throw-exception-if-no-handler-found: true
  32. # 数据源配置
  33. datasource:
  34. address: 127.0.0.1:3306/chat
  35. useSSL: false
  36. druid:
  37. type: com.alibaba.druid.pool.DruidDataSource
  38. driver-class-name: com.mysql.cj.jdbc.Driver
  39. # mysql7连接方式
  40. url: jdbc:mysql://${spring.datasource.address}?useSSL=${spring.datasource.useSSL}&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT&rewriteBatchedStatements=true
  41. username: root
  42. password: 123456
  43. initialSize: 5
  44. minIdle: 5
  45. maxActive: 20
  46. # 配置获取连接等待超时的时间
  47. maxWait: 60000
  48. # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  49. timeBetweenEvictionRunsMillis: 60000
  50. #配置连接在池中的最小生存时间
  51. minEvictableIdleTimeMillis: 300000
  52. validationQuery: SELECT '1'
  53. testWhileIdle: true
  54. testOnBorrow: false
  55. testOnReturn: false
  56. # 打开PSCache,并且指定每个连接上PSCache的大小
  57. poolPreparedStatements: true
  58. maxPoolPreparedStatementPerConnectionSize: 20
  59. # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
  60. filters: stat,slf4j
  61. # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
  62. connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
  63. sql-script-encoding: utf-8
  64. # 合并多个DruidDataSource的监控数据
  65. useGlobalDataSourceStat: true
  66. # 配置监控界面
  67. web-stat-filter:
  68. enabled: true
  69. url-pattern: /*
  70. exclusions: /druid/*,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico
  71. session-stat-enable: true
  72. session-stat-max-count: 10
  73. principal-session-name: session_name
  74. principal-cookie-name: cookie_name
  75. stat-view-servlet:
  76. enabled: true
  77. url-pattern: /druid/*
  78. reset-enable: false
  79. login-username: hatech
  80. login-password: hatech
  81. allow: 127.0.0.1,192.168.1.82
  82. deny: 192.168.1.81
  83. aop-patterns: cn.com.hatech.bcms.core.*.controller.*.*,cn.com.hatech.bcms.core.*.mapper.*.*,cn.com.hatech.bcms.core.*.service.*.*
  84. # redis配置
  85. redis:
  86. database: 0
  87. host: 127.0.0.1
  88. port: 6379
  89. jedis:
  90. pool:
  91. max-active: 20
  92. # 异常配置 SpringBoot 不要为我们工程中的资源文件建立映射.
  93. web:
  94. resources:
  95. add-mappings: false
  96. # 文件上传配置
  97. servlet:
  98. multipart:
  99. max-file-size: 50MB
  100. # 设置单次请求的文件的总大小
  101. max-request-size: 100MB
  102. mybatis-plus:
  103. mapper-locations: classpath*:mapper/**/*.xml
  104. # 以下配置均有默认值,可以不设置
  105. global-config:
  106. db-config:
  107. #主键类 * AUTO: 数据库ID自增; INPUT: 用户输入ID; ID_WORKER: 全局唯一ID, Long类型的主键; ID_WORKER_STR: 字符串全局唯一ID; UUID: 全局唯一ID,UUID类型的主键; NONE: 该类型为未设置主键类型
  108. id-type: ASSIGN_ID
  109. #字段策略 IGNORED:"忽略判断" NOT_NULL:"非 NULL 判断") NOT_EMPTY:"非空判断"
  110. field-strategy: NOT_EMPTY
  111. #数据库类型
  112. db-type: MYSQL
  113. configuration:
  114. # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
  115. map-underscore-to-camel-case: true
  116. # 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段
  117. call-setters-on-nulls: false
  118. # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
  119. log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  120. # 生产环境开启,不会打印sql执行日志
  121. #log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
  122. data-filter: true
  123. # 异步线程配置
  124. async:
  125. executor:
  126. thread:
  127. # 配置核心线程数
  128. core_pool_size: 5
  129. # 配置最大线程数
  130. max_pool_size: 10
  131. # 配置队列大小
  132. queue_capacity: 50
  133. # 配置线程池中的线程的名称前缀
  134. name:
  135. prefix: async-service-