server: port: 19000 spring: application: name: emotion-gateway # Redis配置 data: redis: host: localhost port: 6379 password: database: 0 timeout: 10000ms lettuce: pool: max-active: 8 max-wait: -1ms max-idle: 8 min-idle: 0 # 网关配置 cloud: gateway: discovery: locator: enabled: true lower-case-service-id: true routes: # 用户服务路由 - id: emotion-user-route uri: http://localhost:19001 predicates: - Path=/user/** filters: - StripPrefix=0 # 验证码服务路由 - id: emotion-captcha-route uri: http://localhost:19001 predicates: - Path=/captcha/** filters: - StripPrefix=0 # OAuth服务路由 - id: emotion-oauth-route uri: http://localhost:19001 predicates: - Path=/oauth/** filters: - StripPrefix=0 # AI服务路由 - id: emotion-ai-route uri: http://localhost:19002 predicates: - Path=/ai/** filters: - StripPrefix=0 # 记录服务路由 - id: emotion-record-route uri: http://localhost:19003 predicates: - Path=/record/** filters: - StripPrefix=0 # 成长服务路由 - id: emotion-growth-route uri: http://localhost:19004 predicates: - Path=/growth/** filters: - StripPrefix=0 # 探索服务路由 - id: emotion-explore-route uri: http://localhost:19005 predicates: - Path=/explore/** filters: - StripPrefix=0 # 奖励服务路由 - id: emotion-reward-route uri: http://localhost:19006 predicates: - Path=/reward/** filters: - StripPrefix=0 # 统计服务路由 - id: emotion-stats-route uri: http://localhost:19007 predicates: - Path=/stats/** filters: - StripPrefix=0 # Nacos配置 spring: cloud: nacos: discovery: server-addr: localhost:8848 namespace: group: DEFAULT_GROUP enabled: true register-enabled: true heart-beat-interval: 5000 heart-beat-timeout: 15000 ip-delete-timeout: 30000 config: server-addr: localhost:8848 namespace: group: DEFAULT_GROUP file-extension: yml enabled: false # 日志配置 logging: level: com.emotionmuseum: debug org.springframework.cloud.gateway: debug org.springframework.web: debug pattern: console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n" file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n" file: name: logs/emotion-gateway-local.log # 管理端点配置 management: endpoints: web: exposure: include: health,info,metrics,gateway endpoint: health: show-details: always gateway: enabled: true