| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- server:
- port: 8080
- servlet:
- context-path: /api
- spring:
- application:
- name: payroll-system
-
- # 数据源配置 - 生产环境
- datasource:
- type: com.alibaba.druid.pool.DruidDataSource
- druid:
- driver-class-name: com.mysql.cj.jdbc.Driver
- # 生产环境数据库地址,需要根据实际情况修改
- url: jdbc:mysql://localhost:3306/payroll_system?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
- username: root
- password: root
- # 连接池配置
- initial-size: 10
- min-idle: 10
- max-active: 50
- max-wait: 60000
- time-between-eviction-runs-millis: 60000
- min-evictable-idle-time-millis: 300000
- validation-query: SELECT 1
- test-while-idle: true
- test-on-borrow: false
- test-on-return: false
- # 生产环境关闭Druid监控
- stat-view-servlet:
- enabled: false
- filter:
- stat:
- enabled: true
- log-slow-sql: true
- slow-sql-millis: 2000
-
- # Redis配置 - 生产环境
- redis:
- host: localhost
- port: 6379
- password:
- database: 0
- timeout: 5000
- lettuce:
- pool:
- max-active: 20
- max-wait: -1
- max-idle: 10
- min-idle: 5
-
- # Jackson配置
- jackson:
- time-zone: GMT+8
- date-format: yyyy-MM-dd HH:mm:ss
- serialization:
- write-dates-as-timestamps: false
- # MyBatis Plus配置
- mybatis-plus:
- mapper-locations: classpath*:/mapper/**/*.xml
- type-aliases-package: com.payroll.entity
- configuration:
- map-underscore-to-camel-case: true
- # 生产环境关闭SQL日志
- log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
- global-config:
- db-config:
- id-type: auto
- logic-delete-field: deleted
- logic-delete-value: 1
- logic-not-delete-value: 0
- # JWT配置
- jwt:
- secret: payroll-system-secret-key-2024-must-be-at-least-256-bits
- expiration: 86400000 # 24小时,单位毫秒
- header: Authorization
- prefix: Bearer
- # 日志配置 - 生产环境
- logging:
- level:
- root: INFO
- com.payroll: INFO
- com.payroll.mapper: WARN
- pattern:
- console: '%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n'
- file:
- name: logs/payroll-system.log
- max-size: 100MB
- max-history: 30
|