server: port: 19001 spring: application: name: emotion-user # 配置文件激活 profiles: active: ${SPRING_PROFILES_ACTIVE:local} # 允许Bean覆盖和循环引用 main: allow-bean-definition-overriding: true allow-circular-references: true # 数据源配置 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&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true username: ${MYSQL_USERNAME:root} password: ${MYSQL_PASSWORD:123456} hikari: minimum-idle: 5 maximum-pool-size: 20 idle-timeout: 30000 max-lifetime: 1800000 connection-timeout: 30000 connection-test-query: SELECT 1 # Redis配置 data: redis: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} password: ${REDIS_PASSWORD:} database: 0 timeout: 10000ms lettuce: pool: max-active: 8 max-wait: -1ms max-idle: 8 min-idle: 0 # Nacos配置 cloud: nacos: discovery: server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848} namespace: ${NACOS_NAMESPACE:} group: ${NACOS_GROUP:DEFAULT_GROUP} enabled: ${NACOS_DISCOVERY_ENABLED:true} username: ${NACOS_USERNAME:nacos} password: ${NACOS_PASSWORD:nacos} metadata: version: 1.0.0 zone: ${NACOS_ZONE:default} register-enabled: true ephemeral: true cluster-name: DEFAULT service: ${spring.application.name} weight: 1 heart-beat-interval: 5000 heart-beat-timeout: 15000 ip-delete-timeout: 30000 config: server-addr: ${NACOS_HOST:localhost}:${NACOS_PORT:8848} namespace: ${NACOS_NAMESPACE:} group: ${NACOS_GROUP:DEFAULT_GROUP} file-extension: yml enabled: ${NACOS_CONFIG_ENABLED:false} username: ${NACOS_USERNAME:nacos} password: ${NACOS_PASSWORD:nacos} 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 # 第三方登录配置 oauth: wechat: client-id: ${WECHAT_CLIENT_ID:your_wechat_client_id} client-secret: ${WECHAT_CLIENT_SECRET:your_wechat_client_secret} redirect-uri: ${WECHAT_REDIRECT_URI:http://localhost:9001/oauth/callback/wechat} wechat-mp: client-id: ${WECHAT_MP_CLIENT_ID:your_wechat_mp_client_id} client-secret: ${WECHAT_MP_CLIENT_SECRET:your_wechat_mp_client_secret} redirect-uri: ${WECHAT_MP_REDIRECT_URI:http://localhost:9001/oauth/callback/wechat-mp} qq: client-id: ${QQ_CLIENT_ID:your_qq_client_id} client-secret: ${QQ_CLIENT_SECRET:your_qq_client_secret} redirect-uri: ${QQ_REDIRECT_URI:http://localhost:9001/oauth/callback/qq}