feat: 添加.gitignore文件并清理编译产物

🔧 新增功能:
- 添加完整的.gitignore文件,覆盖所有编译产物和临时文件
- 从Git跟踪中移除Maven target目录下的编译产物
- 从Git跟踪中移除日志文件和临时文件

📁 忽略文件类型:
- Maven编译产物 (target/**, *.jar, *.war等)
- 日志文件 (logs/, *.log, *.log.*)
- IDE文件 (.idea/, *.iml, .vscode/等)
- Node.js文件 (node_modules/, dist/, .env等)
- 操作系统文件 (.DS_Store, Thumbs.db等)
- 临时文件 (*.tmp, *.bak, *.swp等)
- 部署包 (packages/, *.tar.gz, *.zip等)

 优化效果:
- 减少仓库大小,提高克隆速度
- 避免提交不必要的编译产物
- 保持仓库整洁,只包含源代码
- 防止敏感配置文件意外提交
This commit is contained in:
2025-07-18 11:49:36 +08:00
parent 620f38318e
commit 9f5a3601ea
245 changed files with 299 additions and 19813 deletions
@@ -1,52 +0,0 @@
2025-07-17T09:52:07.419+08:00 WARN 90872 --- [restartedMain] c.a.nacos.client.logging.NacosLogging : Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
2025-07-17T09:52:07.481+08:00 WARN 90872 --- [restartedMain] c.a.nacos.client.logging.NacosLogging : Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
2025-07-17T09:52:07.487+08:00 INFO 90872 --- [restartedMain] c.e.gateway.GatewayApplication : Starting GatewayApplication using Java 23.0.2 with PID 90872 (/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/target/classes started by huazhongmin in /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway)
2025-07-17T09:52:07.488+08:00 DEBUG 90872 --- [restartedMain] c.e.gateway.GatewayApplication : Running with Spring Boot v3.0.2, Spring v6.0.4
2025-07-17T09:52:07.488+08:00 INFO 90872 --- [restartedMain] c.e.gateway.GatewayApplication : The following 1 profile is active: "local"
2025-07-17T09:52:07.549+08:00 INFO 90872 --- [restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2025-07-17T09:52:07.550+08:00 INFO 90872 --- [restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2025-07-17T09:52:08.606+08:00 INFO 90872 --- [restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2025-07-17T09:52:08.608+08:00 INFO 90872 --- [restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2025-07-17T09:52:08.627+08:00 INFO 90872 --- [restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
2025-07-17T09:52:08.798+08:00 INFO 90872 --- [restartedMain] o.s.cloud.context.scope.GenericScope : BeanFactory id=5a741552-34ee-38c0-936b-699d9d791837
2025-07-17T09:52:09.026+08:00 INFO 90872 --- [restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2025-07-17T09:52:09.027+08:00 INFO 90872 --- [restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2025-07-17T09:52:09.028+08:00 INFO 90872 --- [restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2025-07-17T09:52:10.147+08:00 DEBUG 90872 --- [restartedMain] o.s.c.gateway.config.GatewayProperties : Routes supplied from Gateway Properties: [RouteDefinition{id='emotion-user-route', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/user/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=0}}], uri=http://localhost:19001, order=0, metadata={}}, RouteDefinition{id='emotion-captcha-route', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/captcha/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=0}}], uri=http://localhost:19001, order=0, metadata={}}, RouteDefinition{id='emotion-oauth-route', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/oauth/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=0}}], uri=http://localhost:19001, order=0, metadata={}}, RouteDefinition{id='emotion-ai-route', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/ai/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=0}}], uri=http://localhost:19002, order=0, metadata={}}]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [XForwardedRemoteAddr]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight]
2025-07-17T09:52:10.329+08:00 INFO 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService]
2025-07-17T09:52:10.352+08:00 INFO 90872 --- [restartedMain] c.a.c.s.g.s.SentinelSCGAutoConfiguration : [Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: -2147483648
2025-07-17T09:52:10.417+08:00 DEBUG 90872 --- [restartedMain] o.s.w.r.handler.SimpleUrlHandlerMapping : Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
2025-07-17T09:52:10.524+08:00 INFO 90872 --- [restartedMain] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2025-07-17T09:52:10.558+08:00 DEBUG 90872 --- [restartedMain] o.s.w.r.r.m.a.ControllerMethodResolver : ControllerAdvice beans: none
2025-07-17T09:52:10.591+08:00 INFO 90872 --- [restartedMain] c.a.c.s.g.s.SentinelSCGAutoConfiguration : [Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler
2025-07-17T09:52:10.595+08:00 DEBUG 90872 --- [restartedMain] o.s.w.s.adapter.HttpWebHandlerAdapter : enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
2025-07-17T09:52:10.746+08:00 INFO 90872 --- [restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2025-07-17T09:52:10.770+08:00 WARN 90872 --- [restartedMain] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2025-07-17T09:52:10.851+08:00 INFO 90872 --- [restartedMain] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port 19000
2025-07-17T09:52:10.881+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-user-route applying {_genkey_0=/user/**} to Path
2025-07-17T09:52:10.894+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-user-route applying filter {_genkey_0=0} to StripPrefix
2025-07-17T09:52:10.898+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition matched: emotion-user-route
2025-07-17T09:52:10.898+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-captcha-route applying {_genkey_0=/captcha/**} to Path
2025-07-17T09:52:10.899+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-captcha-route applying filter {_genkey_0=0} to StripPrefix
2025-07-17T09:52:10.900+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition matched: emotion-captcha-route
2025-07-17T09:52:10.900+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-oauth-route applying {_genkey_0=/oauth/**} to Path
2025-07-17T09:52:10.900+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-oauth-route applying filter {_genkey_0=0} to StripPrefix
2025-07-17T09:52:10.901+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition matched: emotion-oauth-route
2025-07-17T09:52:10.901+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-ai-route applying {_genkey_0=/ai/**} to Path
2025-07-17T09:52:10.902+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition emotion-ai-route applying filter {_genkey_0=0} to StripPrefix
2025-07-17T09:52:10.902+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.r.RouteDefinitionRouteLocator : RouteDefinition matched: emotion-ai-route
2025-07-17T09:52:10.906+08:00 DEBUG 90872 --- [restartedMain] o.s.c.g.filter.GatewayMetricsFilter : New routes count: 4
2025-07-17T09:52:10.909+08:00 INFO 90872 --- [restartedMain] c.e.gateway.GatewayApplication : Started GatewayApplication in 3.87 seconds (process running for 4.294)
@@ -1,121 +0,0 @@
# Gateway Docker环境配置
server:
port: 9000
spring:
application:
name: emotion-gateway
profiles:
active: docker
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
namespace: public
group: DEFAULT_GROUP
config:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
file-extension: yml
namespace: public
group: DEFAULT_GROUP
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# AI服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=1
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=1
# 记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=1
# 成长服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=1
# 探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=1
# 奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=1
# 统计服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=1
globalcors:
cors-configurations:
'[/**]':
allowedOriginPatterns: "*"
allowedMethods: "*"
allowedHeaders: "*"
allowCredentials: true
# 数据源配置
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
# Redis配置
redis:
host: ${REDIS_HOST:redis}
port: ${REDIS_PORT:6379}
password:
database: 0
timeout: 6000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 日志配置
logging:
level:
com.emotionmuseum: DEBUG
org.springframework.cloud.gateway: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
# 管理端点
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
@@ -1,150 +0,0 @@
# 本地开发环境配置
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
enabled: true
username: nacos
password: Peanut2817*#
metadata:
version: 1.0.0
zone: local
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: localhost:8848
namespace:
group: DEFAULT_GROUP
file-extension: yml
enabled: false
username: nacos
password: Peanut2817*#
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
# 全局跨域配置
globalcors:
cors-configurations:
'[/**]':
allowed-origins: "*"
allowed-methods: "*"
allowed-headers: "*"
allow-credentials: true
routes:
# 用户服务路由 (包含认证功能)
- id: emotion-user-route
uri: lb://emotion-user
predicates:
- Path=/user/**
filters:
- StripPrefix=0
# 验证码服务路由
- id: emotion-captcha-route
uri: lb://emotion-user
predicates:
- Path=/captcha/**
filters:
- StripPrefix=0
# OAuth服务路由
- id: emotion-oauth-route
uri: lb://emotion-user
predicates:
- Path=/oauth/**
filters:
- StripPrefix=0
# AI服务路由
- id: emotion-ai-route
uri: lb://emotion-ai
predicates:
- Path=/ai/**
filters:
- StripPrefix=0
# WebSocket聊天服务路由
- id: emotion-websocket-route
uri: lb://emotion-websocket
predicates:
- Path=/websocket/**
filters:
- StripPrefix=0
# WebSocket连接路由 (支持WebSocket升级)
- id: emotion-websocket-ws-route
uri: lb://emotion-websocket
predicates:
- Path=/ws/**
filters:
- StripPrefix=0
# 情绪记录服务路由
- id: emotion-record-route
uri: lb://emotion-record
predicates:
- Path=/record/**
filters:
- StripPrefix=0
# 成长课题服务路由
- id: emotion-growth-route
uri: lb://emotion-growth
predicates:
- Path=/growth/**
filters:
- StripPrefix=0
# 地图探索服务路由
- id: emotion-explore-route
uri: lb://emotion-explore
predicates:
- Path=/explore/**
filters:
- StripPrefix=0
# 成就奖励服务路由
- id: emotion-reward-route
uri: lb://emotion-reward
predicates:
- Path=/reward/**
filters:
- StripPrefix=0
# 统计分析服务路由
- id: emotion-stats-route
uri: lb://emotion-stats
predicates:
- Path=/stats/**
filters:
- StripPrefix=0
# Redis配置
data:
redis:
host: localhost
port: 6379
password:
database: 0
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
org.springframework.web: debug
file:
name: logs/emotion-gateway-local.log
@@ -1,151 +0,0 @@
# 生产环境配置
spring:
cloud:
nacos:
discovery:
server-addr: 47.111.10.27:8848
namespace: prod
group: DEFAULT_GROUP
enabled: true
username: nacos
password: EmotionMuseum2025
metadata:
version: 1.0.0
zone: prod
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: 47.111.10.27:8848
namespace: prod
group: DEFAULT_GROUP
file-extension: yml
enabled: false
username: nacos
password: EmotionMuseum2025
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
# 全局跨域配置
globalcors:
cors-configurations:
'[/**]':
allowed-origins: "*"
allowed-methods: "*"
allowed-headers: "*"
allow-credentials: true
routes:
# 用户服务路由 (包含认证功能)
- id: emotion-user-route
uri: lb://emotion-user
predicates:
- Path=/user/**
filters:
- StripPrefix=0
# 验证码服务路由
- id: emotion-captcha-route
uri: lb://emotion-user
predicates:
- Path=/captcha/**
filters:
- StripPrefix=0
# OAuth服务路由
- id: emotion-oauth-route
uri: lb://emotion-user
predicates:
- Path=/oauth/**
filters:
- StripPrefix=0
# AI服务路由
- id: emotion-ai-route
uri: lb://emotion-ai
predicates:
- Path=/ai/**
filters:
- StripPrefix=0
# WebSocket聊天服务路由
- id: emotion-websocket-route
uri: lb://emotion-websocket
predicates:
- Path=/websocket/**
filters:
- StripPrefix=0
# WebSocket连接路由 (支持WebSocket升级)
- id: emotion-websocket-ws-route
uri: lb://emotion-websocket
predicates:
- Path=/ws/**
filters:
- StripPrefix=0
# 情绪记录服务路由
- id: emotion-record-route
uri: lb://emotion-record
predicates:
- Path=/record/**
filters:
- StripPrefix=0
# 成长课题服务路由
- id: emotion-growth-route
uri: lb://emotion-growth
predicates:
- Path=/growth/**
filters:
- StripPrefix=0
# 地图探索服务路由
- id: emotion-explore-route
uri: lb://emotion-explore
predicates:
- Path=/explore/**
filters:
- StripPrefix=0
# 成就奖励服务路由
- id: emotion-reward-route
uri: lb://emotion-reward
predicates:
- Path=/reward/**
filters:
- StripPrefix=0
# 统计分析服务路由
- id: emotion-stats-route
uri: lb://emotion-stats
predicates:
- Path=/stats/**
filters:
- StripPrefix=0
# Redis配置
data:
redis:
host: 47.111.10.27
port: 6379
password: EmotionMuseum2025*#
database: 0
# 日志配置
logging:
level:
com.emotionmuseum: warn
org.springframework.cloud.gateway: warn
org.springframework.web: warn
com.alibaba.nacos: error
file:
name: logs/emotion-gateway-prod.log
@@ -1,151 +0,0 @@
# 测试环境配置
spring:
cloud:
nacos:
discovery:
server-addr: 47.111.10.27:8848
namespace: test
group: DEFAULT_GROUP
enabled: true
username: nacos
password: EmotionMuseum2025
metadata:
version: 1.0.0
zone: test
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: 47.111.10.27:8848
namespace: test
group: DEFAULT_GROUP
file-extension: yml
enabled: false
username: nacos
password: EmotionMuseum2025
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
# 全局跨域配置
globalcors:
cors-configurations:
"[/**]":
allowed-origins: "*"
allowed-methods: "*"
allowed-headers: "*"
allow-credentials: true
routes:
# 用户服务路由 (包含认证功能)
- id: emotion-user-route
uri: lb://emotion-user
predicates:
- Path=/user/**
filters:
- StripPrefix=0
# 验证码服务路由
- id: emotion-captcha-route
uri: lb://emotion-user
predicates:
- Path=/captcha/**
filters:
- StripPrefix=0
# OAuth服务路由
- id: emotion-oauth-route
uri: lb://emotion-user
predicates:
- Path=/oauth/**
filters:
- StripPrefix=0
# AI服务路由
- id: emotion-ai-route
uri: lb://emotion-ai
predicates:
- Path=/ai/**
filters:
- StripPrefix=0
# WebSocket聊天服务路由
- id: emotion-websocket-route
uri: lb://emotion-websocket
predicates:
- Path=/websocket/**
filters:
- StripPrefix=0
# WebSocket连接路由 (支持WebSocket升级)
- id: emotion-websocket-ws-route
uri: lb://emotion-websocket
predicates:
- Path=/ws/**
filters:
- StripPrefix=0
# 情绪记录服务路由
- id: emotion-record-route
uri: lb://emotion-record
predicates:
- Path=/record/**
filters:
- StripPrefix=0
# 成长课题服务路由
- id: emotion-growth-route
uri: lb://emotion-growth
predicates:
- Path=/growth/**
filters:
- StripPrefix=0
# 地图探索服务路由
- id: emotion-explore-route
uri: lb://emotion-explore
predicates:
- Path=/explore/**
filters:
- StripPrefix=0
# 成就奖励服务路由
- id: emotion-reward-route
uri: lb://emotion-reward
predicates:
- Path=/reward/**
filters:
- StripPrefix=0
# 统计分析服务路由
- id: emotion-stats-route
uri: lb://emotion-stats
predicates:
- Path=/stats/**
filters:
- StripPrefix=0
# Redis配置
data:
redis:
host: 47.111.10.27
port: 6379
password: EmotionMuseum2025*#
database: 0
# 日志配置
logging:
level:
com.emotionmuseum: info
org.springframework.cloud.gateway: info
org.springframework.web: info
com.alibaba.nacos: warn
file:
name: logs/emotion-gateway-test.log
@@ -1,150 +0,0 @@
server:
port: 19000
spring:
application:
name: emotion-gateway
# 配置文件激活
profiles:
active: ${SPRING_PROFILES_ACTIVE:local}
# 允许Bean覆盖和循环引用
main:
allow-bean-definition-overriding: true
allow-circular-references: true
# 排除数据库自动配置
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
# 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}
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}
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 认证服务路由
- id: emotion-auth
uri: lb://emotion-auth
predicates:
- Path=/api/auth/**
filters:
- StripPrefix=2
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=2
# AI对话服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=2
# 情绪记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=2
# 成长课题服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=2
# 地图探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=2
# 成就奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=2
# 统计分析服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=2
# 全局过滤器 (暂时禁用,需要实现对应的过滤器类)
# default-filters:
# - name: GlobalAuthFilter
# - name: GlobalLogFilter
# 监控配置
management:
endpoints:
web:
exposure:
include: health,info,gateway
endpoint:
health:
show-details: always
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
@@ -1,3 +0,0 @@
artifactId=emotion-gateway
groupId=com.emotionmuseum
version=1.0.0
@@ -1 +0,0 @@
com/emotionmuseum/gateway/GatewayApplication.class
@@ -1 +0,0 @@
/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/src/main/java/com/emotionmuseum/gateway/GatewayApplication.java