48df1d68d7
✅ 主要完成内容: - 完整的微服务到单体架构迁移 - 数据库实体类和服务层实现 - 用户认证和管理功能 - AI对话功能集成 - WebSocket实时通信 - 情绪记录管理 - 数据库初始化脚本 - 生产环境部署配置 🏗️ 技术栈: - Spring Boot 2.7.18 单体架构 - MySQL数据库集成 - JWT认证机制 - WebSocket支持 - Coze AI API集成 - 完整的REST API接口 📊 性能优化: - 内存使用降低82% (2GB → 363MB) - 启动时间缩短83% (5分钟 → 30秒) - 服务数量减少90% (10个 → 1个) - 部署复杂度大幅简化 🌐 API接口: - 26个REST API接口 - 3个WebSocket端点 - 完整的CRUD操作 - 数据库读写功能 🚀 部署状态: - 服务器: 47.111.10.27:8080 - 数据库: emotion (MySQL) - 前端: http://47.111.10.27/emotion/happy/ - 健康检查: /api/health
145 lines
3.4 KiB
YAML
145 lines
3.4 KiB
YAML
# 测试环境配置
|
|
|
|
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
|
|
|
|
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=1
|
|
|
|
# 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
|