|
@@ -0,0 +1,216 @@
|
|
|
+spring:
|
|
|
+ main:
|
|
|
+ allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
|
|
+ allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
|
|
+ config:
|
|
|
+ import: "optional:consul:"
|
|
|
+ # Servlet 配置
|
|
|
+ servlet:
|
|
|
+ # 文件上传相关配置项
|
|
|
+ multipart:
|
|
|
+ max-file-size: 16MB # 单个文件大小
|
|
|
+ max-request-size: 32MB # 设置总上传的文件大小
|
|
|
+ # Jackson 配置项
|
|
|
+ jackson:
|
|
|
+ serialization:
|
|
|
+ write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
|
|
+ write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
|
|
+ write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
|
|
+ fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
|
|
+ # Consul 集成配置
|
|
|
+ cloud:
|
|
|
+ consul:
|
|
|
+ host: 127.0.0.1
|
|
|
+ port: 8500
|
|
|
+ # discovery
|
|
|
+ discovery:
|
|
|
+ enabled: true
|
|
|
+ prefer-ip-address: true
|
|
|
+ instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
|
|
|
+ # config
|
|
|
+ config:
|
|
|
+ enabled: false
|
|
|
+ format: YAML
|
|
|
+ data-key: data
|
|
|
+
|
|
|
+ # 指定 Thymeleaf 仅处理特定路径(如 /web/**)
|
|
|
+ # thymeleaf:
|
|
|
+ # enabled: true
|
|
|
+ # 关闭对未配置路径的视图解析
|
|
|
+ # view-names: web/* # 仅允许视图名匹配 web/* 的请求使用 Thymeleaf
|
|
|
+ # check-template-location: true
|
|
|
+ # prefix: classpath:/templates/
|
|
|
+ # suffix: .html
|
|
|
+ # servlet:
|
|
|
+ # content-type: text/html
|
|
|
+ # web:
|
|
|
+ # resources:
|
|
|
+ # static-locations: classpath:/static/
|
|
|
+ # mvc:
|
|
|
+ # static-path-pattern: /static/**
|
|
|
+
|
|
|
+# file:
|
|
|
+# name: /var/log/sikey/${spring.application.name}.log # 日志文件名,全路径
|
|
|
+logging:
|
|
|
+ level:
|
|
|
+ root: info
|
|
|
+ org.springframework: info
|
|
|
+
|
|
|
+ # Lock4j 配置项
|
|
|
+ #lock4j:
|
|
|
+ # acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
|
|
+ # expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
|
|
+
|
|
|
+sikey:
|
|
|
+ info:
|
|
|
+ version: 1.0.0
|
|
|
+ base-package: cn.sikey.hmd
|
|
|
+
|
|
|
+
|
|
|
+# MyBatis Plus 的配置项
|
|
|
+mybatis-plus:
|
|
|
+ configuration:
|
|
|
+ map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
|
|
+ global-config:
|
|
|
+ db-config:
|
|
|
+ id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
|
|
+ # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
|
|
+ # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
|
|
+ # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
|
|
+ logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
|
|
+ logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
|
|
+ banner: false # 关闭控制台的 Banner 打印
|
|
|
+ type-aliases-package: ${sikey.info.base-package}.dal.dataobject
|
|
|
+
|
|
|
+--- #################### 数据库相关配置 ####################
|
|
|
+spring:
|
|
|
+ # 数据源配置项
|
|
|
+ autoconfigure:
|
|
|
+ exclude:
|
|
|
+ datasource:
|
|
|
+ druid: # Druid 【监控】相关的全局配置
|
|
|
+ web-stat-filter:
|
|
|
+ enabled: true
|
|
|
+ stat-view-servlet:
|
|
|
+ enabled: true
|
|
|
+ allow: # 设置白名单,不填则允许所有访问
|
|
|
+ url-pattern: /druid/*
|
|
|
+ login-username: # 控制台管理用户名和密码
|
|
|
+ login-password:
|
|
|
+ filter:
|
|
|
+ stat:
|
|
|
+ enabled: true
|
|
|
+ log-slow-sql: true # 慢 SQL 记录
|
|
|
+ slow-sql-millis: 100
|
|
|
+ merge-sql: true
|
|
|
+ wall:
|
|
|
+ config:
|
|
|
+ multi-statement-allow: true
|
|
|
+ dynamic: # 多数据源配置
|
|
|
+ druid: # Druid 【连接池】相关的全局配置
|
|
|
+ initial-size: 5 # 初始连接数
|
|
|
+ min-idle: 10 # 最小连接池数量
|
|
|
+ max-active: 20 # 最大连接池数量
|
|
|
+ max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
|
|
+ time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
|
|
+ min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
|
|
+ max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
|
|
+ validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
|
|
+ test-while-idle: true
|
|
|
+ test-on-borrow: true
|
|
|
+ test-on-return: true
|
|
|
+ primary: master
|
|
|
+ datasource:
|
|
|
+ master:
|
|
|
+ url: jdbc:mysql://127.0.0.1:3306/smart_watch?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10 # MySQL Connector/J 8.X 连接的示例
|
|
|
+ username: root
|
|
|
+ password: 1qaz@WSX
|
|
|
+ slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
|
|
+ lazy: true # 开启懒加载,保证启动速度
|
|
|
+ url: jdbc:mysql://127.0.0.1:3306/smart_watch?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10 # MySQL Connector/J 8.X 连接的示例
|
|
|
+ username: root
|
|
|
+ password: 1qaz@WSX
|
|
|
+
|
|
|
+qrcode:
|
|
|
+ url: http://127.0.0.1:2000
|
|
|
+
|
|
|
+# 中医诊断服务
|
|
|
+tcmPulseDiagnosis:
|
|
|
+ url: http://api.tecanswer.com/trade/api/v1/alipay/gateway
|
|
|
+
|
|
|
+ # 图灵
|
|
|
+ #tuling:
|
|
|
+ # url: http://stat.turingos.cn
|
|
|
+ #upgradeDevicePath: /open/deviceManage/upgradeDeviceMenu
|
|
|
+ # getDeviceMenuPath: /open/deviceManage/getDeviceMenu
|
|
|
+ # apiKey: 5af60716dc0847018da04bdcc248abb4
|
|
|
+ # secret: c0N0459vI9x0N09Z
|
|
|
+
|
|
|
+---
|
|
|
+# 图灵
|
|
|
+#tuling:
|
|
|
+# apiKeys:
|
|
|
+# - apiType: wonka
|
|
|
+# apiKey: 4407e3dc086c42b080d78c5a40c500bb
|
|
|
+# apiSecret: 455zyq968Sk5qg65
|
|
|
+# - apiType: leia
|
|
|
+# apiKey: 003d3becbb6b48a7947231770e5da3ca
|
|
|
+# apiSecret: N3IN8Sxp80i16tTi
|
|
|
+# - apiType: skywal
|
|
|
+# apiKey: f90aabf8a48d4eaba79c54d1a202534a
|
|
|
+# apiSecret: 7LL7f8oJa69n7mB8
|
|
|
+# - apiType: fcb
|
|
|
+# apiKey: 5af60716dc0847018da04bdcc248abb4
|
|
|
+# apiSecret: c0N0459vI9x0N09Z
|
|
|
+
|
|
|
+# Spring Data Redis 配置
|
|
|
+spring:
|
|
|
+ data:
|
|
|
+ redis:
|
|
|
+ repositories:
|
|
|
+ enabled: true
|
|
|
+ host: r-0jofobh14nkptfnuq2pd.redis.ap-southeast-7.rds.aliyuncs.com
|
|
|
+ port: 6379
|
|
|
+ password: sikey!Q@W#E456
|
|
|
+ timeout: 5000
|
|
|
+
|
|
|
+---
|
|
|
+#熔断器配置
|
|
|
+feign:
|
|
|
+ hystrix:
|
|
|
+ enabled: true
|
|
|
+ okhttp:
|
|
|
+ enabled: true
|
|
|
+ httpclient:
|
|
|
+ enabled: false
|
|
|
+ compression:
|
|
|
+ request:
|
|
|
+ enabled: true
|
|
|
+ mime-types: text/xml,application/xml,application/json
|
|
|
+ response:
|
|
|
+ enabled: true
|
|
|
+
|
|
|
+#熔断时间
|
|
|
+hystrix:
|
|
|
+ command:
|
|
|
+ default:
|
|
|
+ execution:
|
|
|
+ isolation:
|
|
|
+ strategy: SEMAPHORE
|
|
|
+ thread:
|
|
|
+ timeoutInMilliseconds: 50000
|
|
|
+ semaphore:
|
|
|
+ maxConcurrentRequests: 50000
|
|
|
+ circuitBreaker:
|
|
|
+ sleepWindowInMilliseconds: 5000
|
|
|
+
|
|
|
+management:
|
|
|
+ endpoints:
|
|
|
+ web:
|
|
|
+ exposure:
|
|
|
+ include: health
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|