| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- # 医疗管理系统示例配置
- # 展示如何配置Medical License组件
- spring:
- application:
- name: medical-management-system
-
- # 数据库配置(示例)
- datasource:
- url: jdbc:mysql://localhost:3306/medical_db
- username: medical_user
- password: medical_pass
- driver-class-name: com.mysql.cj.jdbc.Driver
-
- # JPA配置(示例)
- jpa:
- hibernate:
- ddl-auto: update
- show-sql: false
- properties:
- hibernate:
- dialect: org.hibernate.dialect.MySQL8Dialect
-
- # 邮件配置(用于license通知)
- mail:
- host: smtp.hospital.com
- port: 587
- username: system@hospital.com
- password: mail_password
- properties:
- mail:
- smtp:
- auth: true
- starttls:
- enable: true
- # Medical License 配置
- bskj:
- license:
- # 启用license检查
- enabled: true
-
- # license文件路径(建议放在应用外部目录)
- file-path: "/opt/medical/config/license.json"
-
- # 公钥文件路径(用于验证license签名)
- public-key-path: "/opt/medical/config/public.key"
-
- # 默认授权策略
- # notification_only: 仅通知,不影响功能
- # prevent_restart: 阻止重启,当前服务继续运行
- # graceful_shutdown: 宽限期后停止服务
- default-strategy: "prevent_restart"
-
- # license检查间隔(秒)- 每小时检查一次
- check-interval-seconds: 3600
-
- # 默认预警天数(提前30天开始预警)
- default-warning-days: 30
-
- # 默认宽限期天数(过期后7天宽限期)
- default-grace-period-days: 7
-
- # 启动时检查license
- check-on-startup: true
-
- # 启用定时检查
- enable-scheduled-check: true
-
- # 通知配置
- notification:
- # 启用日志通知
- log-enabled: true
-
- # 启用邮件通知
- email-enabled: true
-
- # 邮件接收者列表
- email-recipients:
- - "admin@hospital.com"
- - "it-support@hospital.com"
- - "manager@hospital.com"
-
- # 启用JMX通知(可通过JMX监控工具查看)
- jmx-enabled: true
- # 服务器配置
- server:
- port: 8080
- servlet:
- context-path: /medical
-
- # SSL配置(生产环境建议启用)
- # ssl:
- # enabled: true
- # key-store: /opt/medical/ssl/keystore.p12
- # key-store-password: ssl_password
- # key-store-type: PKCS12
- # 日志配置
- logging:
- level:
- root: INFO
- com.bskj.license: INFO
- com.medical.example: DEBUG
-
- # 日志文件配置
- file:
- name: /var/log/medical/application.log
- max-size: 100MB
- max-history: 30
-
- pattern:
- console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
- file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
- # 管理端点配置(用于监控)
- management:
- endpoints:
- web:
- exposure:
- include: health,info,metrics,license
- base-path: /actuator
-
- endpoint:
- health:
- show-details: when-authorized
-
- info:
- env:
- enabled: true
- # 应用信息
- info:
- app:
- name: 医疗管理系统
- description: 基于Spring Boot的医疗行业管理系统
- version: 2.0.0
- encoding: UTF-8
- java:
- version: 17
-
- license:
- component: Medical License Starter
- version: 1.0.0
- ---
- # 开发环境配置
- spring:
- config:
- activate:
- on-profile: dev
- bskj:
- license:
- # 开发环境使用相对路径
- file-path: "license.json"
- public-key-path: "public.key"
- # 开发环境使用宽松策略
- default-strategy: "notification_only"
- # 开发环境检查间隔更短
- check-interval-seconds: 300 # 5分钟
- notification:
- email-enabled: false # 开发环境不发送邮件
- logging:
- level:
- com.bskj.license: DEBUG
- com.medical.example: DEBUG
- ---
- # 测试环境配置
- spring:
- config:
- activate:
- on-profile: test
- bskj:
- license:
- # 测试环境可以禁用license检查
- enabled: false
- logging:
- level:
- root: WARN
- com.medical: DEBUG
- ---
- # 生产环境配置
- spring:
- config:
- activate:
- on-profile: prod
- bskj:
- license:
- # 生产环境使用严格策略
- default-strategy: "graceful_shutdown"
- # 生产环境检查间隔更长
- check-interval-seconds: 7200 # 2小时
- # 生产环境预警期更长
- default-warning-days: 60
- # 生产环境宽限期更短
- default-grace-period-days: 3
- notification:
- email-enabled: true
- jmx-enabled: true
- logging:
- level:
- root: WARN
- com.bskj.license: INFO
- file:
- name: /var/log/medical/medical-system.log
|