server: port: 19001 servlet: context-path: / spring: application: name: emotion-auth profiles: active: ${SPRING_PROFILES_ACTIVE:local} # 数据源配置 datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:emotion_museum}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true username: ${MYSQL_USERNAME:root} password: ${MYSQL_PASSWORD:EmotionMuseum2025*#} # 连接池配置 hikari: minimum-idle: 5 maximum-pool-size: 20 idle-timeout: 300000 connection-timeout: 20000 max-lifetime: 1200000 pool-name: EmotionAuthHikariCP # Redis配置 data: redis: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} password: ${REDIS_PASSWORD:} database: ${REDIS_DATABASE:0} timeout: 5000ms lettuce: pool: max-active: 20 max-idle: 10 min-idle: 5 max-wait: 2000ms # 云服务配置 cloud: nacos: discovery: enabled: false config: enabled: false # MyBatis Plus配置 mybatis-plus: configuration: map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: id-type: assign_uuid logic-delete-field: deleted logic-delete-value: 1 logic-not-delete-value: 0 # 监控配置 management: endpoints: web: exposure: include: health,info,metrics,prometheus endpoint: health: show-details: always metrics: export: prometheus: enabled: true # 日志配置 logging: level: com.emotionmuseum: debug com.baomidou.mybatisplus: debug pattern: console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n" # JWT配置 jwt: secret: emotion-museum-secret-key-2025 expiration: 86400 refresh-expiration: 604800 # 验证码配置 captcha: type: arithmetic length: 4 expire-time: 300 # OAuth配置 oauth: wechat: client-id: ${WECHAT_CLIENT_ID:} client-secret: ${WECHAT_CLIENT_SECRET:} redirect-uri: ${WECHAT_REDIRECT_URI:} qq: client-id: ${QQ_CLIENT_ID:} client-secret: ${QQ_CLIENT_SECRET:} redirect-uri: ${QQ_REDIRECT_URI:} --- # 本地开发环境配置 spring: config: activate: on-profile: local datasource: url: jdbc:mysql://localhost:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true data: redis: host: localhost port: 6379 cloud: nacos: discovery: server-addr: localhost:8848 config: server-addr: localhost:8848 --- # 测试环境配置 spring: config: activate: on-profile: test datasource: url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true --- # 生产环境配置 spring: config: activate: on-profile: prod datasource: url: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true