application.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. # 医疗管理系统示例配置
  2. # 展示如何配置Medical License组件
  3. spring:
  4. application:
  5. name: medical-management-system
  6. # 数据库配置(示例)
  7. datasource:
  8. url: jdbc:mysql://localhost:3306/medical_db
  9. username: medical_user
  10. password: medical_pass
  11. driver-class-name: com.mysql.cj.jdbc.Driver
  12. # JPA配置(示例)
  13. jpa:
  14. hibernate:
  15. ddl-auto: update
  16. show-sql: false
  17. properties:
  18. hibernate:
  19. dialect: org.hibernate.dialect.MySQL8Dialect
  20. # 邮件配置(用于license通知)
  21. mail:
  22. host: smtp.hospital.com
  23. port: 587
  24. username: system@hospital.com
  25. password: mail_password
  26. properties:
  27. mail:
  28. smtp:
  29. auth: true
  30. starttls:
  31. enable: true
  32. # Medical License 配置
  33. bskj:
  34. license:
  35. # 启用license检查
  36. enabled: true
  37. # license文件路径(建议放在应用外部目录)
  38. file-path: "/opt/medical/config/license.json"
  39. # 公钥文件路径(用于验证license签名)
  40. public-key-path: "/opt/medical/config/public.key"
  41. # 默认授权策略
  42. # notification_only: 仅通知,不影响功能
  43. # prevent_restart: 阻止重启,当前服务继续运行
  44. # graceful_shutdown: 宽限期后停止服务
  45. default-strategy: "prevent_restart"
  46. # license检查间隔(秒)- 每小时检查一次
  47. check-interval-seconds: 3600
  48. # 默认预警天数(提前30天开始预警)
  49. default-warning-days: 30
  50. # 默认宽限期天数(过期后7天宽限期)
  51. default-grace-period-days: 7
  52. # 启动时检查license
  53. check-on-startup: true
  54. # 启用定时检查
  55. enable-scheduled-check: true
  56. # 通知配置
  57. notification:
  58. # 启用日志通知
  59. log-enabled: true
  60. # 启用邮件通知
  61. email-enabled: true
  62. # 邮件接收者列表
  63. email-recipients:
  64. - "admin@hospital.com"
  65. - "it-support@hospital.com"
  66. - "manager@hospital.com"
  67. # 启用JMX通知(可通过JMX监控工具查看)
  68. jmx-enabled: true
  69. # 服务器配置
  70. server:
  71. port: 8080
  72. servlet:
  73. context-path: /medical
  74. # SSL配置(生产环境建议启用)
  75. # ssl:
  76. # enabled: true
  77. # key-store: /opt/medical/ssl/keystore.p12
  78. # key-store-password: ssl_password
  79. # key-store-type: PKCS12
  80. # 日志配置
  81. logging:
  82. level:
  83. root: INFO
  84. com.bskj.license: INFO
  85. com.medical.example: DEBUG
  86. # 日志文件配置
  87. file:
  88. name: /var/log/medical/application.log
  89. max-size: 100MB
  90. max-history: 30
  91. pattern:
  92. console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  93. file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
  94. # 管理端点配置(用于监控)
  95. management:
  96. endpoints:
  97. web:
  98. exposure:
  99. include: health,info,metrics,license
  100. base-path: /actuator
  101. endpoint:
  102. health:
  103. show-details: when-authorized
  104. info:
  105. env:
  106. enabled: true
  107. # 应用信息
  108. info:
  109. app:
  110. name: 医疗管理系统
  111. description: 基于Spring Boot的医疗行业管理系统
  112. version: 2.0.0
  113. encoding: UTF-8
  114. java:
  115. version: 17
  116. license:
  117. component: Medical License Starter
  118. version: 1.0.0
  119. ---
  120. # 开发环境配置
  121. spring:
  122. config:
  123. activate:
  124. on-profile: dev
  125. bskj:
  126. license:
  127. # 开发环境使用相对路径
  128. file-path: "license.json"
  129. public-key-path: "public.key"
  130. # 开发环境使用宽松策略
  131. default-strategy: "notification_only"
  132. # 开发环境检查间隔更短
  133. check-interval-seconds: 300 # 5分钟
  134. notification:
  135. email-enabled: false # 开发环境不发送邮件
  136. logging:
  137. level:
  138. com.bskj.license: DEBUG
  139. com.medical.example: DEBUG
  140. ---
  141. # 测试环境配置
  142. spring:
  143. config:
  144. activate:
  145. on-profile: test
  146. bskj:
  147. license:
  148. # 测试环境可以禁用license检查
  149. enabled: false
  150. logging:
  151. level:
  152. root: WARN
  153. com.medical: DEBUG
  154. ---
  155. # 生产环境配置
  156. spring:
  157. config:
  158. activate:
  159. on-profile: prod
  160. bskj:
  161. license:
  162. # 生产环境使用严格策略
  163. default-strategy: "graceful_shutdown"
  164. # 生产环境检查间隔更长
  165. check-interval-seconds: 7200 # 2小时
  166. # 生产环境预警期更长
  167. default-warning-days: 60
  168. # 生产环境宽限期更短
  169. default-grace-period-days: 3
  170. notification:
  171. email-enabled: true
  172. jmx-enabled: true
  173. logging:
  174. level:
  175. root: WARN
  176. com.bskj.license: INFO
  177. file:
  178. name: /var/log/medical/medical-system.log