application.yml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. server:
  2. port: 8086
  3. spring:
  4. servlet:
  5. multipart:
  6. enabled: true
  7. max-file-size: 10MB
  8. max-request-size: 12MB
  9. #注: 切换数据库时需要将项目根目录中的.init文件删除再重启
  10. # <<=======内置H2数据库连接设置开始==========
  11. jpa:
  12. show-sql: true
  13. hibernate:
  14. ddl-auto: update
  15. properties:
  16. hibernate:
  17. format_sql: true
  18. sql:
  19. init:
  20. schema-locations: classpath:sql/schema.sql
  21. mode: ALWAYS
  22. datasource:
  23. url: jdbc:h2:./data/iotkit;MODE=MySQL
  24. username: sa
  25. password: 123456
  26. driverClassName: org.h2.Driver
  27. type: com.zaxxer.hikari.HikariDataSource
  28. # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
  29. dynamic:
  30. hikari:
  31. connection-timeout: 5000
  32. idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
  33. min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
  34. max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
  35. max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
  36. is-auto-commit: true
  37. primary: master #设置默认的数据源或者数据源组,默认值即为master
  38. strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
  39. datasource:
  40. # 主库数据源
  41. master:
  42. type: ${spring.datasource.type}
  43. driverClassName: org.h2.Driver
  44. # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
  45. # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
  46. url: jdbc:h2:./data/iotkit;MODE=MySQL
  47. username: sa
  48. password: 123456
  49. # 从库数据源
  50. slave:
  51. lazy: true
  52. type: ${spring.datasource.type}
  53. driverClassName: org.h2.Driver
  54. url: jdbc:h2:./data/iotkit;MODE=MySQL
  55. username: sa
  56. password: 123456
  57. # 内置h2 web console设置
  58. platform: h2
  59. h2:
  60. console:
  61. enabled: true
  62. path: /h2
  63. settings:
  64. web-allow-others: true
  65. #=======内置H2数据库连接设置结束==========>>
  66. # <<==========mysql配置开始==============
  67. # jpa:
  68. # database: MySQL
  69. # database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
  70. # show-sql: true
  71. # hibernate:
  72. # ddl-auto: update
  73. # properties:
  74. # hibernate:
  75. # format_sql: true
  76. # datasource:
  77. # type: com.zaxxer.hikari.HikariDataSource
  78. # dynamic:
  79. # hikari:
  80. # connection-timeout: 5000
  81. # idle-timeout: 30000 # 经过idle-timeout时间如果连接还处于空闲状态, 该连接会被回收
  82. # min-idle: 5 # 池中维护的最小空闲连接数, 默认为 10 个
  83. # max-pool-size: 16 # 池中最大连接数, 包括闲置和使用中的连接, 默认为 10 个
  84. # max-lifetime: 60000 # 如果一个连接超过了时长,且没有被使用, 连接会被回收
  85. # is-auto-commit: true
  86. # primary: master #设置默认的数据源或者数据源组,默认值即为master
  87. # strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
  88. # datasource:
  89. # # 主库数据源
  90. # master:
  91. # type: ${spring.datasource.type}
  92. # driverClassName: com.mysql.cj.jdbc.Driver
  93. # # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
  94. # url: jdbc:mysql://192.168.31.136:3306/iotkit?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false
  95. # username: root
  96. # password: 123456
  97. # ============mysql配置结束============>>
  98. #<<================es时序数据配置开始===============
  99. elasticsearch:
  100. rest:
  101. #使用内置es的配置
  102. #uris: http://elasticsearch:9200
  103. uris: http://127.0.0.1:9200
  104. username:
  105. password:
  106. connection-timeout: 10s
  107. #================es时序数据配置结束===============>>
  108. #<<===========tdengine时序数据库配置开始============
  109. # td-datasource:
  110. # url: jdbc:TAOS-RS://127.0.0.1:6041/iotkit?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8
  111. # username: root
  112. # password: taosdata
  113. # driverClassName: com.taosdata.jdbc.rs.RestfulDriver
  114. #===========tdengine时序数据库配置开始============>>
  115. redis:
  116. #使用内置redis的配置
  117. #host: redis
  118. host: 127.0.0.1
  119. port: 6379
  120. database: 0
  121. mvc:
  122. pathmatch:
  123. matching-strategy: ant_path_matcher
  124. # profiles:
  125. # active: mysql
  126. #application.yml中打开注释支持rocketMq作为消息总线,pom.xml中打开注释使用rocketmq消息总线
  127. #rocketmq:
  128. # name-server: 172.16.1.113:9876
  129. # producer:
  130. # group: iotkit
  131. #图片存储用的是阿里云oss,如果需要上传产品图片才需要配置
  132. aliyun:
  133. bucketId:
  134. endpoint:
  135. accessKeyId:
  136. accessKeySecret:
  137. sa-token:
  138. # token名称 (同时也是cookie名称)
  139. token-name: token
  140. # token有效期,单位s 默认30天, -1代表永不过期
  141. timeout: 2592000
  142. # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
  143. activity-timeout: -1
  144. # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
  145. is-concurrent: true
  146. # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
  147. is-share: false
  148. # token风格
  149. token-style: uuid
  150. # 是否输出操作日志
  151. is-log: false
  152. captcha:
  153. enable: true
  154. # 页面 <参数设置> 可开启关闭 验证码校验
  155. # 验证码类型 math 数组计算 char 字符验证
  156. type: MATH
  157. # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
  158. category: CIRCLE
  159. # 数字验证码位数
  160. numberLength: 1
  161. # 字符验证码长度
  162. charLength: 4
  163. # 用户配置
  164. user:
  165. password:
  166. # 密码最大错误次数
  167. maxRetryCount: 5
  168. # 密码锁定时间(默认10分钟)
  169. lockTime: 10
  170. # openapi配置
  171. openapi:
  172. appid: 123456789
  173. password: 123456
  174. oss:
  175. region: xxxxx
  176. endpoint: xxxxx
  177. accessKey: xxxxx
  178. secretKey: xxxxx
  179. buckName: xxxx
  180. baetyl:
  181. api-type: feign
  182. service-url: http://116.168.30.140:30004
  183. # MyBatisPlus配置
  184. # https://baomidou.com/config/
  185. mybatis-plus:
  186. # 不支持多包, 如有需要可在注解配置 或 提升扫包等级
  187. # 例如 com.**.**.mapper
  188. mapperPackage: cc.iotkit.**.mapper
  189. # 对应的 XML 文件位置
  190. mapperLocations: classpath*:mapper/**/*Mapper.xml
  191. # 实体扫描,多个package用逗号或者分号分隔
  192. typeAliasesPackage: cc.iotkit.**.domain
  193. global-config:
  194. dbConfig:
  195. # 主键类型
  196. # AUTO 自增 NONE 空 INPUT 用户输入 ASSIGN_ID 雪花 ASSIGN_UUID 唯一 UUID
  197. # 如需改为自增 需要将数据库表全部设置为自增
  198. idType: ASSIGN_ID
  199. #微信小程序配置
  200. weixin:
  201. appid: xx
  202. secret: xx
  203. authUrl: xx