application.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. spring:
  2. application:
  3. name: haha-admin
  4. # 数据库配置
  5. datasource:
  6. url: jdbc:mysql://server.kuaiyuman.cn:3306/haha?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&prepStmtCacheSize=250&prepStmtCacheSqlLimit=2048
  7. username: root
  8. password: KuaiyuMan/*-
  9. driver-class-name: com.mysql.cj.jdbc.Driver
  10. # HikariCP 连接池配置
  11. hikari:
  12. # 最小空闲连接数
  13. minimum-idle: 3
  14. # 最大连接池大小
  15. maximum-pool-size: 10
  16. # 连接最大存活时间(毫秒),建议小于数据库的 wait_timeout
  17. max-lifetime: 1800000
  18. # 空闲连接超时时间
  19. idle-timeout: 300000
  20. # 连接超时时间
  21. connection-timeout: 30000
  22. # 连接测试查询
  23. connection-test-query: SELECT 1
  24. # 保持连接活跃的频率(毫秒)
  25. keepalive-time: 30000
  26. # Redis 配置
  27. data:
  28. redis:
  29. host: server.kuaiyuman.cn
  30. port: 6379
  31. password: KtXA^Zx!TZmLEy(@JjB@2(TVG0kdy5)&
  32. database: 9
  33. timeout: 30000
  34. # 连接配置
  35. lettuce:
  36. pool:
  37. max-active: 20
  38. max-wait: 5000
  39. max-idle: 10
  40. min-idle: 5
  41. # 连接耗尽时等待时间(毫秒)
  42. time-between-eviction-runs: 60000
  43. # 关闭超时时间
  44. shutdown-timeout: 200
  45. # 刷新配置
  46. refresh:
  47. # 刷新周期(毫秒)
  48. period: 30000
  49. # 最小刷新间隔
  50. min: 5000
  51. # MyBatis-Plus 配置
  52. mybatis-plus:
  53. configuration:
  54. map-underscore-to-camel-case: true
  55. global-config:
  56. db-config:
  57. id-type: ASSIGN_ID
  58. enable-sql-runner: false
  59. # PageHelper 分页插件配置
  60. pagehelper:
  61. # 指定数据库方言
  62. helper-dialect: mysql
  63. # 分页合理化参数,默认false。当设置为true时,pageNum<=0时会查询第一页,pageNum>pages(超过总数时),会查询最后一页
  64. reasonable: true
  65. # 支持通过Mapper接口参数来传递分页参数,默认false
  66. support-methods-arguments: true
  67. # 为了支持startPage(Object params)方法,增加了一个"params"参数来配置参数映射,用于从Map或ServletRequest中取值
  68. params: count=countSql
  69. # 总是返回PageInfo类型,默认false
  70. return-page-info: check
  71. # 服务器配置
  72. server:
  73. port: 7070
  74. servlet:
  75. context-path: /admin
  76. # Sa-Token 配置
  77. sa-token:
  78. # token 名称(同时也是 cookie 名称)
  79. token-name: adminAccessToken
  80. # token 有效期(单位:秒) - 8小时
  81. timeout: 28800
  82. # token 临时有效期(单位:秒)
  83. active-timeout: -1
  84. # 是否允许同一账号多地同时登录
  85. is-concurrent: true
  86. # 同一账号最大登录数量
  87. max-login-count: 1
  88. # token 风格
  89. token-style: uuid
  90. # 是否输出操作日志
  91. is-log: true
  92. # 哈哈零售 API 配置
  93. haha:
  94. api:
  95. app-id: 2601051549145878
  96. app-secret: 06e1be59332b00de0baad82002cdbcb5
  97. base-url: http://api.hahabianli.com/
  98. # 日志配置
  99. log:
  100. # 慢请求阈值(毫秒)
  101. slow-request-threshold: 3000
  102. # 是否启用敏感信息脱敏
  103. enable-sensitive-mask: true
  104. # 是否启用请求日志
  105. enable-request-log: true
  106. # 设备离线预警配置
  107. device:
  108. alert:
  109. enabled: true
  110. cooldown-minutes: 30
  111. scan-interval-minutes: 5
  112. weak-signal-threshold: 2
  113. wechat-work:
  114. webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_KEY_HERE
  115. # 日志配置
  116. logging:
  117. level:
  118. root: info
  119. com.haha.admin: debug
  120. file:
  121. # 日志文件路径(相对于项目启动目录)
  122. path: ./logs
  123. name: ./logs/haha-admin.log