feat: 完成项目整理优化和生产环境配置
🧹 项目结构优化: - 删除重复和过时的文件 - 整理文档到docs目录结构 - 优化配置文件到configs目录 - 创建清晰的PROJECT_STRUCTURE.md 🔧 中间件配置: - 重启MySQL/Redis/Nacos中间件 - 使用现有数据目录,确保数据完整性 - 统一密码配置: MySQL(EmotionMuseum2025*#), Nacos(Peanut2817*#) 🌐 Nginx配置: - 配置前端路径: /emotion-museum - 配置API代理: /api/ -> 19000 - 配置WebSocket代理: /ws/ -> 19007 - 添加健康检查端点: /health 📋 部署脚本优化: - restart-middleware.sh - 中间件重启脚本 - setup-nginx.sh - Nginx配置脚本 - cleanup-project.sh - 项目清理脚本 - one-click-deploy.sh - 一键部署脚本 📖 文档完善: - DEPLOYMENT_FINAL.md - 最终部署指南 - PROJECT_STRUCTURE.md - 项目结构说明 - 完整的运维和故障排查指南 ✅ 生产环境就绪: - 中间件: MySQL/Redis/Nacos 运行正常 - Nginx: 反向代理配置完成 - 访问地址: http://47.111.10.27/emotion-museum - 健康检查: http://47.111.10.27/health 🎯 项目现状: - 10个微服务模块完整 - 前后端分离架构 - 容器化部署 - 统一配置管理 - 完整的部署和运维体系
This commit is contained in:
@@ -1,315 +0,0 @@
|
||||
# 情感博物馆 Jenkins Pipeline 配置指南
|
||||
|
||||
## 概述
|
||||
|
||||
本文档描述了优化后的Jenkins CI/CD流水线配置,采用分离式部署架构:
|
||||
- **构建阶段**: 在Jenkins服务器上编译打包所有微服务
|
||||
- **部署阶段**: 将jar包传输到远程应用服务器并进行容器化部署
|
||||
|
||||
## 部署脚本架构
|
||||
|
||||
### 1. 脚本分类
|
||||
|
||||
#### 🔨 构建脚本
|
||||
- **`build-all.sh`**: 专门用于Jenkins构建阶段,编译所有微服务jar包
|
||||
- **特点**: 仅在Jenkins服务器执行,不涉及远程操作
|
||||
|
||||
#### 🚀 部署脚本
|
||||
- **`deploy-remote.sh`**: 专门用于远程部署,传输jar包并部署到应用服务器
|
||||
- **特点**: 假设jar包已构建完成,专注于远程部署
|
||||
|
||||
#### 🔄 综合脚本
|
||||
- **`deploy-all.sh`**: 支持多种模式的综合脚本
|
||||
- **模式**:
|
||||
- `full`: 完整模式 (构建+部署)
|
||||
- `build`: 仅构建模式
|
||||
- `deploy`: 仅部署模式
|
||||
|
||||
### 2. 服务列表
|
||||
|
||||
所有脚本支持以下10个微服务:
|
||||
|
||||
| 服务名称 | 端口 | 描述 |
|
||||
|---------|------|------|
|
||||
| emotion-gateway | 19000 | API网关服务 |
|
||||
| emotion-user | 19001 | 用户管理服务 |
|
||||
| emotion-ai | 19002 | AI聊天服务 |
|
||||
| emotion-record | 19003 | 记录管理服务 |
|
||||
| emotion-growth | 19004 | 成长跟踪服务 |
|
||||
| emotion-explore | 19005 | 探索服务 |
|
||||
| emotion-reward | 19006 | 奖励服务 |
|
||||
| emotion-websocket | 19007 | WebSocket服务 |
|
||||
| emotion-auth | 19008 | 认证服务 |
|
||||
| emotion-stats | 19009 | 统计服务 |
|
||||
|
||||
## Jenkins Pipeline 配置
|
||||
|
||||
### 1. 推荐的Pipeline配置
|
||||
|
||||
#### 方案一:分离式Pipeline (推荐)
|
||||
|
||||
```groovy
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DEPLOY_ENV = 'test'
|
||||
PROJECT_NAME = 'emotion-museum'
|
||||
REMOTE_HOST = 'root@47.111.10.27'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'master', url: 'your-git-repo-url'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
dir('backend') {
|
||||
sh './build-all.sh'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
// 归档构建产物
|
||||
archiveArtifacts artifacts: 'backend/*/target/*.jar', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to Remote') {
|
||||
steps {
|
||||
dir('backend') {
|
||||
sh './deploy-remote.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Health Check') {
|
||||
steps {
|
||||
script {
|
||||
// 等待服务启动
|
||||
sleep 30
|
||||
|
||||
// 检查关键服务
|
||||
def services = ['19000', '19001', '19002', '19008']
|
||||
services.each { port ->
|
||||
sh "curl -f http://47.111.10.27:${port}/actuator/health || exit 1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
// 发送部署结果通知
|
||||
emailext (
|
||||
subject: "部署结果: ${env.JOB_NAME} - ${env.BUILD_NUMBER}",
|
||||
body: """
|
||||
部署状态: ${currentBuild.result}
|
||||
构建链接: ${env.BUILD_URL}
|
||||
部署环境: ${env.DEPLOY_ENV}
|
||||
""",
|
||||
to: "your-email@example.com"
|
||||
)
|
||||
}
|
||||
success {
|
||||
echo '🎉 部署成功!'
|
||||
}
|
||||
failure {
|
||||
echo '❌ 部署失败,请检查日志'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 方案二:单一Pipeline
|
||||
|
||||
```groovy
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DEPLOY_ENV = 'test'
|
||||
DEPLOY_MODE = 'full' // full, build, deploy
|
||||
PROJECT_NAME = 'emotion-museum'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'master', url: 'your-git-repo-url'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
dir('backend') {
|
||||
sh './deploy-all.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 环境变量配置
|
||||
|
||||
在Jenkins中配置以下环境变量:
|
||||
|
||||
#### 必需变量
|
||||
```bash
|
||||
# 部署配置
|
||||
DEPLOY_ENV=test # 部署环境
|
||||
DEPLOY_HOST=root@47.111.10.27 # 目标服务器
|
||||
PROJECT_NAME=emotion-museum # 项目名称
|
||||
|
||||
# 远程路径配置
|
||||
REMOTE_BUILD_DIR=/data/builds # jar包存储目录
|
||||
REMOTE_DOCKER_DIR=/data/docker # Docker配置目录
|
||||
```
|
||||
|
||||
#### 可选变量
|
||||
```bash
|
||||
# 部署模式 (仅deploy-all.sh使用)
|
||||
DEPLOY_MODE=full # full, build, deploy
|
||||
|
||||
# 数据库配置
|
||||
MYSQL_HOST=47.111.10.27
|
||||
MYSQL_PASSWORD=EmotionMuseum2025*#
|
||||
|
||||
# Nacos配置
|
||||
NACOS_SERVER_ADDR=47.111.10.27:8848
|
||||
NACOS_PASSWORD=Peanut2817*#
|
||||
```
|
||||
|
||||
### 3. 多环境部署配置
|
||||
|
||||
#### 测试环境
|
||||
```groovy
|
||||
environment {
|
||||
DEPLOY_ENV = 'test'
|
||||
DEPLOY_HOST = 'root@47.111.10.27'
|
||||
}
|
||||
```
|
||||
|
||||
#### 生产环境
|
||||
```groovy
|
||||
environment {
|
||||
DEPLOY_ENV = 'prod'
|
||||
DEPLOY_HOST = 'root@production-server'
|
||||
}
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 1. 本地测试
|
||||
|
||||
#### 仅构建
|
||||
```bash
|
||||
cd backend
|
||||
./build-all.sh
|
||||
```
|
||||
|
||||
#### 仅部署 (需要先有jar包)
|
||||
```bash
|
||||
cd backend
|
||||
./deploy-remote.sh
|
||||
```
|
||||
|
||||
#### 完整部署
|
||||
```bash
|
||||
cd backend
|
||||
./deploy-all.sh
|
||||
# 或指定模式
|
||||
DEPLOY_MODE=full ./deploy-all.sh
|
||||
```
|
||||
|
||||
### 2. Jenkins执行
|
||||
|
||||
#### 分离式执行
|
||||
```bash
|
||||
# 构建阶段
|
||||
./build-all.sh
|
||||
|
||||
# 部署阶段
|
||||
./deploy-remote.sh
|
||||
```
|
||||
|
||||
#### 综合执行
|
||||
```bash
|
||||
# 根据DEPLOY_MODE环境变量决定执行模式
|
||||
./deploy-all.sh
|
||||
```
|
||||
|
||||
## 优势特点
|
||||
|
||||
### 1. 🔄 分离式架构
|
||||
- **构建与部署分离**: Jenkins服务器专注构建,应用服务器专注运行
|
||||
- **资源优化**: 避免在应用服务器上安装构建工具
|
||||
- **安全性**: 减少应用服务器的攻击面
|
||||
|
||||
### 2. 🛡️ 容错机制
|
||||
- **单服务失败不影响其他服务**: 继续部署其他服务
|
||||
- **详细错误报告**: 每个服务的部署状态和错误信息
|
||||
- **回滚支持**: 保留旧版本容器,支持快速回滚
|
||||
|
||||
### 3. 📊 监控与报告
|
||||
- **实时日志**: 详细的部署过程日志
|
||||
- **健康检查**: 自动验证服务启动状态
|
||||
- **部署报告**: 完整的部署统计和结果报告
|
||||
|
||||
### 4. 🔧 灵活配置
|
||||
- **多模式支持**: 支持仅构建、仅部署、完整部署
|
||||
- **环境变量**: 支持Jenkins环境变量覆盖
|
||||
- **多环境**: 支持test/prod等多环境部署
|
||||
|
||||
## 故障排查
|
||||
|
||||
### 1. 构建失败
|
||||
```bash
|
||||
# 检查Java和Maven版本
|
||||
java -version
|
||||
mvn -version
|
||||
|
||||
# 查看详细构建日志
|
||||
./build-all.sh
|
||||
```
|
||||
|
||||
### 2. 部署失败
|
||||
```bash
|
||||
# 检查SSH连接
|
||||
ssh 'root@47.111.10.27' "echo 'test'"
|
||||
|
||||
# 检查远程Docker环境
|
||||
ssh 'root@47.111.10.27' "docker --version"
|
||||
|
||||
# 查看容器日志
|
||||
ssh 'root@47.111.10.27' "docker logs <service_name>"
|
||||
```
|
||||
|
||||
### 3. 服务启动失败
|
||||
```bash
|
||||
# 检查端口占用
|
||||
ssh 'root@47.111.10.27' "netstat -tlnp | grep <port>"
|
||||
|
||||
# 检查服务健康状态
|
||||
curl -f http://47.111.10.27:<port>/actuator/health
|
||||
```
|
||||
|
||||
## 联系支持
|
||||
|
||||
如遇到问题,请:
|
||||
1. 查看Jenkins构建日志
|
||||
2. 检查脚本执行日志
|
||||
3. 验证环境变量配置
|
||||
4. 联系开发团队并提供完整日志
|
||||
|
||||
---
|
||||
|
||||
**文档版本**: v2.0
|
||||
**更新时间**: 2025-07-18
|
||||
**维护团队**: 情感博物馆开发团队
|
||||
@@ -1,324 +0,0 @@
|
||||
# 情感博物馆 Jenkins 部署说明
|
||||
|
||||
## 概述
|
||||
|
||||
本文档描述如何在Jenkins中配置和使用部署脚本来自动化部署情感博物馆项目的后端微服务和前端应用。
|
||||
|
||||
## 部署脚本说明
|
||||
|
||||
### 1. 后端微服务部署
|
||||
|
||||
#### 主部署脚本
|
||||
- **文件路径**: `backend/deploy-all.sh`
|
||||
- **功能**: 一键部署所有后端微服务
|
||||
- **特性**:
|
||||
- 支持单个服务失败不影响其他服务部署
|
||||
- 详细的部署日志和错误报告
|
||||
- 支持Jenkins环境变量
|
||||
- 容器化部署到远程服务器
|
||||
|
||||
#### 单服务部署脚本
|
||||
每个微服务模块都有独立的部署脚本:
|
||||
- `backend/emotion-gateway/deploy.sh` - 网关服务
|
||||
- `backend/emotion-user/deploy.sh` - 用户服务
|
||||
- `backend/emotion-ai/deploy.sh` - AI服务
|
||||
- `backend/emotion-record/deploy.sh` - 记录服务
|
||||
- `backend/emotion-growth/deploy.sh` - 成长服务
|
||||
- `backend/emotion-websocket/deploy.sh` - WebSocket服务
|
||||
- `backend/emotion-auth/deploy.sh` - 认证服务
|
||||
|
||||
### 2. 前端应用部署
|
||||
|
||||
#### 前端部署脚本
|
||||
- **文件路径**: `web-flowith/deploy.sh`
|
||||
- **功能**: 构建并部署前端应用到远程服务器
|
||||
- **特性**:
|
||||
- 自动构建Vue应用
|
||||
- 备份旧版本
|
||||
- 配置Nginx反向代理
|
||||
- 健康检查
|
||||
|
||||
## Jenkins配置
|
||||
|
||||
### 1. 环境变量配置
|
||||
|
||||
在Jenkins中配置以下环境变量:
|
||||
|
||||
#### 必需变量
|
||||
```bash
|
||||
# 部署目标服务器
|
||||
DEPLOY_HOST=root@47.111.10.27
|
||||
|
||||
# 后端部署配置
|
||||
REMOTE_BUILD_DIR=/data/builds
|
||||
REMOTE_DOCKER_DIR=/data/docker
|
||||
DEPLOY_ENV=test
|
||||
PROJECT_NAME=emotion-museum
|
||||
|
||||
# 前端部署配置
|
||||
REMOTE_WEB_DIR=/data/www/emotion-museum
|
||||
```
|
||||
|
||||
#### 可选变量
|
||||
```bash
|
||||
# 数据库配置
|
||||
MYSQL_HOST=47.111.10.27
|
||||
MYSQL_PORT=3306
|
||||
MYSQL_DATABASE=emotion_museum
|
||||
MYSQL_USERNAME=root
|
||||
|
||||
# Redis配置
|
||||
REDIS_HOST=47.111.10.27
|
||||
REDIS_PORT=6379
|
||||
REDIS_PASSWORD=
|
||||
REDIS_DATABASE=0
|
||||
|
||||
# Nacos配置
|
||||
NACOS_SERVER_ADDR=47.111.10.27:8848
|
||||
NACOS_USERNAME=nacos
|
||||
NACOS_PASSWORD=Peanut2817*#
|
||||
|
||||
# AI服务配置
|
||||
COZE_API_TOKEN=your_coze_api_token
|
||||
|
||||
# JWT配置
|
||||
JWT_SECRET=emotion-museum-secret-key-2025
|
||||
```
|
||||
|
||||
### 2. Jenkins Pipeline 配置
|
||||
|
||||
#### 后端微服务Pipeline
|
||||
|
||||
```groovy
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DEPLOY_HOST = 'root@47.111.10.27'
|
||||
DEPLOY_ENV = 'test'
|
||||
PROJECT_NAME = 'emotion-museum'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'main', url: 'your-git-repo-url'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Backend Services') {
|
||||
steps {
|
||||
dir('backend') {
|
||||
sh './deploy-all.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
// 发送部署结果通知
|
||||
emailext (
|
||||
subject: "部署结果: ${env.JOB_NAME} - ${env.BUILD_NUMBER}",
|
||||
body: "部署状态: ${currentBuild.result}\n构建链接: ${env.BUILD_URL}",
|
||||
to: "your-email@example.com"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 前端应用Pipeline
|
||||
|
||||
```groovy
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DEPLOY_HOST = 'root@47.111.10.27'
|
||||
REMOTE_WEB_DIR = '/data/www/emotion-museum'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'main', url: 'your-git-repo-url'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Frontend') {
|
||||
steps {
|
||||
dir('web-flowith') {
|
||||
sh './deploy.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
emailext (
|
||||
subject: "前端部署结果: ${env.JOB_NAME} - ${env.BUILD_NUMBER}",
|
||||
body: "部署状态: ${currentBuild.result}\n访问地址: http://47.111.10.27/emotion-museum/",
|
||||
to: "your-email@example.com"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 单服务部署Job配置
|
||||
|
||||
为每个微服务创建单独的Jenkins Job:
|
||||
|
||||
```groovy
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
choice(
|
||||
name: 'SERVICE_NAME',
|
||||
choices: ['emotion-gateway', 'emotion-user', 'emotion-ai', 'emotion-record', 'emotion-growth', 'emotion-websocket', 'emotion-auth'],
|
||||
description: '选择要部署的服务'
|
||||
)
|
||||
}
|
||||
|
||||
environment {
|
||||
DEPLOY_HOST = 'root@47.111.10.27'
|
||||
DEPLOY_ENV = 'test'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
git branch: 'main', url: 'your-git-repo-url'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Single Service') {
|
||||
steps {
|
||||
dir("backend/${params.SERVICE_NAME}") {
|
||||
sh './deploy.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 部署流程
|
||||
|
||||
### 1. 全量部署流程
|
||||
|
||||
1. **代码检出**: 从Git仓库拉取最新代码
|
||||
2. **环境检查**: 检查远程服务器连接和本地构建环境
|
||||
3. **服务构建**: 使用Maven构建所有微服务
|
||||
4. **容器部署**: 逐个部署服务到Docker容器
|
||||
5. **健康检查**: 验证服务启动状态
|
||||
6. **部署报告**: 生成详细的部署结果报告
|
||||
|
||||
### 2. 单服务部署流程
|
||||
|
||||
1. **服务构建**: 构建指定的微服务
|
||||
2. **容器更新**: 停止旧容器,启动新容器
|
||||
3. **健康检查**: 验证服务状态
|
||||
4. **结果反馈**: 返回部署结果
|
||||
|
||||
### 3. 前端部署流程
|
||||
|
||||
1. **依赖安装**: 安装Node.js依赖
|
||||
2. **项目构建**: 构建Vue生产版本
|
||||
3. **文件上传**: 上传构建产物到服务器
|
||||
4. **Nginx配置**: 配置反向代理和静态文件服务
|
||||
5. **健康检查**: 验证前端页面和API代理
|
||||
|
||||
## 监控和日志
|
||||
|
||||
### 1. 部署日志
|
||||
|
||||
- **位置**: Jenkins构建日志
|
||||
- **内容**: 详细的部署步骤和错误信息
|
||||
- **格式**: 带时间戳和颜色标识的结构化日志
|
||||
|
||||
### 2. 应用日志
|
||||
|
||||
- **后端日志**: `/data/logs/emotion-museum/`
|
||||
- **Nginx日志**: `/data/logs/nginx/`
|
||||
- **容器日志**: `docker logs <container_name>`
|
||||
|
||||
### 3. 健康检查
|
||||
|
||||
- **后端服务**: `http://47.111.10.27:<port>/actuator/health`
|
||||
- **前端应用**: `http://47.111.10.27/emotion-museum/`
|
||||
- **API代理**: `http://47.111.10.27/api/`
|
||||
|
||||
## 故障排查
|
||||
|
||||
### 1. 常见问题
|
||||
|
||||
#### 服务启动失败
|
||||
```bash
|
||||
# 查看容器日志
|
||||
docker logs <service_name>
|
||||
|
||||
# 查看容器状态
|
||||
docker ps -a | grep emotion
|
||||
|
||||
# 重启服务
|
||||
docker restart <service_name>
|
||||
```
|
||||
|
||||
#### 网络连接问题
|
||||
```bash
|
||||
# 检查端口占用
|
||||
netstat -tlnp | grep <port>
|
||||
|
||||
# 检查防火墙
|
||||
ufw status
|
||||
|
||||
# 测试服务连通性
|
||||
curl -f http://localhost:<port>/actuator/health
|
||||
```
|
||||
|
||||
#### 前端访问问题
|
||||
```bash
|
||||
# 检查Nginx配置
|
||||
nginx -t
|
||||
|
||||
# 重载Nginx配置
|
||||
systemctl reload nginx
|
||||
|
||||
# 查看Nginx日志
|
||||
tail -f /data/logs/nginx/emotion-museum-error.log
|
||||
```
|
||||
|
||||
### 2. 回滚操作
|
||||
|
||||
#### 后端服务回滚
|
||||
```bash
|
||||
# 停止当前容器
|
||||
docker stop <service_name>
|
||||
|
||||
# 启动备份版本
|
||||
docker run -d --name <service_name> <backup_image>
|
||||
```
|
||||
|
||||
#### 前端应用回滚
|
||||
```bash
|
||||
# 恢复备份版本
|
||||
cd /data/www/emotion-museum/backup
|
||||
cp -r backup_<timestamp> ../web-flowith
|
||||
```
|
||||
|
||||
## 安全注意事项
|
||||
|
||||
1. **SSH密钥管理**: 确保Jenkins服务器的SSH密钥安全
|
||||
2. **环境变量**: 敏感信息使用Jenkins凭据管理
|
||||
3. **网络安全**: 限制服务器访问权限
|
||||
4. **日志安全**: 避免在日志中暴露敏感信息
|
||||
|
||||
## 联系信息
|
||||
|
||||
如有问题,请联系开发团队:
|
||||
- 邮箱: dev@emotion-museum.com
|
||||
- 文档更新: 2025-07-18
|
||||
@@ -1,269 +0,0 @@
|
||||
# Nacos配置优化总结
|
||||
|
||||
## 概述
|
||||
|
||||
根据当前更新后的模块端口号和Nacos配置要求,已完成所有后台模块的Nacos配置优化,确保所有服务可以正确注册到Nacos上,并为每个模块创建了本地、测试、生产三套环境配置文件。
|
||||
|
||||
## 完成的工作
|
||||
|
||||
### 1. 端口配置统一
|
||||
|
||||
| 服务名称 | 端口 | 状态 | 描述 |
|
||||
|---------|------|------|------|
|
||||
| emotion-gateway | 19000 | ✅ 已配置 | 网关服务 |
|
||||
| emotion-user | 19001 | ✅ 已配置 | 用户服务(包含认证) |
|
||||
| emotion-ai | 19002 | ✅ 已配置 | AI对话服务 |
|
||||
| emotion-record | 19003 | ✅ 已修正 | 情绪记录服务 |
|
||||
| emotion-growth | 19004 | ✅ 已配置 | 成长课题服务 |
|
||||
| emotion-explore | 19005 | ✅ 已配置 | 地图探索服务 |
|
||||
| emotion-reward | 19006 | ✅ 已配置 | 成就奖励服务 |
|
||||
| emotion-websocket | 19007 | ✅ 已配置 | WebSocket聊天服务 |
|
||||
| emotion-stats | 19008 | ✅ 已配置 | 统计分析服务 |
|
||||
|
||||
### 2. Nacos配置优化
|
||||
|
||||
#### 主配置文件更新 (`application.yml`)
|
||||
- ✅ 启用Nacos服务发现 (`enabled: true`)
|
||||
- ✅ 添加认证配置 (`username/password`)
|
||||
- ✅ 配置服务元数据 (`metadata`)
|
||||
- ✅ 设置心跳和超时参数
|
||||
- ✅ 配置集群和权重信息
|
||||
|
||||
#### 环境配置文件创建
|
||||
为每个服务创建了三套环境配置:
|
||||
|
||||
**本地环境** (`application-local.yml`)
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:8848
|
||||
namespace:
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
```
|
||||
|
||||
**测试环境** (`application-test.yml`)
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 47.111.10.27:8848
|
||||
namespace: test
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
```
|
||||
|
||||
**生产环境** (`application-prod.yml`)
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 47.111.10.27:8848
|
||||
namespace: prod
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
```
|
||||
|
||||
### 3. 网关配置优化
|
||||
|
||||
#### 路由配置更新
|
||||
- ✅ 使用负载均衡 (`lb://service-name`)
|
||||
- ✅ 启用服务发现 (`locator.enabled: true`)
|
||||
- ✅ 配置跨域支持 (`globalcors`)
|
||||
- ✅ 支持WebSocket路由
|
||||
|
||||
#### 完整路由列表
|
||||
```yaml
|
||||
routes:
|
||||
# 用户相关服务
|
||||
- /user/** → lb://emotion-user
|
||||
- /captcha/** → lb://emotion-user
|
||||
- /oauth/** → lb://emotion-user
|
||||
|
||||
# AI相关服务
|
||||
- /ai/** → lb://emotion-ai
|
||||
- /websocket/** → lb://emotion-websocket
|
||||
- /ws/** → lb://emotion-websocket
|
||||
|
||||
# 业务功能服务
|
||||
- /record/** → lb://emotion-record
|
||||
- /growth/** → lb://emotion-growth
|
||||
- /explore/** → lb://emotion-explore
|
||||
- /reward/** → lb://emotion-reward
|
||||
- /stats/** → lb://emotion-stats
|
||||
```
|
||||
|
||||
### 4. 特殊服务配置
|
||||
|
||||
#### emotion-ai服务
|
||||
- ✅ 添加Coze平台配置
|
||||
- ✅ 配置功能开关
|
||||
- ✅ AI模型参数配置
|
||||
|
||||
#### emotion-websocket服务
|
||||
- ✅ 添加WebSocket配置
|
||||
- ✅ 配置STOMP和SockJS
|
||||
- ✅ 设置消息代理
|
||||
|
||||
### 5. 数据库和Redis配置
|
||||
|
||||
#### 环境差异化配置
|
||||
**本地环境**
|
||||
```yaml
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/emotion_museum
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password:
|
||||
```
|
||||
|
||||
**测试/生产环境**
|
||||
```yaml
|
||||
datasource:
|
||||
url: jdbc:mysql://47.111.10.27:3306/emotion_museum
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
|
||||
redis:
|
||||
host: 47.111.10.27
|
||||
port: 6379
|
||||
password: EmotionMuseum2025*#
|
||||
```
|
||||
|
||||
## 工具脚本
|
||||
|
||||
### 1. 批量配置生成脚本
|
||||
- **文件**: `backend/update-nacos-config.sh`
|
||||
- **功能**: 批量为所有服务生成Nacos配置文件
|
||||
- **使用**: `./backend/update-nacos-config.sh`
|
||||
|
||||
### 2. 配置验证脚本
|
||||
- **文件**: `backend/verify-nacos-config.sh`
|
||||
- **功能**: 验证所有服务的配置文件完整性
|
||||
- **使用**: `./backend/verify-nacos-config.sh`
|
||||
|
||||
## Nacos服务器配置
|
||||
|
||||
### 认证配置
|
||||
根据提供的Nacos配置,已配置:
|
||||
```properties
|
||||
nacos.core.auth.enabled=false
|
||||
nacos.core.auth.admin.enabled=true
|
||||
nacos.core.auth.console.enabled=true
|
||||
nacos.core.auth.server.identity.key=nacosServerIdentity
|
||||
nacos.core.auth.server.identity.value=Peanut2817*#
|
||||
```
|
||||
|
||||
### 客户端认证
|
||||
所有服务配置了统一的认证信息:
|
||||
- **用户名**: nacos
|
||||
- **密码**: nacos
|
||||
|
||||
## 启动方式
|
||||
|
||||
### 1. 指定环境启动
|
||||
```bash
|
||||
# 本地环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=local
|
||||
|
||||
# 测试环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=test
|
||||
|
||||
# 生产环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=prod
|
||||
```
|
||||
|
||||
### 2. JAR包启动
|
||||
```bash
|
||||
# 本地环境
|
||||
java -jar app.jar --spring.profiles.active=local
|
||||
|
||||
# 测试环境
|
||||
java -jar app.jar --spring.profiles.active=test
|
||||
|
||||
# 生产环境
|
||||
java -jar app.jar --spring.profiles.active=prod
|
||||
```
|
||||
|
||||
## 验证结果
|
||||
|
||||
### 配置验证通过
|
||||
```
|
||||
===========================================
|
||||
验证结果统计
|
||||
===========================================
|
||||
总服务数: 9
|
||||
验证成功: 9
|
||||
验证失败: 0
|
||||
🎉 所有服务配置验证通过!
|
||||
```
|
||||
|
||||
### 服务注册验证
|
||||
启动服务后,可通过以下方式验证:
|
||||
|
||||
1. **Nacos控制台**: http://47.111.10.27:8848/nacos
|
||||
2. **服务列表**: 查看所有服务是否正确注册
|
||||
3. **健康检查**: 确认服务状态为UP
|
||||
|
||||
## 环境隔离
|
||||
|
||||
### 命名空间配置
|
||||
- **本地环境**: 默认命名空间 (空)
|
||||
- **测试环境**: test命名空间
|
||||
- **生产环境**: prod命名空间
|
||||
|
||||
### 配置隔离
|
||||
- 不同环境使用不同的数据库和Redis实例
|
||||
- 日志级别按环境调整
|
||||
- 服务发现配置环境隔离
|
||||
|
||||
## 监控和日志
|
||||
|
||||
### 日志配置
|
||||
- **本地环境**: DEBUG级别,详细日志
|
||||
- **测试环境**: INFO级别,适中日志
|
||||
- **生产环境**: WARN级别,精简日志
|
||||
|
||||
### 日志文件
|
||||
- 格式: `logs/{service-name}-{env}.log`
|
||||
- 示例: `logs/emotion-user-local.log`
|
||||
|
||||
## 后续优化建议
|
||||
|
||||
1. **配置中心**: 启用Nacos配置中心功能
|
||||
2. **服务监控**: 集成Prometheus和Grafana
|
||||
3. **链路追踪**: 添加Sleuth和Zipkin
|
||||
4. **熔断降级**: 集成Sentinel
|
||||
5. **安全加固**: 配置服务间认证
|
||||
|
||||
## 总结
|
||||
|
||||
✅ **完成项目**:
|
||||
- 所有9个微服务的Nacos配置已完成
|
||||
- 端口配置已统一和修正
|
||||
- 三套环境配置文件已创建
|
||||
- 网关路由配置已优化
|
||||
- 配置验证100%通过
|
||||
|
||||
✅ **关键特性**:
|
||||
- 支持环境隔离
|
||||
- 自动服务发现
|
||||
- 负载均衡路由
|
||||
- 跨域支持
|
||||
- WebSocket支持
|
||||
|
||||
现在所有服务都可以正确注册到Nacos,通过网关进行统一访问,支持多环境部署!🚀
|
||||
@@ -1,270 +0,0 @@
|
||||
# Nacos配置最终总结
|
||||
|
||||
## 概述
|
||||
|
||||
已完成所有后台模块的Nacos配置优化,包括端口统一、环境配置文件创建和密码配置更新。所有服务现在可以正确注册到Nacos并通过网关进行统一访问。
|
||||
|
||||
## 最终配置状态
|
||||
|
||||
### 1. 服务端口配置 ✅
|
||||
|
||||
| 服务名称 | 端口 | 状态 | 描述 |
|
||||
|---------|------|------|------|
|
||||
| emotion-gateway | 19000 | ✅ 已配置 | 网关服务 |
|
||||
| emotion-user | 19001 | ✅ 已配置 | 用户服务(包含认证) |
|
||||
| emotion-ai | 19002 | ✅ 已配置 | AI对话服务 |
|
||||
| emotion-record | 19003 | ✅ 已修正 | 情绪记录服务 |
|
||||
| emotion-growth | 19004 | ✅ 已配置 | 成长课题服务 |
|
||||
| emotion-explore | 19005 | ✅ 已配置 | 地图探索服务 |
|
||||
| emotion-reward | 19006 | ✅ 已配置 | 成就奖励服务 |
|
||||
| emotion-websocket | 19007 | ✅ 已配置 | WebSocket聊天服务 |
|
||||
| emotion-stats | 19008 | ✅ 已配置 | 统计分析服务 |
|
||||
|
||||
### 2. Nacos密码配置 ✅
|
||||
|
||||
#### 环境密码配置
|
||||
- **本地环境** (`application-local.yml`): `Peanut2817*#`
|
||||
- **测试环境** (`application-test.yml`): `EmotionMuseum2025`
|
||||
- **生产环境** (`application-prod.yml`): `EmotionMuseum2025`
|
||||
|
||||
#### 验证结果
|
||||
```bash
|
||||
# 本地环境密码验证
|
||||
grep "password: Peanut2817*#" backend/emotion-*/src/main/resources/application-local.yml
|
||||
# 结果: 18个匹配项 (9个服务 × 2个配置项)
|
||||
|
||||
# 测试环境密码验证
|
||||
grep "password: EmotionMuseum2025" backend/emotion-*/src/main/resources/application-test.yml
|
||||
# 结果: 18个匹配项
|
||||
|
||||
# 生产环境密码验证
|
||||
grep "password: EmotionMuseum2025" backend/emotion-*/src/main/resources/application-prod.yml
|
||||
# 结果: 18个匹配项
|
||||
```
|
||||
|
||||
### 3. 环境配置文件 ✅
|
||||
|
||||
每个服务都包含完整的三套环境配置:
|
||||
|
||||
#### 本地环境配置示例
|
||||
```yaml
|
||||
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
|
||||
```
|
||||
|
||||
#### 测试环境配置示例
|
||||
```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
|
||||
```
|
||||
|
||||
#### 生产环境配置示例
|
||||
```yaml
|
||||
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
|
||||
```
|
||||
|
||||
### 4. 网关路由配置 ✅
|
||||
|
||||
#### 完整路由映射
|
||||
```yaml
|
||||
routes:
|
||||
# 用户相关服务
|
||||
- /user/** → lb://emotion-user:19001
|
||||
- /captcha/** → lb://emotion-user:19001
|
||||
- /oauth/** → lb://emotion-user:19001
|
||||
|
||||
# AI相关服务
|
||||
- /ai/** → lb://emotion-ai:19002
|
||||
- /websocket/** → lb://emotion-websocket:19007
|
||||
- /ws/** → lb://emotion-websocket:19007 (WebSocket)
|
||||
|
||||
# 业务功能服务
|
||||
- /record/** → lb://emotion-record:19003
|
||||
- /growth/** → lb://emotion-growth:19004
|
||||
- /explore/** → lb://emotion-explore:19005
|
||||
- /reward/** → lb://emotion-reward:19006
|
||||
- /stats/** → lb://emotion-stats:19008
|
||||
```
|
||||
|
||||
#### 特殊配置
|
||||
- ✅ 跨域支持 (`globalcors`)
|
||||
- ✅ WebSocket协议升级支持
|
||||
- ✅ 负载均衡 (`lb://`)
|
||||
- ✅ 服务发现集成
|
||||
|
||||
### 5. 特殊服务配置 ✅
|
||||
|
||||
#### emotion-ai服务
|
||||
```yaml
|
||||
# Coze平台配置
|
||||
coze:
|
||||
base-url: https://api.coze.cn
|
||||
bot-id: 7523042446285439016
|
||||
workflow-id: 7523047462895796287
|
||||
token: pat_GCR4qKzqpf90wMCvKsldMrB18KG3QsLDci65bZthssKsbLxu8X70BKYumleDcabO
|
||||
|
||||
# 功能开关
|
||||
features:
|
||||
emotion-analysis:
|
||||
enabled: false
|
||||
chat:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
#### emotion-websocket服务
|
||||
```yaml
|
||||
# WebSocket配置
|
||||
websocket:
|
||||
allowed-origins: "*"
|
||||
sockjs:
|
||||
enabled: true
|
||||
heartbeat-time: 25000
|
||||
stomp:
|
||||
broker:
|
||||
enabled: true
|
||||
destinations: ["/topic", "/queue"]
|
||||
application-destination-prefixes: ["/app"]
|
||||
```
|
||||
|
||||
## 启动方式
|
||||
|
||||
### 1. 环境指定启动
|
||||
```bash
|
||||
# 本地环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=local
|
||||
|
||||
# 测试环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=test
|
||||
|
||||
# 生产环境
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=prod
|
||||
```
|
||||
|
||||
### 2. JAR包启动
|
||||
```bash
|
||||
# 本地环境
|
||||
java -jar app.jar --spring.profiles.active=local
|
||||
|
||||
# 测试环境
|
||||
java -jar app.jar --spring.profiles.active=test
|
||||
|
||||
# 生产环境
|
||||
java -jar app.jar --spring.profiles.active=prod
|
||||
```
|
||||
|
||||
## 验证工具
|
||||
|
||||
### 1. 配置验证脚本
|
||||
```bash
|
||||
./backend/verify-nacos-config.sh
|
||||
```
|
||||
|
||||
### 2. 密码更新脚本
|
||||
```bash
|
||||
./backend/update-nacos-passwords.sh
|
||||
```
|
||||
|
||||
### 3. 网关路由测试
|
||||
```bash
|
||||
./backend/emotion-gateway/test-gateway-routes.sh
|
||||
```
|
||||
|
||||
## 环境隔离
|
||||
|
||||
### 命名空间配置
|
||||
- **本地环境**: 默认命名空间 (空字符串)
|
||||
- **测试环境**: `test` 命名空间
|
||||
- **生产环境**: `prod` 命名空间
|
||||
|
||||
### 数据库配置
|
||||
- **本地环境**: `localhost:3306`, 密码: `123456`
|
||||
- **测试环境**: `47.111.10.27:3306`, 密码: `EmotionMuseum2025*#`
|
||||
- **生产环境**: `47.111.10.27:3306`, 密码: `EmotionMuseum2025*#`
|
||||
|
||||
### Redis配置
|
||||
- **本地环境**: `localhost:6379`, 无密码
|
||||
- **测试环境**: `47.111.10.27:6379`, 密码: `EmotionMuseum2025*#`
|
||||
- **生产环境**: `47.111.10.27:6379`, 密码: `EmotionMuseum2025*#`
|
||||
|
||||
## 配置文件清单
|
||||
|
||||
### 每个服务包含的配置文件
|
||||
```
|
||||
backend/{service-name}/src/main/resources/
|
||||
├── application.yml # 主配置文件
|
||||
├── application-local.yml # 本地环境配置
|
||||
├── application-test.yml # 测试环境配置
|
||||
└── application-prod.yml # 生产环境配置
|
||||
```
|
||||
|
||||
### 总计配置文件数量
|
||||
- **9个服务** × **4个配置文件** = **36个配置文件**
|
||||
- 所有配置文件都已创建并验证通过 ✅
|
||||
|
||||
## 最终验证结果
|
||||
|
||||
```
|
||||
===========================================
|
||||
验证结果统计
|
||||
===========================================
|
||||
总服务数: 9
|
||||
验证成功: 9
|
||||
验证失败: 0
|
||||
🎉 所有服务配置验证通过!
|
||||
```
|
||||
|
||||
## 总结
|
||||
|
||||
✅ **已完成的工作**:
|
||||
1. 统一了所有9个微服务的端口配置
|
||||
2. 为每个服务创建了完整的三套环境配置文件
|
||||
3. 配置了正确的Nacos认证密码
|
||||
4. 优化了网关路由配置,支持负载均衡和WebSocket
|
||||
5. 添加了特殊服务的专用配置
|
||||
6. 创建了验证和管理工具脚本
|
||||
|
||||
✅ **关键特性**:
|
||||
- 完整的环境隔离 (local/test/prod)
|
||||
- 统一的服务发现和注册
|
||||
- 负载均衡路由
|
||||
- WebSocket支持
|
||||
- 跨域配置
|
||||
- 安全认证
|
||||
|
||||
现在所有服务都可以正确注册到Nacos,通过网关进行统一访问,支持多环境部署!🚀
|
||||
|
||||
**下一步**: 提交代码到远程仓库
|
||||
@@ -1,156 +0,0 @@
|
||||
# 情感博物馆项目优化总结
|
||||
|
||||
## 已完成的工作
|
||||
|
||||
### 1. 创建了emotion-auth统一认证模块
|
||||
- ✅ 创建了emotion-auth模块的基础结构
|
||||
- ✅ 移动了认证相关的代码到auth模块
|
||||
- ✅ 配置了auth模块的pom.xml和Dockerfile
|
||||
- ✅ 更新了父pom.xml包含auth模块
|
||||
|
||||
### 2. 优化了配置文件管理
|
||||
- ✅ 统一了所有服务的application.yml配置
|
||||
- ✅ 添加了环境变量支持:`spring.profiles.active: ${SPRING_PROFILES_ACTIVE:local}`
|
||||
- ✅ 创建了application-local.yml本地环境配置文件
|
||||
- ✅ 配置了Bean覆盖和循环引用支持
|
||||
|
||||
### 3. 优化了启动脚本
|
||||
- ✅ 创建了支持环境参数的启动脚本:`./start-services.sh [env]`
|
||||
- ✅ 默认使用local环境,支持dev、prod等环境切换
|
||||
- ✅ 添加了基础服务检查(MySQL、Redis)
|
||||
- ✅ 添加了服务状态检查和日志输出
|
||||
|
||||
### 4. 统一了Coze API配置
|
||||
- ✅ 在AI服务中配置了统一的Coze API参数
|
||||
- ✅ 所有环境使用相同的Coze配置
|
||||
|
||||
### 5. 清理了无用文件
|
||||
- ✅ 删除了测试文件和重复的配置文件
|
||||
- ✅ 删除了不再使用的启动脚本
|
||||
|
||||
### 6. 前端网关配置
|
||||
- ✅ 更新了前端vite.config.js,统一通过网关访问后端
|
||||
- ✅ 更新了网关路由配置,支持所有服务的路由转发
|
||||
- ✅ 创建了.env.local环境配置文件
|
||||
|
||||
## 已解决的问题
|
||||
|
||||
### 1. 循环依赖问题 ✅
|
||||
**问题描述:** 用户服务存在Bean循环依赖问题
|
||||
```
|
||||
jwtAuthenticationFilter -> userDetailsServiceImpl -> userServiceImpl -> securityConfig -> jwtAuthenticationFilter
|
||||
```
|
||||
|
||||
**解决方案:**
|
||||
1. ✅ 创建独立的AuthenticationConfig类,分离认证相关Bean配置
|
||||
2. ✅ 使用@Lazy注解延迟加载关键依赖
|
||||
3. ✅ 通过ApplicationContext获取Bean,避免直接依赖
|
||||
4. ✅ 修复验证码配置中的初始化问题
|
||||
|
||||
### 2. 服务启动成功 ✅
|
||||
所有核心服务现在都能正常启动:
|
||||
- ✅ 用户服务 (19001) - 运行正常
|
||||
- ✅ AI服务 (19002) - 运行正常
|
||||
- ✅ 网关服务 (19000) - 运行正常
|
||||
|
||||
### 3. 配置文件问题 ✅
|
||||
- ✅ 修复了重复的profiles配置
|
||||
- ✅ 统一了环境变量配置格式
|
||||
- ✅ 修复了pom.xml中缺失的主类配置
|
||||
|
||||
## 下一步工作计划
|
||||
|
||||
### 优先级1:完善网关路由和安全配置 🔄
|
||||
1. **修复网关路由问题**
|
||||
- 配置用户服务的安全白名单,允许actuator端点访问
|
||||
- 为AI服务添加actuator端点配置
|
||||
- 测试网关路由功能
|
||||
|
||||
2. **完善前端集成**
|
||||
- 测试前端通过网关访问后端API
|
||||
- 验证用户注册登录功能
|
||||
- 测试AI对话功能
|
||||
|
||||
### 优先级2:完善emotion-auth模块
|
||||
1. **实现认证服务接口**
|
||||
- 完成AuthService实现类
|
||||
- 实现JWT Token管理
|
||||
- 实现用户认证逻辑
|
||||
|
||||
2. **配置服务间调用**
|
||||
- 配置Feign客户端
|
||||
- 实现服务间认证传递
|
||||
- 配置统一的异常处理
|
||||
|
||||
### 优先级3:扩展其他微服务
|
||||
1. **启动其他微服务**
|
||||
- emotion-record (记录服务)
|
||||
- emotion-growth (成长服务)
|
||||
- emotion-explore (探索服务)
|
||||
- emotion-reward (奖励服务)
|
||||
- emotion-stats (统计服务)
|
||||
|
||||
2. **完整功能测试**
|
||||
- 测试所有微服务的启动和通信
|
||||
- 验证完整的业务流程
|
||||
- 性能测试和优化
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 启动服务
|
||||
```bash
|
||||
# 使用默认local环境启动
|
||||
./start-services.sh
|
||||
|
||||
# 使用指定环境启动
|
||||
./start-services.sh dev
|
||||
./start-services.sh prod
|
||||
```
|
||||
|
||||
### 停止服务
|
||||
```bash
|
||||
./stop-services.sh
|
||||
```
|
||||
|
||||
### 查看日志
|
||||
```bash
|
||||
# 查看用户服务日志
|
||||
tail -f logs/emotion-user-local.log
|
||||
|
||||
# 查看AI服务日志
|
||||
tail -f logs/emotion-ai-local.log
|
||||
|
||||
# 查看网关服务日志
|
||||
tail -f logs/emotion-gateway-local.log
|
||||
```
|
||||
|
||||
### 环境变量配置
|
||||
可以通过环境变量覆盖默认配置:
|
||||
- `SPRING_PROFILES_ACTIVE`: 指定激活的配置文件
|
||||
- `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USERNAME`, `MYSQL_PASSWORD`: 数据库配置
|
||||
- `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`: Redis配置
|
||||
- `COZE_API_TOKEN`: Coze API令牌
|
||||
|
||||
## 项目结构
|
||||
```
|
||||
backend/
|
||||
├── emotion-common/ # 公共模块
|
||||
├── emotion-auth/ # 认证授权服务 (新增)
|
||||
├── emotion-user/ # 用户服务
|
||||
├── emotion-ai/ # AI服务
|
||||
├── emotion-gateway/ # 网关服务
|
||||
├── emotion-record/ # 记录服务
|
||||
├── emotion-growth/ # 成长服务
|
||||
├── emotion-explore/ # 探索服务
|
||||
├── emotion-reward/ # 奖励服务
|
||||
├── emotion-stats/ # 统计服务
|
||||
├── start-services.sh # 启动脚本
|
||||
├── stop-services.sh # 停止脚本
|
||||
└── logs/ # 日志目录
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
1. 确保MySQL和Redis服务已启动
|
||||
2. 首次启动可能需要较长时间进行编译
|
||||
3. 如遇到端口占用,脚本会自动跳过该服务
|
||||
4. 建议在解决循环依赖问题后再进行完整的功能测试
|
||||
@@ -192,10 +192,15 @@ generate_build_report() {
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
jar_file="${service_name}/target/${service_name}-1.0.0.jar"
|
||||
|
||||
|
||||
if [ -f "$jar_file" ]; then
|
||||
jar_size=$(du -h "$jar_file" | cut -f1)
|
||||
jar_bytes=$(du -b "$jar_file" | cut -f1)
|
||||
# 兼容macOS和Linux的文件大小获取
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
jar_bytes=$(stat -f%z "$jar_file" 2>/dev/null || echo "0")
|
||||
else
|
||||
jar_bytes=$(stat -c%s "$jar_file" 2>/dev/null || echo "0")
|
||||
fi
|
||||
total_size=$((total_size + jar_bytes))
|
||||
printf "%-20s ${GREEN}%-10s${NC} %-10s %s\n" "$service_name" "✅ 成功" "$jar_size" "$jar_file"
|
||||
else
|
||||
|
||||
@@ -73,9 +73,6 @@ if [ -n "$TEST_SINGLE_SERVICE" ]; then
|
||||
fi
|
||||
|
||||
# 部署状态跟踪
|
||||
declare -A DEPLOYMENT_STATUS
|
||||
declare -A DEPLOYMENT_ERRORS
|
||||
declare -A DEPLOYMENT_TIMES
|
||||
TOTAL_SERVICES=${#SERVICES[@]}
|
||||
SUCCESSFUL_DEPLOYMENTS=0
|
||||
FAILED_DEPLOYMENTS=0
|
||||
@@ -214,13 +211,10 @@ deploy_service() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "开始部署服务到远程服务器: $service_name"
|
||||
DEPLOYMENT_STATUS[$service_name]="DEPLOYING"
|
||||
|
||||
# 先传输jar包
|
||||
if ! transfer_jar_to_remote $service_name; then
|
||||
local error_msg="jar包传输失败"
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg"
|
||||
log_error "jar包传输失败"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -58,9 +58,6 @@ SERVICES=(
|
||||
)
|
||||
|
||||
# 部署状态跟踪
|
||||
declare -A DEPLOYMENT_STATUS
|
||||
declare -A DEPLOYMENT_ERRORS
|
||||
declare -A DEPLOYMENT_TIMES
|
||||
TOTAL_SERVICES=${#SERVICES[@]}
|
||||
SUCCESSFUL_DEPLOYMENTS=0
|
||||
FAILED_DEPLOYMENTS=0
|
||||
@@ -177,14 +174,11 @@ deploy_service_to_remote() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "部署服务到远程: $service_name"
|
||||
DEPLOYMENT_STATUS[$service_name]="DEPLOYING"
|
||||
|
||||
# 验证远程jar包存在
|
||||
if ! ssh 'root@47.111.10.27' "test -f $REMOTE_BUILD_DIR/${service_name}-1.0.0.jar"; then
|
||||
local error_msg="远程jar包不存在"
|
||||
log_error "$error_msg"
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -253,8 +247,7 @@ deploy_service_to_remote() {
|
||||
# 记录成功状态
|
||||
local end_time=$(date +%s)
|
||||
local duration=$((end_time - start_time))
|
||||
DEPLOYMENT_STATUS[$service_name]="SUCCESS"
|
||||
DEPLOYMENT_TIMES[$service_name]="${duration}s"
|
||||
log_info "服务 $service_name 部署成功,耗时: ${duration}s"
|
||||
return 0
|
||||
else
|
||||
local error_msg="服务启动失败"
|
||||
@@ -265,9 +258,7 @@ deploy_service_to_remote() {
|
||||
# 记录失败状态
|
||||
local end_time=$(date +%s)
|
||||
local duration=$((end_time - start_time))
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg: $error_logs"
|
||||
DEPLOYMENT_TIMES[$service_name]="${duration}s"
|
||||
log_error "服务 $service_name 部署失败,耗时: ${duration}s"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,594 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 情感博物馆 - 全服务容器化部署脚本
|
||||
# 作者: emotion-museum
|
||||
# 日期: 2025-07-18
|
||||
# 支持Jenkins CI/CD部署
|
||||
|
||||
# 不要在遇到错误时立即退出,让所有模块都尝试部署
|
||||
set +e
|
||||
|
||||
# 配置变量 - 支持Jenkins环境变量覆盖
|
||||
REMOTE_HOST="${DEPLOY_HOST:-'root@47.111.10.27'}"
|
||||
REMOTE_BUILD_DIR="${REMOTE_BUILD_DIR:-/data/builds}"
|
||||
REMOTE_DOCKER_COMPOSE_DIR="${REMOTE_DOCKER_DIR:-/data/docker}"
|
||||
PROFILE="${DEPLOY_ENV:-test}"
|
||||
PROJECT_NAME="${PROJECT_NAME:-emotion-museum}"
|
||||
|
||||
# Jenkins构建信息
|
||||
BUILD_NUMBER="${BUILD_NUMBER:-manual}"
|
||||
JOB_NAME="${JOB_NAME:-local-deploy}"
|
||||
BUILD_URL="${BUILD_URL:-}"
|
||||
|
||||
# 部署模式配置
|
||||
DEPLOY_MODE="${DEPLOY_MODE:-full}" # full: 完整部署, build: 仅构建, deploy: 仅部署
|
||||
|
||||
# 颜色输出
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 日志函数
|
||||
log_info() {
|
||||
echo -e "${BLUE}[INFO]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
echo -e "${GREEN}[SUCCESS]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}[ERROR]${NC} $(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||
}
|
||||
|
||||
# 服务列表
|
||||
SERVICES=(
|
||||
"emotion-gateway:19000"
|
||||
"emotion-user:19001"
|
||||
"emotion-ai:19002"
|
||||
"emotion-record:19003"
|
||||
"emotion-growth:19004"
|
||||
"emotion-explore:19005"
|
||||
"emotion-reward:19006"
|
||||
"emotion-websocket:19007"
|
||||
"emotion-auth:19008"
|
||||
"emotion-stats:19009"
|
||||
)
|
||||
|
||||
# 部署状态跟踪
|
||||
declare -A DEPLOYMENT_STATUS
|
||||
declare -A DEPLOYMENT_ERRORS
|
||||
declare -A DEPLOYMENT_TIMES
|
||||
TOTAL_SERVICES=${#SERVICES[@]}
|
||||
SUCCESSFUL_DEPLOYMENTS=0
|
||||
FAILED_DEPLOYMENTS=0
|
||||
|
||||
# 检查远程服务器连接
|
||||
check_remote_connection() {
|
||||
log_info "检查远程服务器连接..."
|
||||
if ssh -o ConnectTimeout=10 'root@47.111.10.27' "echo 'Connection successful'" > /dev/null 2>&1; then
|
||||
log_success "远程服务器连接正常"
|
||||
else
|
||||
log_error "无法连接到远程服务器 'root@47.111.10.27'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 创建远程目录
|
||||
create_remote_directories() {
|
||||
log_info "创建远程目录结构..."
|
||||
ssh 'root@47.111.10.27' "
|
||||
mkdir -p $REMOTE_BUILD_DIR
|
||||
mkdir -p $REMOTE_DOCKER_COMPOSE_DIR
|
||||
mkdir -p /data/logs/emotion-museum
|
||||
mkdir -p /data/config/emotion-museum
|
||||
"
|
||||
log_success "远程目录创建完成"
|
||||
}
|
||||
|
||||
# 构建所有服务 (Jenkins阶段)
|
||||
build_all_services() {
|
||||
log_info "开始在Jenkins服务器上构建所有微服务..."
|
||||
|
||||
# 检查是否在Jenkins环境中
|
||||
if [ -n "$JENKINS_HOME" ] || [ -n "$BUILD_NUMBER" ]; then
|
||||
log_info "检测到Jenkins环境,执行完整构建流程"
|
||||
else
|
||||
log_info "本地环境,执行构建流程"
|
||||
fi
|
||||
|
||||
# 先构建父项目
|
||||
log_info "构建父项目..."
|
||||
if mvn clean install -DskipTests -q; then
|
||||
log_success "父项目构建成功"
|
||||
else
|
||||
log_error "父项目构建失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 构建各个微服务
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
log_info "构建服务: $service_name"
|
||||
|
||||
cd $service_name
|
||||
if mvn clean package -DskipTests -P${PROFILE} -q; then
|
||||
# 检查jar包是否生成
|
||||
if [ -f "target/${service_name}-1.0.0.jar" ]; then
|
||||
local jar_size=$(du -h "target/${service_name}-1.0.0.jar" | cut -f1)
|
||||
log_success "服务 $service_name 构建成功 (大小: $jar_size)"
|
||||
else
|
||||
log_error "服务 $service_name jar包未生成"
|
||||
cd ..
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
log_error "服务 $service_name 构建失败"
|
||||
cd ..
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
|
||||
log_success "所有服务在Jenkins服务器构建完成"
|
||||
}
|
||||
|
||||
# 部署所有服务到远程服务器
|
||||
deploy_all_services_to_remote() {
|
||||
log_info "开始逐个部署服务到远程服务器..."
|
||||
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
service_port=$(echo $service_info | cut -d':' -f2)
|
||||
|
||||
echo ""
|
||||
log_info "[$((SUCCESSFUL_DEPLOYMENTS + FAILED_DEPLOYMENTS + 1))/$TOTAL_SERVICES] 部署服务: $service_name"
|
||||
|
||||
if deploy_service $service_name $service_port; then
|
||||
SUCCESSFUL_DEPLOYMENTS=$((SUCCESSFUL_DEPLOYMENTS + 1))
|
||||
log_success "✅ 服务 $service_name 部署成功"
|
||||
else
|
||||
FAILED_DEPLOYMENTS=$((FAILED_DEPLOYMENTS + 1))
|
||||
log_error "❌ 服务 $service_name 部署失败,继续部署其他服务..."
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# 传输jar包到远程服务器
|
||||
transfer_jar_to_remote() {
|
||||
local service_name=$1
|
||||
|
||||
log_info "传输jar包到远程服务器: $service_name"
|
||||
|
||||
# 检查本地jar包是否存在
|
||||
local jar_file="${service_name}/target/${service_name}-1.0.0.jar"
|
||||
if [ ! -f "$jar_file" ]; then
|
||||
log_error "本地JAR包不存在: $jar_file"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 显示jar包信息
|
||||
local jar_size=$(du -h "$jar_file" | cut -f1)
|
||||
log_info "准备传输jar包: $jar_file (大小: $jar_size)"
|
||||
|
||||
# 删除远程旧jar包
|
||||
log_info "清理远程旧jar包: $service_name"
|
||||
ssh 'root@47.111.10.27' "rm -f $REMOTE_BUILD_DIR/${service_name}-*.jar"
|
||||
|
||||
# 上传新jar包
|
||||
log_info "上传jar包到远程服务器..."
|
||||
if scp "$jar_file" 'root@47.111.10.27':$REMOTE_BUILD_DIR/${service_name}-1.0.0.jar; then
|
||||
log_success "jar包传输成功: $service_name"
|
||||
|
||||
# 验证远程jar包
|
||||
local remote_size=$(ssh 'root@47.111.10.27' "du -h $REMOTE_BUILD_DIR/${service_name}-1.0.0.jar | cut -f1")
|
||||
log_info "远程jar包大小: $remote_size"
|
||||
return 0
|
||||
else
|
||||
log_error "jar包传输失败: $service_name"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 部署单个服务 (远程服务器阶段)
|
||||
deploy_service() {
|
||||
local service_name=$1
|
||||
local service_port=$2
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "开始部署服务到远程服务器: $service_name"
|
||||
DEPLOYMENT_STATUS[$service_name]="DEPLOYING"
|
||||
|
||||
# 先传输jar包
|
||||
if ! transfer_jar_to_remote $service_name; then
|
||||
local error_msg="jar包传输失败"
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 验证远程jar包存在
|
||||
log_info "验证远程jar包: $service_name"
|
||||
if ! ssh 'root@47.111.10.27' "test -f $REMOTE_BUILD_DIR/${service_name}-1.0.0.jar"; then
|
||||
local error_msg="远程jar包不存在,请先执行构建和传输"
|
||||
log_error "$error_msg"
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 创建Dockerfile
|
||||
create_dockerfile $service_name $service_port
|
||||
|
||||
# 停止并删除旧容器
|
||||
log_info "停止旧容器: $service_name"
|
||||
ssh 'root@47.111.10.27' "
|
||||
docker stop ${service_name} 2>/dev/null || true
|
||||
docker rm ${service_name} 2>/dev/null || true
|
||||
docker rmi ${PROJECT_NAME}/${service_name}:latest 2>/dev/null || true
|
||||
"
|
||||
|
||||
# 构建Docker镜像
|
||||
log_info "构建Docker镜像: $service_name"
|
||||
ssh 'root@47.111.10.27' "
|
||||
# 复制jar包到Docker构建目录
|
||||
cp $REMOTE_BUILD_DIR/${service_name}-1.0.0.jar $REMOTE_DOCKER_COMPOSE_DIR/
|
||||
|
||||
# 构建镜像
|
||||
cd $REMOTE_DOCKER_COMPOSE_DIR
|
||||
docker build -t ${PROJECT_NAME}/${service_name}:latest -f Dockerfile.${service_name} .
|
||||
|
||||
# 清理临时文件
|
||||
rm -f ${service_name}-1.0.0.jar
|
||||
"
|
||||
|
||||
# 启动新容器
|
||||
log_info "启动新容器: $service_name"
|
||||
ssh 'root@47.111.10.27' "
|
||||
docker run -d \\
|
||||
--name ${service_name} \\
|
||||
--network emotion-network \\
|
||||
-p ${service_port}:${service_port} \\
|
||||
-v /data/logs/emotion-museum:/app/logs \\
|
||||
-e SPRING_PROFILES_ACTIVE=${PROFILE} \\
|
||||
-e MYSQL_HOST=47.111.10.27 \\
|
||||
-e MYSQL_PORT=3306 \\
|
||||
-e MYSQL_DATABASE=emotion_museum \\
|
||||
-e MYSQL_USERNAME=root \\
|
||||
-e MYSQL_PASSWORD='EmotionMuseum2025*#' \\
|
||||
-e REDIS_HOST=47.111.10.27 \\
|
||||
-e REDIS_PORT=6379 \\
|
||||
-e REDIS_PASSWORD= \\
|
||||
-e REDIS_DATABASE=0 \\
|
||||
-e NACOS_SERVER_ADDR=47.111.10.27:8848 \\
|
||||
-e NACOS_USERNAME=nacos \\
|
||||
-e NACOS_PASSWORD='Peanut2817*#' \\
|
||||
--restart unless-stopped \\
|
||||
${PROJECT_NAME}/${service_name}:latest
|
||||
"
|
||||
|
||||
# 等待服务启动
|
||||
log_info "等待服务启动: $service_name"
|
||||
sleep 10
|
||||
|
||||
# 检查容器状态
|
||||
if ssh 'root@47.111.10.27' "docker ps | grep ${service_name}" > /dev/null 2>&1; then
|
||||
log_success "服务 $service_name 启动成功"
|
||||
|
||||
# 显示容器日志
|
||||
log_info "显示服务日志 最后10行: $service_name"
|
||||
ssh 'root@47.111.10.27' "docker logs --tail 10 ${service_name}" 2>/dev/null || true
|
||||
|
||||
# 记录成功状态
|
||||
local end_time=$(date +%s)
|
||||
local duration=$((end_time - start_time))
|
||||
DEPLOYMENT_STATUS[$service_name]="SUCCESS"
|
||||
DEPLOYMENT_TIMES[$service_name]="${duration}s"
|
||||
return 0
|
||||
else
|
||||
local error_msg="服务启动失败"
|
||||
log_error "服务 $service_name 启动失败"
|
||||
log_error "错误日志:"
|
||||
local error_logs=$(ssh 'root@47.111.10.27' "docker logs ${service_name}" 2>&1 || echo "无法获取日志")
|
||||
echo "$error_logs"
|
||||
|
||||
# 记录失败状态
|
||||
local end_time=$(date +%s)
|
||||
local duration=$((end_time - start_time))
|
||||
DEPLOYMENT_STATUS[$service_name]="FAILED"
|
||||
DEPLOYMENT_ERRORS[$service_name]="$error_msg: $error_logs"
|
||||
DEPLOYMENT_TIMES[$service_name]="${duration}s"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 创建Dockerfile
|
||||
create_dockerfile() {
|
||||
local service_name=$1
|
||||
local service_port=$2
|
||||
|
||||
log_info "创建Dockerfile: $service_name"
|
||||
|
||||
ssh 'root@47.111.10.27' "cat > $REMOTE_DOCKER_COMPOSE_DIR/Dockerfile.${service_name} << 'EOF'
|
||||
FROM openjdk:17-jre-slim
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 安装必要的工具
|
||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制jar包 (使用相对路径)
|
||||
COPY ${service_name}-1.0.0.jar app.jar
|
||||
|
||||
# 创建日志目录
|
||||
RUN mkdir -p /app/logs
|
||||
|
||||
# 设置时区
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/\$TZ /etc/localtime && echo \$TZ > /etc/timezone
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE ${service_port}
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \\
|
||||
CMD curl -f http://localhost:${service_port}/actuator/health || exit 1
|
||||
|
||||
# 启动应用
|
||||
ENTRYPOINT [\"java\", \"-Djava.security.egd=file:/dev/./urandom\", \"-Xms512m\", \"-Xmx1024m\", \"-jar\", \"app.jar\"]
|
||||
EOF"
|
||||
}
|
||||
|
||||
# 创建Docker网络
|
||||
create_docker_network() {
|
||||
log_info "创建Docker网络..."
|
||||
ssh 'root@47.111.10.27' "
|
||||
docker network create emotion-network 2>/dev/null || true
|
||||
"
|
||||
log_success "Docker网络创建完成"
|
||||
}
|
||||
|
||||
# 健康检查
|
||||
health_check() {
|
||||
log_info "执行服务健康检查..."
|
||||
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
service_port=$(echo $service_info | cut -d':' -f2)
|
||||
|
||||
log_info "检查服务健康状态: $service_name"
|
||||
|
||||
# 等待服务完全启动
|
||||
sleep 5
|
||||
|
||||
if ssh 'root@47.111.10.27' "curl -f -s http://localhost:${service_port}/actuator/health" > /dev/null 2>&1; then
|
||||
log_success "服务 $service_name 健康检查通过"
|
||||
else
|
||||
log_warning "服务 $service_name 健康检查失败,可能仍在启动中"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# 显示详细部署报告
|
||||
show_deployment_report() {
|
||||
local total_time=$1
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo " 部署完成报告"
|
||||
echo "========================================"
|
||||
echo "项目名称: $PROJECT_NAME"
|
||||
echo "部署环境: $PROFILE"
|
||||
echo "目标服务器: $REMOTE_HOST"
|
||||
echo "部署时间: $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
echo "总耗时: ${total_time}s"
|
||||
if [ "$BUILD_NUMBER" != "manual" ]; then
|
||||
echo "Jenkins构建: #$BUILD_NUMBER"
|
||||
echo "Jenkins任务: $JOB_NAME"
|
||||
[ -n "$BUILD_URL" ] && echo "构建链接: $BUILD_URL"
|
||||
fi
|
||||
echo "========================================"
|
||||
|
||||
echo ""
|
||||
echo "📊 部署统计:"
|
||||
echo " 总服务数: $TOTAL_SERVICES"
|
||||
echo " 成功部署: $SUCCESSFUL_DEPLOYMENTS"
|
||||
echo " 失败部署: $FAILED_DEPLOYMENTS"
|
||||
echo " 成功率: $(( SUCCESSFUL_DEPLOYMENTS * 100 / TOTAL_SERVICES ))%"
|
||||
echo ""
|
||||
|
||||
echo "📋 服务部署详情:"
|
||||
printf "%-20s %-10s %-10s %s\n" "服务名称" "状态" "耗时" "备注"
|
||||
echo "----------------------------------------"
|
||||
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
service_port=$(echo $service_info | cut -d':' -f2)
|
||||
status=${DEPLOYMENT_STATUS[$service_name]:-"UNKNOWN"}
|
||||
time=${DEPLOYMENT_TIMES[$service_name]:-"N/A"}
|
||||
|
||||
case $status in
|
||||
"SUCCESS")
|
||||
printf "%-20s ${GREEN}%-10s${NC} %-10s %s\n" "$service_name" "✅ 成功" "$time" "http://47.111.10.27:$service_port"
|
||||
;;
|
||||
"FAILED")
|
||||
printf "%-20s ${RED}%-10s${NC} %-10s %s\n" "$service_name" "❌ 失败" "$time" "查看错误日志"
|
||||
;;
|
||||
*)
|
||||
printf "%-20s ${YELLOW}%-10s${NC} %-10s %s\n" "$service_name" "⚠️ 未知" "$time" "状态异常"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
# 显示失败服务的错误信息
|
||||
if [ $FAILED_DEPLOYMENTS -gt 0 ]; then
|
||||
echo "❌ 失败服务错误详情:"
|
||||
echo "----------------------------------------"
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
if [ "${DEPLOYMENT_STATUS[$service_name]}" = "FAILED" ]; then
|
||||
echo "🔸 $service_name:"
|
||||
echo " ${DEPLOYMENT_ERRORS[$service_name]}" | head -3
|
||||
echo ""
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# 显示当前运行的容器状态
|
||||
echo "🐳 当前容器运行状态:"
|
||||
echo "----------------------------------------"
|
||||
ssh 'root@47.111.10.27' "docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep emotion || echo '没有运行的emotion相关容器'"
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
|
||||
# 根据部署结果设置退出码
|
||||
if [ $FAILED_DEPLOYMENTS -eq 0 ]; then
|
||||
echo "🎉 所有服务部署成功!"
|
||||
return 0
|
||||
else
|
||||
echo "⚠️ 部分服务部署失败,请检查错误日志"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "🚀 开始全服务容器化部署..."
|
||||
log_info "目标服务器: $REMOTE_HOST"
|
||||
log_info "部署环境: $PROFILE"
|
||||
log_info "部署模式: $DEPLOY_MODE"
|
||||
log_info "服务总数: $TOTAL_SERVICES"
|
||||
|
||||
# 根据部署模式执行不同的流程
|
||||
case $DEPLOY_MODE in
|
||||
"build")
|
||||
log_info "🔨 执行构建模式 - 仅在Jenkins服务器构建jar包"
|
||||
execute_build_only
|
||||
;;
|
||||
"deploy")
|
||||
log_info "🚀 执行部署模式 - 仅部署到远程服务器"
|
||||
execute_deploy_only
|
||||
;;
|
||||
"full"|*)
|
||||
log_info "🔄 执行完整模式 - 构建+部署"
|
||||
execute_full_deployment
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# 仅构建模式
|
||||
execute_build_only() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "开始构建所有服务..."
|
||||
|
||||
# 构建服务
|
||||
if ! build_all_services; then
|
||||
log_error "服务构建失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 显示构建结果
|
||||
log_info "📦 构建产物信息:"
|
||||
for service_info in "${SERVICES[@]}"; do
|
||||
service_name=$(echo $service_info | cut -d':' -f1)
|
||||
jar_file="${service_name}/target/${service_name}-1.0.0.jar"
|
||||
if [ -f "$jar_file" ]; then
|
||||
jar_size=$(du -h "$jar_file" | cut -f1)
|
||||
log_success "✅ $service_name: $jar_size"
|
||||
else
|
||||
log_error "❌ $service_name: jar包未生成"
|
||||
fi
|
||||
done
|
||||
|
||||
local end_time=$(date +%s)
|
||||
local total_time=$((end_time - start_time))
|
||||
log_success "🎉 构建完成!总耗时: ${total_time}s"
|
||||
}
|
||||
|
||||
# 仅部署模式
|
||||
execute_deploy_only() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
log_info "开始部署到远程服务器..."
|
||||
|
||||
# 检查连接
|
||||
if ! check_remote_connection; then
|
||||
log_error "远程服务器连接失败,部署终止"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 创建目录和网络
|
||||
create_remote_directories
|
||||
create_docker_network
|
||||
|
||||
# 部署所有服务
|
||||
deploy_all_services_to_remote
|
||||
|
||||
# 健康检查和报告
|
||||
health_check
|
||||
local end_time=$(date +%s)
|
||||
local total_time=$((end_time - start_time))
|
||||
show_deployment_report $total_time
|
||||
}
|
||||
|
||||
# 完整部署模式
|
||||
execute_full_deployment() {
|
||||
local start_time=$(date +%s)
|
||||
|
||||
# 检查连接
|
||||
if ! check_remote_connection; then
|
||||
log_error "远程服务器连接失败,部署终止"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 创建目录
|
||||
create_remote_directories
|
||||
|
||||
# 创建Docker网络
|
||||
create_docker_network
|
||||
|
||||
# 构建服务
|
||||
if ! build_all_services; then
|
||||
log_error "服务构建失败,部署终止"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 部署所有服务
|
||||
deploy_all_services_to_remote
|
||||
|
||||
# 健康检查
|
||||
log_info "执行服务健康检查..."
|
||||
health_check
|
||||
|
||||
# 计算总耗时
|
||||
local end_time=$(date +%s)
|
||||
local total_time=$((end_time - start_time))
|
||||
|
||||
# 显示详细报告
|
||||
show_deployment_report $total_time
|
||||
|
||||
# 根据部署结果设置退出码
|
||||
if [ $FAILED_DEPLOYMENTS -eq 0 ]; then
|
||||
log_success "🎉 全服务容器化部署完成!"
|
||||
exit 0
|
||||
else
|
||||
log_warning "⚠️ 部分服务部署失败,请查看详细报告"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 执行主函数
|
||||
main "$@"
|
||||
@@ -1,209 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ============================================================================
|
||||
# 情绪博物馆自动化开发脚本
|
||||
# 自动编译、启动、监控文件变化并重启服务
|
||||
# ============================================================================
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 配置
|
||||
PROJECT_ROOT=$(pwd)
|
||||
SERVICES=("emotion-gateway" "emotion-user" "emotion-ai" "emotion-record" "emotion-growth" "emotion-explore" "emotion-reward" "emotion-stats")
|
||||
PID_FILE="$PROJECT_ROOT/.dev-pids"
|
||||
LOG_DIR="$PROJECT_ROOT/dev-logs"
|
||||
|
||||
# 创建日志目录
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}情绪博物馆自动化开发环境${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
# 清理函数
|
||||
cleanup() {
|
||||
echo -e "\n${YELLOW}正在停止所有服务...${NC}"
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
while read line; do
|
||||
if [ ! -z "$line" ]; then
|
||||
echo "停止进程: $line"
|
||||
kill -9 $line 2>/dev/null || true
|
||||
fi
|
||||
done < "$PID_FILE"
|
||||
rm -f "$PID_FILE"
|
||||
fi
|
||||
|
||||
# 清理Maven进程
|
||||
pkill -f "mvn.*spring-boot:run" 2>/dev/null || true
|
||||
|
||||
echo -e "${GREEN}✅ 清理完成${NC}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# 捕获退出信号
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
# 编译项目
|
||||
compile_project() {
|
||||
echo -e "${YELLOW}🔄 编译项目...${NC}"
|
||||
mvn clean compile -DskipTests -q
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}✅ 编译成功${NC}"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED}❌ 编译失败${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 启动单个服务
|
||||
start_service() {
|
||||
local service=$1
|
||||
local port=$2
|
||||
|
||||
echo -e "${BLUE}🚀 启动 $service (端口: $port)...${NC}"
|
||||
|
||||
cd "$PROJECT_ROOT/$service"
|
||||
|
||||
# 启动服务并获取PID
|
||||
nohup mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=$port" \
|
||||
> "$LOG_DIR/$service.log" 2>&1 &
|
||||
|
||||
local pid=$!
|
||||
echo "$pid" >> "$PID_FILE"
|
||||
|
||||
echo -e "${GREEN}✅ $service 已启动 (PID: $pid)${NC}"
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
}
|
||||
|
||||
# 检查服务健康状态
|
||||
check_service_health() {
|
||||
local service=$1
|
||||
local port=$2
|
||||
local max_attempts=30
|
||||
local attempt=0
|
||||
|
||||
echo -e "${YELLOW}⏳ 等待 $service 启动...${NC}"
|
||||
|
||||
while [ $attempt -lt $max_attempts ]; do
|
||||
if curl -s "http://localhost:$port/actuator/health" > /dev/null 2>&1; then
|
||||
echo -e "${GREEN}✅ $service 健康检查通过${NC}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
attempt=$((attempt + 1))
|
||||
sleep 2
|
||||
echo -n "."
|
||||
done
|
||||
|
||||
echo -e "\n${RED}❌ $service 健康检查失败${NC}"
|
||||
return 1
|
||||
}
|
||||
|
||||
# 监控文件变化
|
||||
monitor_changes() {
|
||||
echo -e "${BLUE}👀 开始监控文件变化...${NC}"
|
||||
echo -e "${YELLOW}按 Ctrl+C 停止监控${NC}"
|
||||
|
||||
# 使用fswatch监控文件变化 (需要安装: brew install fswatch)
|
||||
if command -v fswatch > /dev/null; then
|
||||
fswatch -o -r --exclude="target" --exclude=".git" --exclude="node_modules" \
|
||||
--include=".*\\.java$" --include=".*\\.yml$" --include=".*\\.xml$" \
|
||||
"$PROJECT_ROOT" | while read f; do
|
||||
echo -e "${YELLOW}🔄 检测到文件变化,重新编译...${NC}"
|
||||
if compile_project; then
|
||||
echo -e "${GREEN}📝 代码已更新,DevTools将自动重启服务${NC}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# 如果没有fswatch,使用简单的循环检查
|
||||
echo -e "${YELLOW}⚠️ 建议安装 fswatch 以获得更好的文件监控体验:brew install fswatch${NC}"
|
||||
while true; do
|
||||
sleep 5
|
||||
# 简单的时间戳检查(这里可以根据需要扩展)
|
||||
echo -e "${BLUE}💓 服务运行中... ($(date))${NC}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# 显示服务状态
|
||||
show_status() {
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}服务状态${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
local ports=(8080 8081 8082 8083 8084 8085 8086 8087)
|
||||
local i=0
|
||||
|
||||
for service in "${SERVICES[@]}"; do
|
||||
local port=${ports[$i]}
|
||||
if curl -s "http://localhost:$port/actuator/health" > /dev/null 2>&1; then
|
||||
echo -e "${GREEN}✅ $service (端口: $port) - 运行中${NC}"
|
||||
else
|
||||
echo -e "${RED}❌ $service (端口: $port) - 停止${NC}"
|
||||
fi
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${YELLOW}📋 日志文件位置: $LOG_DIR/${NC}"
|
||||
echo -e "${YELLOW}🌐 API网关: http://localhost:9000${NC}"
|
||||
echo -e "${YELLOW}📚 API文档: http://localhost:9000/doc.html${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
# 清理之前的进程
|
||||
cleanup 2>/dev/null || true
|
||||
|
||||
# 编译项目
|
||||
if ! compile_project; then
|
||||
echo -e "${RED}❌ 编译失败,请检查代码错误${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 启动服务
|
||||
echo -e "${BLUE}🚀 启动所有微服务...${NC}"
|
||||
|
||||
local ports=(9000 9001 9002 9003 9004 9005 9006 9007)
|
||||
local i=0
|
||||
|
||||
for service in "${SERVICES[@]}"; do
|
||||
start_service "$service" "${ports[$i]}"
|
||||
sleep 3 # 给服务一些启动时间
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
# 等待所有服务启动
|
||||
sleep 10
|
||||
|
||||
# 显示状态
|
||||
show_status
|
||||
|
||||
# 开始监控
|
||||
monitor_changes
|
||||
}
|
||||
|
||||
# 检查参数
|
||||
case "${1:-}" in
|
||||
"status")
|
||||
show_status
|
||||
;;
|
||||
"stop")
|
||||
cleanup
|
||||
;;
|
||||
"logs")
|
||||
echo -e "${BLUE}📋 实时日志 (按 Ctrl+C 退出):${NC}"
|
||||
tail -f "$LOG_DIR"/*.log
|
||||
;;
|
||||
*)
|
||||
main
|
||||
;;
|
||||
esac
|
||||
@@ -1,129 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 情绪博物馆微服务开发启动脚本
|
||||
# 适用于本地开发环境,可以直接看到日志输出
|
||||
# 作者: emotion-museum
|
||||
# 日期: 2025-07-13
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
PURPLE='\033[0;35m'
|
||||
CYAN='\033[0;36m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}=========================================="
|
||||
echo -e "情绪博物馆微服务开发启动脚本"
|
||||
echo -e "适用于本地开发环境 - 实时日志输出"
|
||||
echo -e "==========================================${NC}"
|
||||
|
||||
# 检查Java环境
|
||||
if ! command -v java &> /dev/null; then
|
||||
echo -e "${RED}❌ 错误: 未找到Java环境,请安装JDK 17+${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 检查Maven环境
|
||||
if ! command -v mvn &> /dev/null; then
|
||||
echo -e "${RED}❌ 错误: 未找到Maven环境,请安装Maven 3.6+${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}✅ Java环境检查通过${NC}"
|
||||
echo -e "${GREEN}✅ Maven环境检查通过${NC}"
|
||||
|
||||
# 显示菜单
|
||||
show_menu() {
|
||||
echo ""
|
||||
echo -e "${CYAN}请选择要启动的服务:${NC}"
|
||||
echo -e "${YELLOW}1.${NC} 启动网关服务 (emotion-gateway:9000)"
|
||||
echo -e "${YELLOW}2.${NC} 启动用户服务 (emotion-user:9001)"
|
||||
echo -e "${YELLOW}3.${NC} 启动AI对话服务 (emotion-ai:9002)"
|
||||
echo -e "${YELLOW}4.${NC} 启动情绪记录服务 (emotion-record:9003)"
|
||||
echo -e "${YELLOW}5.${NC} 启动成长课题服务 (emotion-growth:9004)"
|
||||
echo -e "${YELLOW}6.${NC} 启动地图探索服务 (emotion-explore:9005)"
|
||||
echo -e "${YELLOW}7.${NC} 启动成就奖励服务 (emotion-reward:9006)"
|
||||
echo -e "${YELLOW}8.${NC} 启动统计分析服务 (emotion-stats:9007)"
|
||||
echo -e "${YELLOW}9.${NC} 编译所有项目"
|
||||
echo -e "${YELLOW}0.${NC} 退出"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# 编译项目
|
||||
compile_project() {
|
||||
echo -e "${BLUE}🔨 开始编译项目...${NC}"
|
||||
mvn clean compile -DskipTests
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}✅ 项目编译成功!${NC}"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED}❌ 项目编译失败!${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 启动单个服务
|
||||
start_service() {
|
||||
local service_name=$1
|
||||
local service_port=$2
|
||||
local service_desc=$3
|
||||
|
||||
echo -e "${BLUE}🚀 启动 ${service_desc} (${service_name}:${service_port})...${NC}"
|
||||
echo -e "${YELLOW}💡 提示: 按 Ctrl+C 停止服务${NC}"
|
||||
echo -e "${PURPLE}📋 日志输出开始:${NC}"
|
||||
echo "----------------------------------------"
|
||||
|
||||
cd $service_name
|
||||
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=$service_port"
|
||||
cd ..
|
||||
}
|
||||
|
||||
# 主循环
|
||||
while true; do
|
||||
show_menu
|
||||
read -p "请输入选择 (0-9): " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
start_service "emotion-gateway" 9000 "网关服务"
|
||||
;;
|
||||
2)
|
||||
start_service "emotion-user" 9001 "用户服务"
|
||||
;;
|
||||
3)
|
||||
start_service "emotion-ai" 9002 "AI对话服务"
|
||||
;;
|
||||
4)
|
||||
start_service "emotion-record" 9003 "情绪记录服务"
|
||||
;;
|
||||
5)
|
||||
start_service "emotion-growth" 9004 "成长课题服务"
|
||||
;;
|
||||
6)
|
||||
start_service "emotion-explore" 9005 "地图探索服务"
|
||||
;;
|
||||
7)
|
||||
start_service "emotion-reward" 9006 "成就奖励服务"
|
||||
;;
|
||||
8)
|
||||
start_service "emotion-stats" 9007 "统计分析服务"
|
||||
;;
|
||||
9)
|
||||
compile_project
|
||||
;;
|
||||
0)
|
||||
echo -e "${GREEN}👋 退出开发启动脚本${NC}"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo -e "${RED}❌ 无效选择,请输入 0-9${NC}"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo ""
|
||||
echo -e "${YELLOW}按任意键继续...${NC}"
|
||||
read -n 1
|
||||
done
|
||||
@@ -1,234 +0,0 @@
|
||||
# Emotion WebSocket 模块创建总结
|
||||
|
||||
## 概述
|
||||
|
||||
成功创建了独立的 `emotion-websocket` 微服务模块,用于实现WebSocket实时聊天功能,支持用户与AI的实时对话。
|
||||
|
||||
## 创建的文件结构
|
||||
|
||||
```
|
||||
backend/emotion-websocket/
|
||||
├── pom.xml # Maven配置文件
|
||||
├── Dockerfile # Docker构建文件
|
||||
├── README.md # 模块说明文档
|
||||
├── src/
|
||||
│ ├── main/
|
||||
│ │ ├── java/com/emotionmuseum/websocket/
|
||||
│ │ │ ├── WebsocketApplication.java # 主启动类
|
||||
│ │ │ ├── config/
|
||||
│ │ │ │ ├── WebSocketConfig.java # WebSocket配置
|
||||
│ │ │ │ └── AsyncConfig.java # 异步配置
|
||||
│ │ │ ├── controller/
|
||||
│ │ │ │ ├── ChatWebSocketController.java # WebSocket控制器
|
||||
│ │ │ │ └── WebSocketTestController.java # REST测试控制器
|
||||
│ │ │ ├── dto/
|
||||
│ │ │ │ ├── WebSocketMessage.java # WebSocket消息DTO
|
||||
│ │ │ │ └── ChatRequest.java # 聊天请求DTO
|
||||
│ │ │ ├── service/
|
||||
│ │ │ │ ├── ChatWebSocketService.java # WebSocket服务接口
|
||||
│ │ │ │ ├── AiChatService.java # AI聊天服务接口
|
||||
│ │ │ │ └── impl/
|
||||
│ │ │ │ ├── ChatWebSocketServiceImpl.java # WebSocket服务实现
|
||||
│ │ │ │ └── AiChatServiceImpl.java # AI聊天服务实现
|
||||
│ │ │ ├── manager/
|
||||
│ │ │ │ └── WebSocketSessionManager.java # 会话管理器
|
||||
│ │ │ ├── feign/
|
||||
│ │ │ │ └── AiServiceClient.java # AI服务Feign客户端
|
||||
│ │ │ └── listener/
|
||||
│ │ │ └── WebSocketEventListener.java # WebSocket事件监听器
|
||||
│ │ └── resources/
|
||||
│ │ ├── application.yml # 主配置文件
|
||||
│ │ ├── application-local.yml # 本地环境配置
|
||||
│ │ ├── bootstrap.yml # 启动配置
|
||||
│ │ └── static/
|
||||
│ │ └── websocket-test.html # WebSocket测试页面
|
||||
│ └── test/
|
||||
│ ├── java/com/emotionmuseum/websocket/
|
||||
│ │ └── WebSocketTestApplication.java # 测试类
|
||||
│ └── resources/
|
||||
│ └── application-test.yml # 测试环境配置
|
||||
```
|
||||
|
||||
## 主要功能特性
|
||||
|
||||
### 1. WebSocket实时通信
|
||||
- 基于STOMP协议的WebSocket通信
|
||||
- 支持SockJS降级处理
|
||||
- 实时双向消息传输
|
||||
|
||||
### 2. 消息类型支持
|
||||
- **TEXT**: 文本消息
|
||||
- **TYPING**: 正在输入状态
|
||||
- **SYSTEM**: 系统消息
|
||||
- **ERROR**: 错误消息
|
||||
- **HEARTBEAT**: 心跳检测
|
||||
- **CONNECTION**: 连接状态
|
||||
- **AI_THINKING**: AI思考中状态
|
||||
|
||||
### 3. 发送者类型
|
||||
- **USER**: 注册用户
|
||||
- **GUEST**: 游客用户
|
||||
- **AI**: AI系统
|
||||
- **SYSTEM**: 系统
|
||||
|
||||
### 4. 会话管理
|
||||
- 用户会话状态管理
|
||||
- 在线用户统计
|
||||
- 会话超时处理
|
||||
|
||||
### 5. AI集成
|
||||
- 通过Feign调用emotion-ai服务
|
||||
- 异步AI响应处理
|
||||
- AI回复消息分割发送
|
||||
|
||||
## 核心组件说明
|
||||
|
||||
### 1. WebSocketConfig
|
||||
- 配置STOMP消息代理
|
||||
- 设置WebSocket端点
|
||||
- 配置跨域访问策略
|
||||
|
||||
### 2. ChatWebSocketController
|
||||
- 处理WebSocket消息映射
|
||||
- 支持聊天消息发送
|
||||
- 处理用户连接/断开连接
|
||||
- 心跳检测处理
|
||||
|
||||
### 3. WebSocketSessionManager
|
||||
- 管理用户会话映射
|
||||
- 在线用户状态跟踪
|
||||
- 会话信息存储
|
||||
|
||||
### 4. ChatWebSocketService
|
||||
- WebSocket消息处理核心逻辑
|
||||
- 消息路由和分发
|
||||
- AI服务集成调用
|
||||
|
||||
### 5. AiServiceClient
|
||||
- 通过Feign调用emotion-ai服务
|
||||
- 支持用户聊天和游客聊天接口
|
||||
|
||||
## 配置说明
|
||||
|
||||
### 服务配置
|
||||
- **端口**: 19007
|
||||
- **服务名**: emotion-websocket
|
||||
- **WebSocket端点**: `/ws/chat`
|
||||
|
||||
### 消息端点
|
||||
- **发送消息**: `/app/chat.send`
|
||||
- **用户连接**: `/app/chat.connect`
|
||||
- **用户断开**: `/app/chat.disconnect`
|
||||
- **心跳检测**: `/app/chat.heartbeat`
|
||||
|
||||
### 订阅端点
|
||||
- **用户私有消息**: `/user/queue/messages`
|
||||
- **会话消息**: `/topic/conversation/{conversationId}`
|
||||
- **广播消息**: `/topic/broadcast`
|
||||
|
||||
## 依赖关系
|
||||
|
||||
### 内部依赖
|
||||
- `emotion-common`: 公共组件
|
||||
- `emotion-ai`: AI服务(通过Feign调用)
|
||||
|
||||
### 外部依赖
|
||||
- Spring Boot WebSocket
|
||||
- Spring Cloud Alibaba
|
||||
- Nacos服务发现
|
||||
- OpenFeign
|
||||
- MyBatis Plus
|
||||
- MySQL
|
||||
- Redis
|
||||
|
||||
## 启动方式
|
||||
|
||||
### 1. 单独启动
|
||||
```bash
|
||||
cd backend/emotion-websocket
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=local
|
||||
```
|
||||
|
||||
### 2. 统一启动脚本
|
||||
```bash
|
||||
cd backend
|
||||
./start-services.sh
|
||||
```
|
||||
|
||||
### 3. Docker启动
|
||||
```bash
|
||||
cd backend/emotion-websocket
|
||||
docker build -t emotion-websocket:1.0.0 .
|
||||
docker run -d -p 19007:19007 emotion-websocket:1.0.0
|
||||
```
|
||||
|
||||
## 测试方法
|
||||
|
||||
### 1. 内置测试页面
|
||||
访问: http://localhost:19007/websocket-test.html
|
||||
|
||||
### 2. REST API测试
|
||||
```bash
|
||||
# 发送测试消息
|
||||
curl -X POST "http://localhost:19007/websocket/send?userId=test-user&message=Hello"
|
||||
|
||||
# 查看在线用户
|
||||
curl -X GET "http://localhost:19007/websocket/online-users"
|
||||
```
|
||||
|
||||
### 3. JavaScript客户端测试
|
||||
使用SockJS和STOMP.js连接WebSocket端点进行测试
|
||||
|
||||
## 集成说明
|
||||
|
||||
### 1. 与emotion-ai服务集成
|
||||
- 通过Feign客户端调用AI服务
|
||||
- 支持异步AI响应处理
|
||||
- AI回复消息自动分割发送
|
||||
|
||||
### 2. 与前端集成
|
||||
- 提供标准的WebSocket接口
|
||||
- 支持SockJS降级处理
|
||||
- 完整的消息格式定义
|
||||
|
||||
### 3. 与网关集成
|
||||
- 通过emotion-gateway统一访问
|
||||
- 支持负载均衡
|
||||
- 统一的服务发现
|
||||
|
||||
## 监控和日志
|
||||
|
||||
### 健康检查
|
||||
- http://localhost:19007/actuator/health
|
||||
|
||||
### 指标监控
|
||||
- http://localhost:19007/actuator/metrics
|
||||
- http://localhost:19007/actuator/prometheus
|
||||
|
||||
### 日志配置
|
||||
- 日志文件: `logs/emotion-websocket.log`
|
||||
- 支持DEBUG级别的WebSocket调试日志
|
||||
|
||||
## 后续扩展建议
|
||||
|
||||
1. **消息持久化**: 将聊天消息存储到数据库
|
||||
2. **文件传输**: 支持图片、文件等多媒体消息
|
||||
3. **群聊功能**: 支持多用户群组聊天
|
||||
4. **消息加密**: 增加端到端消息加密
|
||||
5. **消息撤回**: 支持消息撤回功能
|
||||
6. **在线状态**: 更详细的用户在线状态管理
|
||||
7. **消息推送**: 集成推送服务支持离线消息推送
|
||||
|
||||
## 总结
|
||||
|
||||
成功创建了功能完整的WebSocket聊天微服务模块,具备以下优势:
|
||||
|
||||
- ✅ 独立的微服务架构
|
||||
- ✅ 完整的WebSocket实时通信功能
|
||||
- ✅ 与AI服务的无缝集成
|
||||
- ✅ 完善的会话管理机制
|
||||
- ✅ 丰富的消息类型支持
|
||||
- ✅ 良好的可扩展性和可维护性
|
||||
- ✅ 完整的测试和文档支持
|
||||
|
||||
该模块可以直接用于生产环境,为用户提供流畅的实时聊天体验。
|
||||
@@ -1 +0,0 @@
|
||||
target/emotion-ai-1.0.0.jar中没有主清单属性
|
||||
@@ -1 +0,0 @@
|
||||
63083
|
||||
@@ -1,102 +0,0 @@
|
||||
2025-07-16T09:03:31.799+08:00 WARN 20008 --- [ main] 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-16T09:03:31.889+08:00 WARN 20008 --- [ main] 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-16T09:03:32.194+08:00 WARN 20008 --- [ main] 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-16T09:03:32.196+08:00 INFO 20008 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [req-serv] nacos-server port:8848
|
||||
2025-07-16T09:03:32.196+08:00 INFO 20008 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [http-client] connect timeout:1000
|
||||
2025-07-16T09:03:32.198+08:00 INFO 20008 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : PER_TASK_CONFIG_SIZE: 3000.0
|
||||
2025-07-16T09:03:32.254+08:00 INFO 20008 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
2025-07-16T09:03:32.254+08:00 INFO 20008 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
2025-07-16T09:03:32.277+08:00 INFO 20008 --- [ main] c.a.n.c.a.r.identify.CredentialWatcher : null No credential found
|
||||
2025-07-16 09:03:32 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
:: Spring Boot :: (v3.0.2)
|
||||
|
||||
2025-07-16 09:03:32 [main] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of 90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x00000001342dba98
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x00000001342dbea8
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-16 09:03:32 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-16 09:03:32 [main] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-16 09:03:33 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752627813368_127.0.0.1_62143
|
||||
2025-07-16 09:03:33 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Notify connected event to listeners.
|
||||
2025-07-16 09:03:33 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Connected,notify listen context...
|
||||
2025-07-16 09:03:33 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-16 09:03:33 [main] INFO [com.alibaba.nacos.common.remote.client] - [90a9ad1e-7bf0-4f56-9d87-36c72dbc1d26_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000000013443efc8
|
||||
2025-07-16 09:03:33 [main] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-16 09:03:33 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:33 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:33 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai-local.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:33 [main] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-ai-local.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-ai.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-ai,DEFAULT_GROUP'}]
|
||||
2025-07-16 09:03:33 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-16 09:03:33 [main] INFO [com.emotionmuseum.ai.AiApplication] - The following 1 profile is active: "local"
|
||||
2025-07-16 09:03:34 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-16 09:03:34 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-16 09:03:34 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-16 09:03:34 [main] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=75ad894c-a831-3fef-8183-57bf629af884
|
||||
2025-07-16 09:03:35 [main] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 19002 (http)
|
||||
2025-07-16 09:03:35 [main] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-16 09:03:35 [main] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-16 09:03:35 [main] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-16 09:03:35 [main] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 1976 ms
|
||||
2025-07-16 09:03:35 [main] DEBUG [o.s.web.filter.ServerHttpObservationFilter] - Filter 'serverHttpObservationFilter' configured for use
|
||||
2025-07-16 09:03:36 [main] INFO [com.emotionmuseum.common.config.SnowflakeConfig] - 使用MAC地址生成的机器ID: 669
|
||||
2025-07-16 09:03:36 [main] INFO [com.emotionmuseum.common.config.SnowflakeConfig] - 雪花算法配置完成,使用机器ID: 669
|
||||
2025-07-16 09:03:36 [main] INFO [c.emotionmuseum.common.util.SnowflakeIdGenerator] - 雪花算法ID生成器初始化完成,机器ID: 669
|
||||
2025-07-16 09:03:36 [main] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor@422b8438'
|
||||
2025-07-16 09:03:36 [main] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-16 09:03:37 [main] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerAdapter] - ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice
|
||||
2025-07-16 09:03:37 [main] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - 25 mappings in 'requestMappingHandlerMapping'
|
||||
2025-07-16 09:03:37 [main] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
|
||||
2025-07-16 09:03:37 [main] DEBUG [o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver] - ControllerAdvice beans: 0 @ExceptionHandler, 1 ResponseBodyAdvice
|
||||
2025-07-16 09:03:38 [main] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 4 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-16 09:03:38 [main] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat started on port(s): 19002 (http) with context path ''
|
||||
2025-07-16 09:03:38 [main] INFO [com.emotionmuseum.ai.AiApplication] - Started AiApplication in 7.184 seconds (process running for 7.854)
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Initializing Servlet 'dispatcherServlet'
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected StandardServletMultipartResolver
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected AcceptHeaderLocaleResolver
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected FixedThemeResolver
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@eb62a4b
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected org.springframework.web.servlet.support.SessionFlashMapManager@323186f9
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Completed initialization in 3 ms
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - GET "/actuator/health", parameters={}
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Starting...
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [com.zaxxer.hikari.pool.HikariPool] - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@41120a95
|
||||
2025-07-16 09:03:58 [http-nio-19002-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Start completed.
|
||||
2025-07-16 09:03:59 [http-nio-19002-exec-1] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/vnd.spring-boot.actuator.v3+json', given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:03:59 [http-nio-19002-exec-1] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [org.springframework.boot.actuate.health.SystemHealth@5be85732]
|
||||
2025-07-16 09:03:59 [http-nio-19002-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Completed 200 OK
|
||||
2025-07-16 09:04:12 [http-nio-19002-exec-2] DEBUG [org.springframework.web.servlet.DispatcherServlet] - GET "/actuator/health", parameters={}
|
||||
2025-07-16 09:04:12 [http-nio-19002-exec-2] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/vnd.spring-boot.actuator.v3+json', given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:04:12 [http-nio-19002-exec-2] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [org.springframework.boot.actuate.health.SystemHealth@2065d61c]
|
||||
2025-07-16 09:04:12 [http-nio-19002-exec-2] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Completed 200 OK
|
||||
2025-07-16 09:04:31 [http-nio-19002-exec-4] DEBUG [org.springframework.web.servlet.DispatcherServlet] - GET "/ai/actuator/health", parameters={}
|
||||
2025-07-16 09:04:31 [http-nio-19002-exec-4] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [c.e.common.interceptor.UserContextInterceptor] - 设置用户上下文: userId=guest_1901232820, requestUri=/ai/actuator/health
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [o.s.w.servlet.resource.ResourceHttpRequestHandler] - Resource not found
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [c.e.common.interceptor.UserContextInterceptor] - 清除用户上下文: requestUri=/ai/actuator/health
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Completed 404 NOT_FOUND
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [org.springframework.web.servlet.DispatcherServlet] - "ERROR" dispatch for GET "/error", parameters={}
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/json', given [*/*] and supported [application/json, application/*+json]
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [{timestamp=Wed Jul 16 09:04:32 CST 2025, status=404, error=Not Found, path=/ai/actuator/health}]
|
||||
2025-07-16 09:04:32 [http-nio-19002-exec-4] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Exiting from "ERROR" dispatch, status 404
|
||||
2025-07-16 09:46:47 [Thread-1] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-16 09:46:47 [Thread-7] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-16 09:46:47 [Thread-7] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-16 09:46:47 [Thread-1] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
2025-07-16 09:46:48 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown initiated...
|
||||
2025-07-16 09:46:48 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown completed.
|
||||
@@ -1,98 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] --------------------< com.emotionmuseum:emotion-ai >--------------------
|
||||
[INFO] Building emotion-ai 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-ai >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-ai ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-ai ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-ai ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-ai/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-ai ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-ai <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-ai ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:44.867+08:00[0;39m [33m WARN[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:44.925+08:00[0;39m [33m WARN[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:44.952+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:45.125+08:00[0;39m [33m WARN[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:45.126+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:45.126+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:45.128+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:45.177+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:45.177+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:45.196+08:00[0;39m [32m INFO[0;39m [35m6918[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:45 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of 0ed45851-eb8a-42d7-b72e-31a045327a03_config-0
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012531c670
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012531caa0
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367545782_127.0.0.1_51238
|
||||
2025-07-13 08:45:45 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:45 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [0ed45851-eb8a-42d7-b72e-31a045327a03_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x00000001254a7778
|
||||
2025-07-13 08:45:45 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:46 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:46 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:46 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-ai-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-ai-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-ai.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-ai,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:46 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [com.emotionmuseum.ai.AiApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:45:46 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=856a198a-0f81-3510-808c-6303647be993
|
||||
2025-07-13 08:45:47 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9002 (http)
|
||||
2025-07-13 08:45:47 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:45:47 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:45:47 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:45:47 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 1428 ms
|
||||
2025-07-13 08:45:47 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor@35a5d991'
|
||||
2025-07-13 08:45:47 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:45:49 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:45:49 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 4 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:45:49 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat started on port(s): 9002 (http) with context path ''
|
||||
2025-07-13 08:45:49 [restartedMain] INFO [com.emotionmuseum.ai.AiApplication] - Started AiApplication in 4.676 seconds (process running for 5.147)
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Initializing Servlet 'dispatcherServlet'
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Completed initialization in 1 ms
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - EmotionAiHikariCP - Starting...
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [com.zaxxer.hikari.pool.HikariPool] - EmotionAiHikariCP - Added connection com.mysql.cj.jdbc.ConnectionImpl@56486bc4
|
||||
2025-07-13 08:45:49 [http-nio-9002-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - EmotionAiHikariCP - Start completed.
|
||||
2025-07-13 08:49:24 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:49:24 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:49:24 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:49:24 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
2025-07-13 08:49:24 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - EmotionAiHikariCP - Shutdown initiated...
|
||||
2025-07-13 08:49:24 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - EmotionAiHikariCP - Shutdown completed.
|
||||
@@ -1,120 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] -----------------< com.emotionmuseum:emotion-explore >------------------
|
||||
[INFO] Building emotion-explore 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-explore >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-explore ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-explore ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-explore ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-explore/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-explore ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-explore <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-explore ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:57.456+08:00[0;39m [33m WARN[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.542+08:00[0;39m [33m WARN[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.579+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:57.836+08:00[0;39m [33m WARN[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.839+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:57.839+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:57.841+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:57.909+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.909+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.936+08:00[0;39m [32m INFO[0;39m [35m7147[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of 519c9471-ef87-4204-a56c-74ff37fe3e86_config-0
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012b316a60
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012b316e90
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367558691_127.0.0.1_51338
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [519c9471-ef87-4204-a56c-74ff37fe3e86_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000000012b4a4d38
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-explore] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-explore.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-explore-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-explore-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-explore.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-explore,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.emotionmuseum.explore.ExploreApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:46:00 [restartedMain] WARN [org.mybatis.spring.mapper.ClassPathMapperScanner] - No MyBatis mapper was found in '[com.emotionmuseum.explore.mapper]' package. Please check your configuration.
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=e3b16e73-732b-3cd7-ba87-b0b05ca7eb72
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9005 (http)
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2135 ms
|
||||
2025-07-13 08:46:01 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-0} closing ...
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Stopping service [Tomcat]
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.a.logging.ConditionEvaluationReportLogger] -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-13 08:46:02 [restartedMain] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Web server failed to start. Port 9005 was already in use.
|
||||
|
||||
Action:
|
||||
|
||||
Identify and stop the process that's listening on port 9005 or configure this application to listen on another port.
|
||||
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:46:02 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD FAILURE
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 10.164 s
|
||||
[INFO] Finished at: 2025-07-13T08:46:03+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project emotion-explore: Process terminated with exit code: 1 -> [Help 1]
|
||||
[ERROR]
|
||||
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
||||
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
||||
[ERROR]
|
||||
[ERROR] For more information about the errors and possible solutions, please read the following articles:
|
||||
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
||||
@@ -1,93 +0,0 @@
|
||||
2025-07-16 09:03:40 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
:: Spring Boot :: (v3.0.2)
|
||||
|
||||
2025-07-16 09:03:40 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-16 09:03:40 [main] INFO [com.emotionmuseum.gateway.GatewayApplication] - Starting GatewayApplication using Java 21.0.7 with PID 20154 (/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/target/emotion-gateway-1.0.0.jar started by huazhongmin in /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway)
|
||||
2025-07-16 09:03:40 [main] DEBUG [com.emotionmuseum.gateway.GatewayApplication] - Running with Spring Boot v3.0.2, Spring v6.0.4
|
||||
2025-07-16 09:03:40 [main] INFO [com.emotionmuseum.gateway.GatewayApplication] - The following 1 profile is active: "local"
|
||||
2025-07-16 09:03:42 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-16 09:03:42 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-16 09:03:42 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 13 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-16 09:03:42 [main] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=4710d9c7-5e9d-353b-b960-5b878d180ffe
|
||||
2025-07-16 09:03:42 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-16 09:03:42 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-16 09:03:42 [main] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-16 09:03:44 [main] DEBUG [o.s.cloud.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-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [After]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Before]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Between]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Cookie]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Header]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Host]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Method]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Path]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Query]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [ReadBody]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [RemoteAddr]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [XForwardedRemoteAddr]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Weight]
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [CloudFoundryRouteService]
|
||||
2025-07-16 09:03:44 [main] INFO [c.a.c.s.gateway.scg.SentinelSCGAutoConfiguration] - [Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: -2147483648
|
||||
2025-07-16 09:03:44 [main] DEBUG [o.s.web.reactive.handler.SimpleUrlHandlerMapping] - Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
|
||||
2025-07-16 09:03:44 [main] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 2 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-16 09:03:44 [main] DEBUG [o.s.w.r.r.m.annotation.ControllerMethodResolver] - ControllerAdvice beans: none
|
||||
2025-07-16 09:03:44 [main] INFO [c.a.c.s.gateway.scg.SentinelSCGAutoConfiguration] - [Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler
|
||||
2025-07-16 09:03:44 [main] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - enableLoggingRequestDetails='false': form data and headers will be masked to prevent unsafe logging of potentially sensitive data
|
||||
2025-07-16 09:03:44 [main] WARN [o.s.c.l.c.LoadBalancerCacheAutoConfiguration$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-16 09:03:45 [main] INFO [o.s.boot.web.embedded.netty.NettyWebServer] - Netty started on port 19000
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-user-route applying {_genkey_0=/user/**} to Path
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-user-route applying filter {_genkey_0=0} to StripPrefix
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-user-route
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-captcha-route applying {_genkey_0=/captcha/**} to Path
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-captcha-route applying filter {_genkey_0=0} to StripPrefix
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-captcha-route
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-oauth-route applying {_genkey_0=/oauth/**} to Path
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-oauth-route applying filter {_genkey_0=0} to StripPrefix
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-oauth-route
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-ai-route applying {_genkey_0=/ai/**} to Path
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-ai-route applying filter {_genkey_0=0} to StripPrefix
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-ai-route
|
||||
2025-07-16 09:03:45 [main] DEBUG [o.s.cloud.gateway.filter.GatewayMetricsFilter] - New routes count: 4
|
||||
2025-07-16 09:03:45 [main] INFO [com.emotionmuseum.gateway.GatewayApplication] - Started GatewayApplication in 5.105 seconds (process running for 5.704)
|
||||
2025-07-16 09:03:59 [reactor-http-nio-2] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [42be3651-1] HTTP GET "/actuator/health"
|
||||
INFO: Sentinel log output type is: file
|
||||
INFO: Sentinel log charset is: utf-8
|
||||
INFO: Sentinel log base directory is: /Users/huazhongmin/logs/csp/
|
||||
INFO: Sentinel log name use pid is: false
|
||||
INFO: Sentinel log level is: INFO
|
||||
2025-07-16 09:03:59 [lettuce-nioEventLoop-5-1] DEBUG [o.s.w.r.r.m.annotation.ResponseEntityResultHandler] - [42be3651-1] Using 'application/vnd.spring-boot.actuator.v3+json' given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:03:59 [lettuce-nioEventLoop-5-1] DEBUG [o.s.w.r.r.m.annotation.ResponseEntityResultHandler] - [42be3651-1] 0..1 [org.springframework.boot.actuate.health.SystemHealth]
|
||||
2025-07-16 09:03:59 [lettuce-nioEventLoop-5-1] DEBUG [org.springframework.web.HttpLogging] - [42be3651-1] Encoding [org.springframework.boot.actuate.health.SystemHealth@6fdce5a3]
|
||||
2025-07-16 09:03:59 [reactor-http-nio-2] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [42be3651-1] Completed 200 OK
|
||||
2025-07-16 09:04:12 [reactor-http-nio-3] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [127c1f50-2] HTTP GET "/actuator/health"
|
||||
2025-07-16 09:04:12 [lettuce-nioEventLoop-5-1] DEBUG [o.s.w.r.r.m.annotation.ResponseEntityResultHandler] - [127c1f50-2] Using 'application/vnd.spring-boot.actuator.v3+json' given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:04:12 [lettuce-nioEventLoop-5-1] DEBUG [o.s.w.r.r.m.annotation.ResponseEntityResultHandler] - [127c1f50-2] 0..1 [org.springframework.boot.actuate.health.SystemHealth]
|
||||
2025-07-16 09:04:12 [lettuce-nioEventLoop-5-1] DEBUG [org.springframework.web.HttpLogging] - [127c1f50-2] Encoding [org.springframework.boot.actuate.health.SystemHealth@3fb8c67f]
|
||||
2025-07-16 09:04:12 [reactor-http-nio-3] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [127c1f50-2] Completed 200 OK
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [7b8bca8e-3] HTTP GET "/user/actuator/health"
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - Route matched: emotion-user-route
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - Mapping [Exchange: GET http://localhost:19000/user/actuator/health] to Route{id='emotion-user-route', uri=http://localhost:19001, order=0, predicate=Paths: [/user/**], match trailing slash: true, gatewayFilters=[[[StripPrefix parts = 0], order = 1]], metadata={}}
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - [7b8bca8e-3] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@373b5ee9
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.cloud.gateway.handler.FilteringWebHandler] - Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@451f87af}, order = -2147483648], [GatewayFilterAdapter{delegate=com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter@3051e0b2}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@4dafba3e}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@287f7811}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@17271176}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@2e34384c}, order = 0], [[StripPrefix parts = 0], order = 1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2b556bb2}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@57b75756}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.LoadBalancerServiceInstanceCookieFilter@5327a06e}, order = 10151], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@2e3cdec2}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@2679311f}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@44cb460e}, order = 2147483647]]
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.g.f.h.o.ObservedRequestHttpHeadersFilter] - Will instrument the HTTP request headers [Host:"localhost:19000", User-Agent:"curl/8.7.1", Accept:"*/*", Forwarded:"proto=http;host="localhost:19000";for="[0:0:0:0:0:0:0:1]:62291"", X-Forwarded-For:"0:0:0:0:0:0:0:1", X-Forwarded-Proto:"http", X-Forwarded-Port:"19000", X-Forwarded-Host:"localhost:19000"]
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.g.f.h.o.ObservedRequestHttpHeadersFilter] - Client observation {name=http.client.requests(null), error=null, context=name='http.client.requests', contextualName='null', error='null', lowCardinalityKeyValues=[http.method='GET', http.status_code='UNKNOWN', spring.cloud.gateway.route.id='emotion-user-route', spring.cloud.gateway.route.uri='http://localhost:19001'], highCardinalityKeyValues=[http.uri='http://localhost:19000/user/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@4443fec4', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=4.93244E-4, duration(nanos)=493244.0, startTimeNanos=302639138304957}'], parentObservation={name=http.server.requests(null), error=null, context=name='http.server.requests', contextualName='null', error='null', lowCardinalityKeyValues=[exception='none', method='GET', outcome='SUCCESS', status='200', uri='UNKNOWN'], highCardinalityKeyValues=[http.url='/user/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@62ceb8d8', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.131310068, duration(nanos)=1.31310068E8, startTimeNanos=302639007609097}'], parentObservation=null}} created for the request. New headers are [Host:"localhost:19000", User-Agent:"curl/8.7.1", Accept:"*/*", Forwarded:"proto=http;host="localhost:19000";for="[0:0:0:0:0:0:0:1]:62291"", X-Forwarded-For:"0:0:0:0:0:0:0:1", X-Forwarded-Proto:"http", X-Forwarded-Port:"19000", X-Forwarded-Host:"localhost:19000"]
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.g.f.h.o.ObservedResponseHttpHeadersFilter] - Will instrument the response
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.c.g.f.h.o.ObservedResponseHttpHeadersFilter] - The response was handled for observation {name=http.client.requests(null), error=null, context=name='http.client.requests', contextualName='null', error='null', lowCardinalityKeyValues=[http.method='GET', http.status_code='UNKNOWN', spring.cloud.gateway.route.id='emotion-user-route', spring.cloud.gateway.route.uri='http://localhost:19001'], highCardinalityKeyValues=[http.uri='http://localhost:19000/user/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@4443fec4', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.078344915, duration(nanos)=7.8344915E7, startTimeNanos=302639138304957}'], parentObservation={name=http.server.requests(null), error=null, context=name='http.server.requests', contextualName='null', error='null', lowCardinalityKeyValues=[exception='none', method='GET', outcome='SUCCESS', status='200', uri='UNKNOWN'], highCardinalityKeyValues=[http.url='/user/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@62ceb8d8', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.209234105, duration(nanos)=2.09234105E8, startTimeNanos=302639007609097}'], parentObservation=null}}
|
||||
2025-07-16 09:04:22 [reactor-http-nio-4] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [7b8bca8e-3] Completed 403 FORBIDDEN
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [37305ece-4] HTTP GET "/ai/actuator/health"
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - Route matched: emotion-ai-route
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - Mapping [Exchange: GET http://localhost:19000/ai/actuator/health] to Route{id='emotion-ai-route', uri=http://localhost:19002, order=0, predicate=Paths: [/ai/**], match trailing slash: true, gatewayFilters=[[[StripPrefix parts = 0], order = 1]], metadata={}}
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.c.gateway.handler.RoutePredicateHandlerMapping] - [37305ece-4] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@373b5ee9
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.cloud.gateway.handler.FilteringWebHandler] - Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@451f87af}, order = -2147483648], [GatewayFilterAdapter{delegate=com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter@3051e0b2}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@4dafba3e}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@287f7811}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@17271176}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@2e34384c}, order = 0], [[StripPrefix parts = 0], order = 1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@2b556bb2}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter@57b75756}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.LoadBalancerServiceInstanceCookieFilter@5327a06e}, order = 10151], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@2e3cdec2}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@2679311f}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@44cb460e}, order = 2147483647]]
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.c.g.f.h.o.ObservedRequestHttpHeadersFilter] - Will instrument the HTTP request headers [Host:"localhost:19000", User-Agent:"curl/8.7.1", Accept:"*/*", Forwarded:"proto=http;host="localhost:19000";for="[0:0:0:0:0:0:0:1]:62323"", X-Forwarded-For:"0:0:0:0:0:0:0:1", X-Forwarded-Proto:"http", X-Forwarded-Port:"19000", X-Forwarded-Host:"localhost:19000"]
|
||||
2025-07-16 09:04:31 [reactor-http-nio-5] DEBUG [o.s.c.g.f.h.o.ObservedRequestHttpHeadersFilter] - Client observation {name=http.client.requests(null), error=null, context=name='http.client.requests', contextualName='null', error='null', lowCardinalityKeyValues=[http.method='GET', http.status_code='UNKNOWN', spring.cloud.gateway.route.id='emotion-ai-route', spring.cloud.gateway.route.uri='http://localhost:19002'], highCardinalityKeyValues=[http.uri='http://localhost:19000/ai/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@14138b12', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=1.69279E-4, duration(nanos)=169279.0, startTimeNanos=302648957485505}'], parentObservation={name=http.server.requests(null), error=null, context=name='http.server.requests', contextualName='null', error='null', lowCardinalityKeyValues=[exception='none', method='GET', outcome='SUCCESS', status='200', uri='UNKNOWN'], highCardinalityKeyValues=[http.url='/ai/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@3973cc2a', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.003046764, duration(nanos)=3046764.0, startTimeNanos=302648954707166}'], parentObservation=null}} created for the request. New headers are [Host:"localhost:19000", User-Agent:"curl/8.7.1", Accept:"*/*", Forwarded:"proto=http;host="localhost:19000";for="[0:0:0:0:0:0:0:1]:62323"", X-Forwarded-For:"0:0:0:0:0:0:0:1", X-Forwarded-Proto:"http", X-Forwarded-Port:"19000", X-Forwarded-Host:"localhost:19000"]
|
||||
2025-07-16 09:04:32 [reactor-http-nio-5] DEBUG [o.s.c.g.f.h.o.ObservedResponseHttpHeadersFilter] - Will instrument the response
|
||||
2025-07-16 09:04:32 [reactor-http-nio-5] DEBUG [o.s.c.g.f.h.o.ObservedResponseHttpHeadersFilter] - The response was handled for observation {name=http.client.requests(null), error=null, context=name='http.client.requests', contextualName='null', error='null', lowCardinalityKeyValues=[http.method='GET', http.status_code='UNKNOWN', spring.cloud.gateway.route.id='emotion-ai-route', spring.cloud.gateway.route.uri='http://localhost:19002'], highCardinalityKeyValues=[http.uri='http://localhost:19000/ai/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@14138b12', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.078077624, duration(nanos)=7.8077624E7, startTimeNanos=302648957485505}'], parentObservation={name=http.server.requests(null), error=null, context=name='http.server.requests', contextualName='null', error='null', lowCardinalityKeyValues=[exception='none', method='GET', outcome='SUCCESS', status='200', uri='UNKNOWN'], highCardinalityKeyValues=[http.url='/ai/actuator/health'], map=[class io.micrometer.core.instrument.Timer$Sample='io.micrometer.core.instrument.Timer$Sample@3973cc2a', class io.micrometer.core.instrument.LongTaskTimer$Sample='SampleImpl{duration(seconds)=0.080973745, duration(nanos)=8.0973745E7, startTimeNanos=302648954707166}'], parentObservation=null}}
|
||||
2025-07-16 09:04:32 [reactor-http-nio-5] DEBUG [o.s.web.server.adapter.HttpWebHandlerAdapter] - [37305ece-4] Completed 404 NOT_FOUND
|
||||
@@ -1,98 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] -----------------< com.emotionmuseum:emotion-gateway >------------------
|
||||
[INFO] Building emotion-gateway 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-gateway >>>
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-gateway ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-gateway ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-gateway ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-gateway ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-gateway <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-gateway ---
|
||||
[INFO] Attaching agents: []
|
||||
2025-07-13 08:45:28 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:28 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:28 [restartedMain] INFO [com.emotionmuseum.gateway.GatewayApplication] - Starting GatewayApplication using Java 23.0.2 with PID 6683 (/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/target/classes started by huazhongmin in /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway)
|
||||
2025-07-13 08:45:28 [restartedMain] DEBUG [com.emotionmuseum.gateway.GatewayApplication] - Running with Spring Boot v3.0.2, Spring v6.0.4
|
||||
2025-07-13 08:45:28 [restartedMain] INFO [com.emotionmuseum.gateway.GatewayApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:28 [restartedMain] INFO [o.s.b.d.env.DevToolsPropertyDefaultsPostProcessor] - Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2025-07-13 08:45:28 [restartedMain] INFO [o.s.b.d.env.DevToolsPropertyDefaultsPostProcessor] - For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2025-07-13 08:45:29 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:29 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:29 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 9 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:45:29 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=52e78852-b349-32d3-9f4b-547073a85453
|
||||
2025-07-13 08:45:29 [restartedMain] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-13 08:45:29 [restartedMain] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-13 08:45:29 [restartedMain] INFO [o.s.c.s.PostProcessorRegistrationDelegate$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-13 08:45:30 [restartedMain] DEBUG [o.s.cloud.gateway.config.GatewayProperties] - Routes supplied from Gateway Properties: [RouteDefinition{id='emotion-user', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/user/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-user, order=0, metadata={}}, RouteDefinition{id='emotion-ai', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/ai/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-ai, order=0, metadata={}}, RouteDefinition{id='emotion-record', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/record/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-record, order=0, metadata={}}, RouteDefinition{id='emotion-growth', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/growth/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-growth, order=0, metadata={}}, RouteDefinition{id='emotion-explore', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/explore/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-explore, order=0, metadata={}}, RouteDefinition{id='emotion-reward', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/reward/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-reward, order=0, metadata={}}, RouteDefinition{id='emotion-stats', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/stats/**}}], filters=[FilterDefinition{name='StripPrefix', args={_genkey_0=2}}], uri=lb://emotion-stats, order=0, metadata={}}]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [After]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Before]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Between]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Cookie]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Header]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Host]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Method]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Path]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Query]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [ReadBody]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [RemoteAddr]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [XForwardedRemoteAddr]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [Weight]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [o.s.c.gateway.route.RouteDefinitionRouteLocator] - Loaded RoutePredicateFactory [CloudFoundryRouteService]
|
||||
2025-07-13 08:45:30 [restartedMain] INFO [c.a.c.s.gateway.scg.SentinelSCGAutoConfiguration] - [Sentinel SpringCloudGateway] register SentinelGatewayFilter with order: -2147483648
|
||||
2025-07-13 08:45:31 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 2 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:45:31 [restartedMain] INFO [c.a.c.s.gateway.scg.SentinelSCGAutoConfiguration] - [Sentinel SpringCloudGateway] register SentinelGatewayBlockExceptionHandler
|
||||
2025-07-13 08:45:31 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:45:31 [restartedMain] WARN [o.s.c.l.c.LoadBalancerCacheAutoConfiguration$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-13 08:45:31 [restartedMain] INFO [o.s.boot.web.embedded.netty.NettyWebServer] - Netty started on port 9000
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-user applying {_genkey_0=/api/user/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-user applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-user
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-ai applying {_genkey_0=/api/ai/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-ai applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-ai
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-record applying {_genkey_0=/api/record/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-record applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-record
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-growth applying {_genkey_0=/api/growth/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-growth applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-growth
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-explore applying {_genkey_0=/api/explore/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-explore applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-explore
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-reward applying {_genkey_0=/api/reward/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-reward applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-reward
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-stats applying {_genkey_0=/api/stats/**} to Path
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition emotion-stats applying filter {_genkey_0=2} to StripPrefix
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.c.gateway.route.RouteDefinitionRouteLocator] - RouteDefinition matched: emotion-stats
|
||||
2025-07-13 08:45:31 [restartedMain] DEBUG [o.s.cloud.gateway.filter.GatewayMetricsFilter] - New routes count: 7
|
||||
2025-07-13 08:45:31 [restartedMain] INFO [com.emotionmuseum.gateway.GatewayApplication] - Started GatewayApplication in 3.673 seconds (process running for 4.132)
|
||||
INFO: Sentinel log output type is: file
|
||||
INFO: Sentinel log charset is: utf-8
|
||||
INFO: Sentinel log base directory is: /Users/huazhongmin/logs/csp/
|
||||
INFO: Sentinel log name use pid is: false
|
||||
INFO: Sentinel log level is: INFO
|
||||
@@ -1,121 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] ------------------< com.emotionmuseum:emotion-growth >------------------
|
||||
[INFO] Building emotion-growth 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-growth >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-growth ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-growth ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-growth ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-growth/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-growth ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-growth <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-growth ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:56.958+08:00[0;39m [33m WARN[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.046+08:00[0;39m [33m WARN[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.085+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:57.400+08:00[0;39m [33m WARN[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.403+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:57.403+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:57.406+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:57.468+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.468+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.498+08:00[0;39m [32m INFO[0;39m [35m7144[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:57 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x00000001263173d8
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x0000000126317808
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367558311_127.0.0.1_51335
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [ae27a187-bd28-4e55-8e9f-a546efcdb1c0_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x00000001264a5490
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-growth] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-growth.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-growth-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-growth-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-growth.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-growth,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.emotionmuseum.growth.GrowthApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [org.mybatis.spring.mapper.ClassPathMapperScanner] - No MyBatis mapper was found in '[com.emotionmuseum.growth.mapper]' package. Please check your configuration.
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=4182ccb9-28af-3c79-b715-9374e44c89a7
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9004 (http)
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2103 ms
|
||||
2025-07-13 08:46:01 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-0} closing ...
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Stopping service [Tomcat]
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.a.logging.ConditionEvaluationReportLogger] -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-13 08:46:02 [restartedMain] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Web server failed to start. Port 9004 was already in use.
|
||||
|
||||
Action:
|
||||
|
||||
Identify and stop the process that's listening on port 9004 or configure this application to listen on another port.
|
||||
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:46:02 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:46:02 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD FAILURE
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 10.247 s
|
||||
[INFO] Finished at: 2025-07-13T08:46:02+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project emotion-growth: Process terminated with exit code: 1 -> [Help 1]
|
||||
[ERROR]
|
||||
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
||||
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
||||
[ERROR]
|
||||
[ERROR] For more information about the errors and possible solutions, please read the following articles:
|
||||
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
||||
@@ -1,121 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] ------------------< com.emotionmuseum:emotion-record >------------------
|
||||
[INFO] Building emotion-record 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-record >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-record ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-record ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-record ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-record/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-record ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-record <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-record ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:56.926+08:00[0;39m [33m WARN[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.023+08:00[0;39m [33m WARN[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.063+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:57.373+08:00[0;39m [33m WARN[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.376+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:57.376+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:57.381+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:57.454+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.454+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:57.484+08:00[0;39m [32m INFO[0;39m [35m7142[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:57 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of b1838b09-f01b-45ad-907d-017e3278f9aa_config-0
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x0000000133317378
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x00000001333177a8
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:57 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367558310_127.0.0.1_51334
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:58 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [b1838b09-f01b-45ad-907d-017e3278f9aa_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x00000001334a4d38
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-record] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-record.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-record-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-record-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-record.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-record,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.emotionmuseum.record.RecordApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 9 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [org.mybatis.spring.mapper.ClassPathMapperScanner] - No MyBatis mapper was found in '[com.emotionmuseum.record.mapper]' package. Please check your configuration.
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=5c2334fc-7543-34b7-9dd6-173e5c1ad22d
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9003 (http)
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2100 ms
|
||||
2025-07-13 08:46:01 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-0} closing ...
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Stopping service [Tomcat]
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.a.logging.ConditionEvaluationReportLogger] -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-13 08:46:02 [restartedMain] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Web server failed to start. Port 9003 was already in use.
|
||||
|
||||
Action:
|
||||
|
||||
Identify and stop the process that's listening on port 9003 or configure this application to listen on another port.
|
||||
|
||||
2025-07-13 08:46:02 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:46:02 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:46:02 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD FAILURE
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 10.743 s
|
||||
[INFO] Finished at: 2025-07-13T08:46:02+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project emotion-record: Process terminated with exit code: 1 -> [Help 1]
|
||||
[ERROR]
|
||||
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
||||
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
||||
[ERROR]
|
||||
[ERROR] For more information about the errors and possible solutions, please read the following articles:
|
||||
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
||||
@@ -1,121 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] ------------------< com.emotionmuseum:emotion-reward >------------------
|
||||
[INFO] Building emotion-reward 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-reward >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-reward ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-reward ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-reward ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-reward/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-reward ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-reward <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-reward ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:57.848+08:00[0;39m [33m WARN[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.929+08:00[0;39m [33m WARN[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:57.960+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:58.176+08:00[0;39m [33m WARN[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:58.177+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:58.177+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:58.179+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:58.235+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:58.235+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:58.262+08:00[0;39m [32m INFO[0;39m [35m7150[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x0000000126316a60
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x0000000126316e90
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367559041_127.0.0.1_51343
|
||||
2025-07-13 08:45:59 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:59 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [e6c044c5-b7c5-4811-8b89-760db0f4f9ae_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x00000001264a4d38
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-reward] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-reward.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-reward-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-reward-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-reward.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-reward,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.emotionmuseum.reward.RewardApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 9 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:46:00 [restartedMain] WARN [org.mybatis.spring.mapper.ClassPathMapperScanner] - No MyBatis mapper was found in '[com.emotionmuseum.reward.mapper]' package. Please check your configuration.
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=2ebf993f-e9df-3362-92a0-57f648eeab93
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9006 (http)
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2137 ms
|
||||
2025-07-13 08:46:02 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-0} closing ...
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Stopping service [Tomcat]
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.a.logging.ConditionEvaluationReportLogger] -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-13 08:46:02 [restartedMain] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Web server failed to start. Port 9006 was already in use.
|
||||
|
||||
Action:
|
||||
|
||||
Identify and stop the process that's listening on port 9006 or configure this application to listen on another port.
|
||||
|
||||
2025-07-13 08:46:03 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:46:03 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:46:03 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:46:03 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD FAILURE
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 9.965 s
|
||||
[INFO] Finished at: 2025-07-13T08:46:03+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project emotion-reward: Process terminated with exit code: 1 -> [Help 1]
|
||||
[ERROR]
|
||||
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
||||
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
||||
[ERROR]
|
||||
[ERROR] For more information about the errors and possible solutions, please read the following articles:
|
||||
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
||||
@@ -1,121 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] ------------------< com.emotionmuseum:emotion-stats >-------------------
|
||||
[INFO] Building emotion-stats 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-stats >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-stats ---
|
||||
[INFO] Copying 1 resource from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-stats ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-stats ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-stats/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-stats ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-stats <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-stats ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:58.270+08:00[0;39m [33m WARN[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:58.356+08:00[0;39m [33m WARN[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:58.403+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:58.635+08:00[0;39m [33m WARN[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:58.637+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:58.637+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:58.638+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:58.691+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:58.691+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:58.712+08:00[0;39m [32m INFO[0;39m [35m7167[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:58 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of 51a04bce-977d-489e-ba5c-8147a68680fb_config-0
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012d31bc18
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012d31c048
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:58 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367559501_127.0.0.1_51348
|
||||
2025-07-13 08:45:59 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:59 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [51a04bce-977d-489e-ba5c-8147a68680fb_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000000012d4a7d30
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-stats] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-stats.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-stats-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-stats-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-stats.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-stats,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:59 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:59 [restartedMain] INFO [com.emotionmuseum.stats.StatsApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:46:00 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:46:01 [restartedMain] WARN [org.mybatis.spring.mapper.ClassPathMapperScanner] - No MyBatis mapper was found in '[com.emotionmuseum.stats.mapper]' package. Please check your configuration.
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=af125b37-688d-3aab-bf37-e7a7060f4920
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9007 (http)
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:46:01 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2077 ms
|
||||
2025-07-13 08:46:02 [restartedMain] DEBUG [c.b.m.e.spring.MybatisSqlSessionFactoryBean] - Property 'mapperLocations' was not specified.
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:46:02 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:46:02 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:46:03 [restartedMain] WARN [o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
|
||||
2025-07-13 08:46:03 [restartedMain] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-0} closing ...
|
||||
2025-07-13 08:46:03 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Stopping service [Tomcat]
|
||||
2025-07-13 08:46:03 [restartedMain] INFO [o.s.b.a.logging.ConditionEvaluationReportLogger] -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-13 08:46:03 [restartedMain] ERROR [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
Web server failed to start. Port 9007 was already in use.
|
||||
|
||||
Action:
|
||||
|
||||
Identify and stop the process that's listening on port 9007 or configure this application to listen on another port.
|
||||
|
||||
2025-07-13 08:46:03 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:46:03 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:46:03 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:46:03 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD FAILURE
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 9.734 s
|
||||
[INFO] Finished at: 2025-07-13T08:46:03+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.2:run (default-cli) on project emotion-stats: Process terminated with exit code: 1 -> [Help 1]
|
||||
[ERROR]
|
||||
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
||||
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
||||
[ERROR]
|
||||
[ERROR] For more information about the errors and possible solutions, please read the following articles:
|
||||
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
||||
@@ -1,125 +0,0 @@
|
||||
2025-07-16T09:03:18.888+08:00 WARN 19784 --- [ main] 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-16T09:03:18.983+08:00 WARN 19784 --- [ main] 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-16T09:03:19.261+08:00 WARN 19784 --- [ main] 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-16T09:03:19.262+08:00 INFO 19784 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [req-serv] nacos-server port:8848
|
||||
2025-07-16T09:03:19.263+08:00 INFO 19784 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : [settings] [http-client] connect timeout:1000
|
||||
2025-07-16T09:03:19.265+08:00 INFO 19784 --- [ main] c.alibaba.nacos.client.utils.ParamUtil : PER_TASK_CONFIG_SIZE: 3000.0
|
||||
2025-07-16T09:03:19.321+08:00 INFO 19784 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
2025-07-16T09:03:19.321+08:00 INFO 19784 --- [ main] c.a.n.p.a.s.c.ClientAuthPluginManager : [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
2025-07-16T09:03:19.345+08:00 INFO 19784 --- [ main] c.a.n.c.a.r.identify.CredentialWatcher : null No credential found
|
||||
2025-07-16 09:03:19 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
:: Spring Boot :: (v3.0.2)
|
||||
|
||||
2025-07-16 09:03:19 [main] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of 745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000013d2dc530
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000013d2dc940
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-16 09:03:19 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-16 09:03:19 [main] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-16 09:03:20 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752627800162_127.0.0.1_62095
|
||||
2025-07-16 09:03:20 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Notify connected event to listeners.
|
||||
2025-07-16 09:03:20 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Connected,notify listen context...
|
||||
2025-07-16 09:03:20 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-16 09:03:20 [main] INFO [com.alibaba.nacos.common.remote.client] - [745c3cf4-7cb2-4ac6-a11a-86fd37de7293_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000000013d43f118
|
||||
2025-07-16 09:03:20 [main] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-16 09:03:20 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:20 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:20 [main] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user-local.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-16 09:03:20 [main] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-user-local.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-user.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-user,DEFAULT_GROUP'}]
|
||||
2025-07-16 09:03:20 [main] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-16 09:03:20 [main] INFO [com.emotionmuseum.user.UserApplication] - The following 1 profile is active: "local"
|
||||
2025-07-16 09:03:21 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-16 09:03:21 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-16 09:03:21 [main] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 12 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-16 09:03:21 [main] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=2c694ed0-114c-30e6-aed7-dcee6bca36f0
|
||||
2025-07-16 09:03:22 [main] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 19001 (http)
|
||||
2025-07-16 09:03:22 [main] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-16 09:03:22 [main] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-16 09:03:22 [main] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-16 09:03:22 [main] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 2214 ms
|
||||
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
|
||||
2025-07-16 09:03:23 [main] INFO [com.emotionmuseum.common.config.SnowflakeConfig] - 使用MAC地址生成的机器ID: 669
|
||||
2025-07-16 09:03:23 [main] INFO [com.emotionmuseum.common.config.SnowflakeConfig] - 雪花算法配置完成,使用机器ID: 669
|
||||
2025-07-16 09:03:23 [main] INFO [c.emotionmuseum.common.util.SnowflakeIdGenerator] - 雪花算法ID生成器初始化完成,机器ID: 669
|
||||
Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor@76889e60'
|
||||
Parsed mapper file: 'URL [jar:file:/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-user/target/emotion-user-1.0.0.jar!/BOOT-INF/classes!/mapper/UserMapper.xml]'
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-16 09:03:24 [main] DEBUG [c.e.user.security.JwtAuthenticationFilter] - Filter 'jwtAuthenticationFilter' configured for use
|
||||
2025-07-16 09:03:24 [main] DEBUG [o.s.web.filter.ServerHttpObservationFilter] - Filter 'serverHttpObservationFilter' configured for use
|
||||
2025-07-16 09:03:24 [main] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - 19 mappings in 'requestMappingHandlerMapping'
|
||||
2025-07-16 09:03:24 [main] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
|
||||
2025-07-16 09:03:25 [main] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-16 09:03:25 [main] INFO [o.s.security.web.DefaultSecurityFilterChain] - Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@6993c8df, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@57545c3f, org.springframework.security.web.context.SecurityContextHolderFilter@64920dc2, org.springframework.security.web.header.HeaderWriterFilter@794366a5, org.springframework.web.filter.CorsFilter@326e0b8e, org.springframework.security.web.authentication.logout.LogoutFilter@30839e44, com.emotionmuseum.user.security.JwtAuthenticationFilter@434514d8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@493ac8d3, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@13dbed9e, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@36baa049, org.springframework.security.web.session.SessionManagementFilter@1ee47d9e, org.springframework.security.web.access.ExceptionTranslationFilter@3f36e8d1, org.springframework.security.web.access.intercept.AuthorizationFilter@7978e022]
|
||||
2025-07-16 09:03:25 [main] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerAdapter] - ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice
|
||||
2025-07-16 09:03:25 [main] DEBUG [o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver] - ControllerAdvice beans: 0 @ExceptionHandler, 1 ResponseBodyAdvice
|
||||
2025-07-16 09:03:25 [main] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat started on port(s): 19001 (http) with context path ''
|
||||
2025-07-16 09:03:25 [main] INFO [com.emotionmuseum.user.UserApplication] - Started UserApplication in 7.27 seconds (process running for 7.838)
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Initializing Servlet 'dispatcherServlet'
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected StandardServletMultipartResolver
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected AcceptHeaderLocaleResolver
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected FixedThemeResolver
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@5e240cb6
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Detected org.springframework.web.servlet.support.SessionFlashMapManager@2e21a5d9
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Completed initialization in 2 ms
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - GET "/actuator/health", parameters={}
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Starting...
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [com.zaxxer.hikari.pool.HikariPool] - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1703fbc9
|
||||
2025-07-16 09:03:57 [http-nio-19001-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Start completed.
|
||||
2025-07-16 09:03:58 [http-nio-19001-exec-1] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/vnd.spring-boot.actuator.v3+json', given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:03:58 [http-nio-19001-exec-1] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [org.springframework.boot.actuate.health.SystemHealth@178369bf]
|
||||
2025-07-16 09:03:58 [http-nio-19001-exec-1] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Completed 200 OK
|
||||
2025-07-16 09:04:12 [http-nio-19001-exec-3] DEBUG [org.springframework.web.servlet.DispatcherServlet] - GET "/actuator/health", parameters={}
|
||||
2025-07-16 09:04:12 [http-nio-19001-exec-3] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/vnd.spring-boot.actuator.v3+json', given [*/*] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
|
||||
2025-07-16 09:04:12 [http-nio-19001-exec-3] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [org.springframework.boot.actuate.health.SystemHealth@159e4af4]
|
||||
2025-07-16 09:04:12 [http-nio-19001-exec-3] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Completed 200 OK
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.web.servlet.handler.SimpleUrlHandlerMapping] - Mapped to ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [org.springframework.web.servlet.DispatcherServlet] - "ERROR" dispatch for GET "/error", parameters={}
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.a.RequestMappingHandlerMapping] - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Using 'application/json', given [*/*] and supported [application/json, application/*+json]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [o.s.w.s.m.m.annotation.HttpEntityMethodProcessor] - Writing [{timestamp=Wed Jul 16 09:04:22 CST 2025, status=403, error=Forbidden, path=/user/actuator/health}]
|
||||
2025-07-16 09:04:22 [http-nio-19001-exec-5] DEBUG [org.springframework.web.servlet.DispatcherServlet] - Exiting from "ERROR" dispatch, status 403
|
||||
2025-07-16 09:46:48 [Thread-1] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-16 09:46:48 [Thread-7] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-16 09:46:48 [Thread-7] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-16 09:46:48 [Thread-1] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
2025-07-16 09:46:49 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown initiated...
|
||||
2025-07-16 09:46:49 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown completed.
|
||||
@@ -1,99 +0,0 @@
|
||||
[INFO] Scanning for projects...
|
||||
[INFO]
|
||||
[INFO] -------------------< com.emotionmuseum:emotion-user >-------------------
|
||||
[INFO] Building emotion-user 1.0.0
|
||||
[INFO] from pom.xml
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] >>> spring-boot:3.0.2:run (default-cli) > test-compile @ emotion-user >>>
|
||||
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.33 has been relocated to com.mysql:mysql-connector-j:jar:8.0.33: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:resources (default-resources) @ emotion-user ---
|
||||
[INFO] Copying 2 resources from src/main/resources to target/classes
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:compile (default-compile) @ emotion-user ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- resources:3.3.1:testResources (default-testResources) @ emotion-user ---
|
||||
[INFO] skip non existing resourceDirectory /Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-user/src/test/resources
|
||||
[INFO]
|
||||
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ emotion-user ---
|
||||
[INFO] No sources to compile
|
||||
[INFO]
|
||||
[INFO] <<< spring-boot:3.0.2:run (default-cli) < test-compile @ emotion-user <<<
|
||||
[INFO]
|
||||
[INFO]
|
||||
[INFO] --- spring-boot:3.0.2:run (default-cli) @ emotion-user ---
|
||||
[INFO] Attaching agents: []
|
||||
[2m2025-07-13T08:45:36.142+08:00[0;39m [33m WARN[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:36.195+08:00[0;39m [33m WARN[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:36.221+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36m.e.DevToolsPropertyDefaultsPostProcessor[0;39m [2m:[0;39m Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
[2m2025-07-13T08:45:36.387+08:00[0;39m [33m WARN[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.nacos.client.logging.NacosLogging [0;39m [2m:[0;39m Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
[2m2025-07-13T08:45:36.388+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [req-serv] nacos-server port:8848
|
||||
[2m2025-07-13T08:45:36.389+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m [settings] [http-client] connect timeout:1000
|
||||
[2m2025-07-13T08:45:36.391+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.alibaba.nacos.client.utils.ParamUtil [0;39m [2m:[0;39m PER_TASK_CONFIG_SIZE: 3000.0
|
||||
[2m2025-07-13T08:45:36.437+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:36.437+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.p.a.s.c.ClientAuthPluginManager [0;39m [2m:[0;39m [ClientAuthPluginManager] Load ClientAuthService com.alibaba.nacos.client.auth.ram.RamClientAuthServiceImpl success.
|
||||
[2m2025-07-13T08:45:36.455+08:00[0;39m [32m INFO[0;39m [35m6791[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mc.a.n.c.a.r.identify.CredentialWatcher [0;39m [2m:[0;39m null No credential found
|
||||
2025-07-13 08:45:36 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
[32m :: Spring Boot :: [39m [2m (v3.0.2)[0;39m
|
||||
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [c.a.n.client.config.impl.LocalConfigInfoProcessor] - LOCAL_SNAPSHOT_PATH:/Users/huazhongmin/nacos/config
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [RpcClientFactory] create a new rpc client of d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012e318670
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda/0x000000012e318aa0
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] RpcClient init, ServerListFactory = com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Try to connect to server on start up, server: {serverIp = '127.0.0.1', server main port = 8848}
|
||||
2025-07-13 08:45:36 [restartedMain] INFO [c.a.nacos.common.remote.client.grpc.GrpcClient] - grpc client connection server:127.0.0.1 ip,serverPort:9848,grpcTslConfig:{"sslProvider":"OPENSSL","enableTls":false,"mutualAuthEnable":false,"trustAll":false}
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Success to connect to server [127.0.0.1:8848] on start up, connectionId = 1752367537016_127.0.0.1_51165
|
||||
2025-07-13 08:45:37 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Notify connected event to listeners.
|
||||
2025-07-13 08:45:37 [com.alibaba.nacos.client.remote.worker] INFO [com.alibaba.nacos.client.config.impl.ClientWorker] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Connected,notify listen context...
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [com.alibaba.nacos.common.remote.client] - [d7ae7ba9-4fec-4362-a0ff-0d9a56ce7c0d_config-0] Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$$Lambda/0x000000012e4a2a18
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [com.alibaba.nacos.client.config.impl.Limiter] - limitTime:5.0
|
||||
2025-07-13 08:45:37 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:37 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:37 [restartedMain] WARN [c.a.cloud.nacos.client.NacosPropertySourceBuilder] - Ignore the empty nacos configuration and get it based on dataId[emotion-user-dev.properties] & group[DEFAULT_GROUP]
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [o.s.c.b.c.PropertySourceBootstrapConfiguration] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-emotion-user-dev.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-user.properties,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-emotion-user,DEFAULT_GROUP'}]
|
||||
2025-07-13 08:45:37 [restartedMain] WARN [com.alibaba.nacos.client.logging.NacosLogging] - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [com.emotionmuseum.user.UserApplication] - The following 1 profile is active: "dev"
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Multiple Spring Data modules found, entering strict repository configuration mode
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||
2025-07-13 08:45:37 [restartedMain] INFO [o.s.d.r.config.RepositoryConfigurationDelegate] - Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [o.springframework.cloud.context.scope.GenericScope] - BeanFactory id=7e3acccb-1d48-37df-bf0c-1c15c4e1d510
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat initialized with port(s): 9001 (http)
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [org.apache.catalina.core.StandardService] - Starting service [Tomcat]
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [org.apache.catalina.core.StandardEngine] - Starting Servlet engine: [Apache Tomcat/10.1.5]
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring embedded WebApplicationContext
|
||||
2025-07-13 08:45:38 [restartedMain] INFO [o.s.b.w.s.c.ServletWebServerApplicationContext] - Root WebApplicationContext: initialization completed in 1416 ms
|
||||
Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter.
|
||||
Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor@7d6aa779'
|
||||
Parsed mapper file: 'file [/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-user/target/classes/mapper/UserMapper.xml]'
|
||||
_ _ |_ _ _|_. ___ _ | _
|
||||
| | |\/|_)(_| | |_\ |_)||_|_\
|
||||
/ |
|
||||
3.5.3.1
|
||||
2025-07-13 08:45:39 [restartedMain] WARN [o.s.b.d.autoconfigure.OptionalLiveReloadServer] - Unable to start LiveReload server
|
||||
2025-07-13 08:45:39 [restartedMain] INFO [o.s.b.actuate.endpoint.web.EndpointLinksResolver] - Exposing 3 endpoint(s) beneath base path '/actuator'
|
||||
2025-07-13 08:45:39 [restartedMain] INFO [o.s.boot.web.embedded.tomcat.TomcatWebServer] - Tomcat started on port(s): 9001 (http) with context path ''
|
||||
2025-07-13 08:45:39 [restartedMain] INFO [com.emotionmuseum.user.UserApplication] - Started UserApplication in 3.951 seconds (process running for 4.401)
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [o.a.c.core.ContainerBase.[Tomcat].[localhost].[/]] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Initializing Servlet 'dispatcherServlet'
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [org.springframework.web.servlet.DispatcherServlet] - Completed initialization in 1 ms
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Starting...
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [com.zaxxer.hikari.pool.HikariPool] - HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@3eaf6ca4
|
||||
2025-07-13 08:45:40 [http-nio-9001-exec-1] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Start completed.
|
||||
2025-07-13 08:49:25 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Start destroying common HttpClient
|
||||
2025-07-13 08:49:25 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Start destroying Publisher
|
||||
2025-07-13 08:49:25 [Thread-10] WARN [com.alibaba.nacos.common.notify.NotifyCenter] - [NotifyCenter] Destruction of the end
|
||||
2025-07-13 08:49:25 [Thread-4] WARN [c.alibaba.nacos.common.http.HttpClientBeanHolder] - [HttpClientBeanHolder] Destruction of the end
|
||||
2025-07-13 08:49:25 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown initiated...
|
||||
2025-07-13 08:49:25 [SpringApplicationShutdownHook] INFO [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown completed.
|
||||
@@ -1 +0,0 @@
|
||||
target/emotion-gateway-1.0.0.jar中没有主清单属性
|
||||
@@ -1 +0,0 @@
|
||||
63251
|
||||
@@ -1,32 +0,0 @@
|
||||
2025-07-15T17:59:48.763+08:00 WARN 62881 --- [ main] 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-15T17:59:48.862+08:00 WARN 62881 --- [ main] 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-15 17:59:49 [main] WARN com.alibaba.nacos.client.logging.NacosLogging - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
|
||||
. ____ _ __ _ _
|
||||
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
|
||||
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
|
||||
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
|
||||
' |____| .__|_| |_|_| |_\__, | / / / /
|
||||
=========|_|==============|___/=/_/_/_/
|
||||
:: Spring Boot :: (v3.0.2)
|
||||
|
||||
2025-07-15 17:59:49 [main] WARN com.alibaba.nacos.client.logging.NacosLogging - Load Logback Configuration of Nacos fail, message: Could not initialize Logback Nacos logging from classpath:nacos-logback.xml
|
||||
2025-07-15 17:59:49 [main] INFO com.emotionmuseum.user.UserApplication - The following 1 profile is active: "local"
|
||||
2025-07-15 17:59:50 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'snowflakeIdGenerator' defined in class path resource [com/emotionmuseum/common/config/SnowflakeConfig.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=snowflakeConfig; factoryMethodName=snowflakeIdGenerator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [com/emotionmuseum/common/config/SnowflakeConfig.class]] for bean 'snowflakeIdGenerator' since there is already [Generic bean: class [com.emotionmuseum.common.util.SnowflakeIdGenerator]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null; defined in URL [jar:file:/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-user/target/emotion-user-1.0.0.jar!/BOOT-INF/lib/emotion-common-1.0.0.jar!/com/emotionmuseum/common/util/SnowflakeIdGenerator.class]] bound.
|
||||
2025-07-15 17:59:50 [main] INFO o.s.b.a.logging.ConditionEvaluationReportLogger -
|
||||
|
||||
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
|
||||
2025-07-15 17:59:50 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter -
|
||||
|
||||
***************************
|
||||
APPLICATION FAILED TO START
|
||||
***************************
|
||||
|
||||
Description:
|
||||
|
||||
The bean 'snowflakeIdGenerator', defined in class path resource [com/emotionmuseum/common/config/SnowflakeConfig.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-user/target/emotion-user-1.0.0.jar!/BOOT-INF/lib/emotion-common-1.0.0.jar!/com/emotionmuseum/common/util/SnowflakeIdGenerator.class] and overriding is disabled.
|
||||
|
||||
Action:
|
||||
|
||||
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
62881
|
||||
@@ -1,77 +0,0 @@
|
||||
-- ============================================================================
|
||||
-- Coze API调用记录表优化迁移脚本
|
||||
-- 执行时间: 2025-07-13
|
||||
-- 说明: 为coze_api_call表添加新字段以完整保存接口调用详情
|
||||
-- ============================================================================
|
||||
|
||||
USE emotion_museum;
|
||||
|
||||
-- 备份现有数据(可选)
|
||||
-- CREATE TABLE coze_api_call_backup AS SELECT * FROM coze_api_call;
|
||||
|
||||
-- 添加用户消息相关字段
|
||||
ALTER TABLE coze_api_call
|
||||
ADD COLUMN user_message TEXT COMMENT '用户输入的消息内容' AFTER request_headers,
|
||||
ADD COLUMN user_message_type VARCHAR(20) DEFAULT 'text' COMMENT '用户消息类型: text/image/file' AFTER user_message;
|
||||
|
||||
-- 添加AI回复相关字段
|
||||
ALTER TABLE coze_api_call
|
||||
ADD COLUMN ai_reply TEXT COMMENT 'AI回复的消息内容' AFTER user_message_type,
|
||||
ADD COLUMN ai_reply_type VARCHAR(20) DEFAULT 'text' COMMENT 'AI回复类型: text/image/file' AFTER ai_reply;
|
||||
|
||||
-- 添加轮询相关字段
|
||||
ALTER TABLE coze_api_call
|
||||
ADD COLUMN poll_count INT DEFAULT 0 COMMENT '轮询次数' AFTER response_headers,
|
||||
ADD COLUMN poll_start_time DATETIME COMMENT '轮询开始时间' AFTER poll_count,
|
||||
ADD COLUMN poll_end_time DATETIME COMMENT '轮询结束时间' AFTER poll_start_time,
|
||||
ADD COLUMN final_status VARCHAR(20) COMMENT '最终状态: completed/failed/timeout' AFTER poll_end_time;
|
||||
|
||||
-- 添加功能调用相关字段
|
||||
ALTER TABLE coze_api_call
|
||||
ADD COLUMN function_calls JSON COMMENT '函数调用记录' AFTER total_tokens,
|
||||
ADD COLUMN function_results JSON COMMENT '函数调用结果' AFTER function_calls;
|
||||
|
||||
-- 添加扩展信息字段
|
||||
ALTER TABLE coze_api_call
|
||||
ADD COLUMN client_ip VARCHAR(45) COMMENT '客户端IP' AFTER error_message,
|
||||
ADD COLUMN user_agent TEXT COMMENT '用户代理' AFTER client_ip,
|
||||
ADD COLUMN session_id VARCHAR(100) COMMENT '会话ID' AFTER user_agent,
|
||||
ADD COLUMN trace_id VARCHAR(100) COMMENT '追踪ID' AFTER session_id,
|
||||
ADD COLUMN metadata JSON COMMENT '扩展元数据' AFTER trace_id;
|
||||
|
||||
-- 添加新字段的索引
|
||||
CREATE INDEX idx_coze_api_call_final_status ON coze_api_call (final_status);
|
||||
CREATE INDEX idx_coze_api_call_client_ip ON coze_api_call (client_ip);
|
||||
CREATE INDEX idx_coze_api_call_session_id ON coze_api_call (session_id);
|
||||
CREATE INDEX idx_coze_api_call_trace_id ON coze_api_call (trace_id);
|
||||
CREATE INDEX idx_coze_api_call_user_status ON coze_api_call (user_id, status);
|
||||
CREATE INDEX idx_coze_api_call_conversation_time ON coze_api_call (conversation_id, start_time);
|
||||
|
||||
-- 更新表注释
|
||||
ALTER TABLE coze_api_call COMMENT = 'Coze API调用记录表 - 完整版本';
|
||||
|
||||
-- 验证表结构
|
||||
DESCRIBE coze_api_call;
|
||||
|
||||
-- 显示表的索引
|
||||
SHOW INDEX FROM coze_api_call;
|
||||
|
||||
-- 统计现有数据
|
||||
SELECT
|
||||
COUNT(*) as total_records,
|
||||
COUNT(DISTINCT user_id) as unique_users,
|
||||
COUNT(DISTINCT conversation_id) as unique_conversations,
|
||||
MIN(create_time) as earliest_record,
|
||||
MAX(create_time) as latest_record
|
||||
FROM coze_api_call;
|
||||
|
||||
-- 显示各状态的记录数
|
||||
SELECT status, COUNT(*) as count
|
||||
FROM coze_api_call
|
||||
GROUP BY status;
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- ============================================================================
|
||||
-- 迁移完成
|
||||
-- ============================================================================
|
||||
@@ -1,134 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 情感博物馆微服务启动脚本
|
||||
# 支持环境参数控制
|
||||
|
||||
# 默认环境
|
||||
DEFAULT_ENV="local"
|
||||
ENV=${1:-$DEFAULT_ENV}
|
||||
|
||||
echo "=========================================="
|
||||
echo "情感博物馆微服务启动脚本"
|
||||
echo "启动环境: $ENV"
|
||||
echo "=========================================="
|
||||
|
||||
# 检查基础服务
|
||||
check_services() {
|
||||
echo "📊 检查基础服务..."
|
||||
|
||||
if ! nc -z localhost 3306; then
|
||||
echo "❌ MySQL服务未启动,请先启动MySQL服务"
|
||||
echo "可以使用: brew services start mysql"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! nc -z localhost 6379; then
|
||||
echo "❌ Redis服务未启动,请先启动Redis服务"
|
||||
echo "可以使用: brew services start redis"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ 基础服务检查通过"
|
||||
}
|
||||
|
||||
# 启动服务函数
|
||||
start_service() {
|
||||
local service_name=$1
|
||||
local port=$2
|
||||
local description=$3
|
||||
|
||||
echo "🚀 启动 $description ($service_name:$port)..."
|
||||
|
||||
cd $service_name
|
||||
|
||||
# 检查端口是否被占用
|
||||
if lsof -Pi :$port -sTCP:LISTEN -t >/dev/null ; then
|
||||
echo "⚠️ 端口 $port 已被占用,跳过 $service_name"
|
||||
cd ..
|
||||
return
|
||||
fi
|
||||
|
||||
# 编译项目
|
||||
echo "📦 编译 $service_name..."
|
||||
mvn clean package -DskipTests -q
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ $service_name 编译失败"
|
||||
cd ..
|
||||
return
|
||||
fi
|
||||
|
||||
# 启动服务
|
||||
echo "🔄 启动 $service_name (环境: $ENV)..."
|
||||
nohup java -jar -Dspring.profiles.active=$ENV target/$service_name-1.0.0.jar > ../logs/$service_name-$ENV.log 2>&1 &
|
||||
|
||||
# 记录PID
|
||||
echo $! > ../logs/$service_name.pid
|
||||
|
||||
echo "✅ $service_name 启动完成,PID: $!"
|
||||
echo "📋 日志文件: logs/$service_name-$ENV.log"
|
||||
|
||||
cd ..
|
||||
|
||||
# 等待服务启动
|
||||
sleep 3
|
||||
}
|
||||
|
||||
# 创建日志目录
|
||||
mkdir -p logs
|
||||
|
||||
# 检查基础服务
|
||||
check_services
|
||||
|
||||
# 服务列表
|
||||
services=(
|
||||
"emotion-user:19001:用户服务"
|
||||
"emotion-ai:19002:AI服务"
|
||||
"emotion-websocket:19007:WebSocket聊天服务"
|
||||
"emotion-gateway:19000:网关服务"
|
||||
)
|
||||
|
||||
echo "🚀 开始启动核心服务 (环境: $ENV)..."
|
||||
|
||||
# 按顺序启动服务
|
||||
for service_info in "${services[@]}"; do
|
||||
IFS=':' read -r service_name port description <<< "$service_info"
|
||||
start_service "$service_name" "$port" "$description"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "🎉 核心服务启动完成!"
|
||||
echo ""
|
||||
echo "📋 服务列表:"
|
||||
for service_info in "${services[@]}"; do
|
||||
IFS=':' read -r service_name port description <<< "$service_info"
|
||||
echo " $description: http://localhost:$port"
|
||||
done
|
||||
echo ""
|
||||
echo "📝 使用 './stop-services.sh' 停止所有服务"
|
||||
echo "📝 查看日志: tail -f logs/服务名-$ENV.log"
|
||||
|
||||
# 等待服务完全启动
|
||||
echo ""
|
||||
echo "📊 等待服务完全启动..."
|
||||
sleep 15
|
||||
|
||||
# 检查服务状态
|
||||
echo "📊 检查服务状态..."
|
||||
for service_info in "${services[@]}"; do
|
||||
IFS=':' read -r service_name port description <<< "$service_info"
|
||||
|
||||
if curl -s http://localhost:$port/actuator/health >/dev/null 2>&1; then
|
||||
echo "✅ $description 运行正常"
|
||||
else
|
||||
echo "⚠️ $description 可能未完全启动,请查看日志: tail -f logs/$service_name-$ENV.log"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "🎉 启动完成!环境: $ENV"
|
||||
echo ""
|
||||
echo "使用方法:"
|
||||
echo " ./start-services.sh # 使用默认local环境启动"
|
||||
echo " ./start-services.sh dev # 使用dev环境启动"
|
||||
echo " ./start-services.sh prod # 使用prod环境启动"
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 情绪博物馆微服务停止脚本
|
||||
# 作者: emotion-museum
|
||||
# 日期: 2025-07-12
|
||||
|
||||
echo "=========================================="
|
||||
echo "情绪博物馆微服务停止脚本"
|
||||
echo "=========================================="
|
||||
|
||||
# 停止服务函数
|
||||
stop_service() {
|
||||
local service_name=$1
|
||||
local pid_file="logs/${service_name}.pid"
|
||||
|
||||
if [ -f "$pid_file" ]; then
|
||||
local pid=$(cat $pid_file)
|
||||
if ps -p $pid > /dev/null 2>&1; then
|
||||
echo "停止 $service_name 服务 (PID: $pid)..."
|
||||
kill $pid
|
||||
|
||||
# 等待进程结束
|
||||
local count=0
|
||||
while [ $count -lt 10 ]; do
|
||||
if ! ps -p $pid > /dev/null 2>&1; then
|
||||
echo "$service_name 服务已停止"
|
||||
rm -f $pid_file
|
||||
return 0
|
||||
fi
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
# 强制杀死进程
|
||||
echo "强制停止 $service_name 服务..."
|
||||
kill -9 $pid 2>/dev/null
|
||||
rm -f $pid_file
|
||||
else
|
||||
echo "$service_name 服务未运行"
|
||||
rm -f $pid_file
|
||||
fi
|
||||
else
|
||||
echo "$service_name 服务PID文件不存在"
|
||||
fi
|
||||
}
|
||||
|
||||
# 停止所有微服务
|
||||
echo "开始停止微服务..."
|
||||
|
||||
# 停止统计分析服务
|
||||
stop_service "emotion-stats"
|
||||
|
||||
# 停止成就奖励服务
|
||||
stop_service "emotion-reward"
|
||||
|
||||
# 停止地图探索服务
|
||||
stop_service "emotion-explore"
|
||||
|
||||
# 停止成长课题服务
|
||||
stop_service "emotion-growth"
|
||||
|
||||
# 停止情绪记录服务
|
||||
stop_service "emotion-record"
|
||||
|
||||
# 停止AI对话服务
|
||||
stop_service "emotion-ai"
|
||||
|
||||
# 停止WebSocket聊天服务
|
||||
stop_service "emotion-websocket"
|
||||
|
||||
# 停止用户服务
|
||||
stop_service "emotion-user"
|
||||
|
||||
# 停止网关服务
|
||||
stop_service "emotion-gateway"
|
||||
|
||||
# 清理可能残留的Java进程
|
||||
echo "清理残留进程..."
|
||||
pkill -f "emotion-gateway"
|
||||
pkill -f "emotion-user"
|
||||
pkill -f "emotion-ai"
|
||||
pkill -f "emotion-websocket"
|
||||
pkill -f "emotion-record"
|
||||
pkill -f "emotion-growth"
|
||||
pkill -f "emotion-explore"
|
||||
pkill -f "emotion-reward"
|
||||
pkill -f "emotion-stats"
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "所有微服务已停止!"
|
||||
echo "=========================================="
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 认证功能测试脚本
|
||||
# 用于测试emotion-auth模块的认证功能
|
||||
|
||||
BASE_URL="http://localhost:19000/api/auth"
|
||||
CONTENT_TYPE="Content-Type: application/json"
|
||||
|
||||
echo "========================================="
|
||||
echo "开始测试emotion-auth模块认证功能"
|
||||
echo "========================================="
|
||||
|
||||
# 1. 测试获取验证码
|
||||
echo "1. 测试获取验证码..."
|
||||
CAPTCHA_RESPONSE=$(curl -s -X GET "${BASE_URL}/../captcha/generate")
|
||||
echo "验证码响应: $CAPTCHA_RESPONSE"
|
||||
|
||||
# 提取验证码ID(假设返回JSON格式)
|
||||
CAPTCHA_ID=$(echo $CAPTCHA_RESPONSE | grep -o '"key":"[^"]*"' | cut -d'"' -f4)
|
||||
echo "验证码ID: $CAPTCHA_ID"
|
||||
|
||||
# 2. 测试用户注册
|
||||
echo -e "\n2. 测试用户注册..."
|
||||
REGISTER_DATA='{
|
||||
"account": "testuser001",
|
||||
"password": "123456",
|
||||
"confirmPassword": "123456",
|
||||
"email": "test@example.com",
|
||||
"captcha": "1234",
|
||||
"captchaId": "'$CAPTCHA_ID'"
|
||||
}'
|
||||
|
||||
REGISTER_RESPONSE=$(curl -s -X POST "${BASE_URL}/register" \
|
||||
-H "$CONTENT_TYPE" \
|
||||
-d "$REGISTER_DATA")
|
||||
echo "注册响应: $REGISTER_RESPONSE"
|
||||
|
||||
# 3. 测试用户登录
|
||||
echo -e "\n3. 测试用户登录..."
|
||||
LOGIN_DATA='{
|
||||
"account": "testuser001",
|
||||
"password": "123456",
|
||||
"captcha": "1234",
|
||||
"captchaId": "'$CAPTCHA_ID'"
|
||||
}'
|
||||
|
||||
LOGIN_RESPONSE=$(curl -s -X POST "${BASE_URL}/login" \
|
||||
-H "$CONTENT_TYPE" \
|
||||
-d "$LOGIN_DATA")
|
||||
echo "登录响应: $LOGIN_RESPONSE"
|
||||
|
||||
# 提取访问Token
|
||||
ACCESS_TOKEN=$(echo $LOGIN_RESPONSE | grep -o '"accessToken":"[^"]*"' | cut -d'"' -f4)
|
||||
echo "访问Token: $ACCESS_TOKEN"
|
||||
|
||||
# 4. 测试获取用户信息
|
||||
if [ ! -z "$ACCESS_TOKEN" ]; then
|
||||
echo -e "\n4. 测试获取用户信息..."
|
||||
USER_INFO_RESPONSE=$(curl -s -X GET "${BASE_URL}/user-info" \
|
||||
-H "$CONTENT_TYPE" \
|
||||
-H "Authorization: Bearer $ACCESS_TOKEN")
|
||||
echo "用户信息响应: $USER_INFO_RESPONSE"
|
||||
fi
|
||||
|
||||
# 5. 测试验证Token
|
||||
if [ ! -z "$ACCESS_TOKEN" ]; then
|
||||
echo -e "\n5. 测试验证Token..."
|
||||
VALIDATE_RESPONSE=$(curl -s -X GET "${BASE_URL}/validate-token" \
|
||||
-H "$CONTENT_TYPE" \
|
||||
-H "Authorization: Bearer $ACCESS_TOKEN")
|
||||
echo "Token验证响应: $VALIDATE_RESPONSE"
|
||||
fi
|
||||
|
||||
# 6. 测试检查账号是否存在
|
||||
echo -e "\n6. 测试检查账号是否存在..."
|
||||
CHECK_ACCOUNT_RESPONSE=$(curl -s -X GET "${BASE_URL}/check-account?account=testuser001")
|
||||
echo "检查账号响应: $CHECK_ACCOUNT_RESPONSE"
|
||||
|
||||
# 7. 测试用户登出
|
||||
if [ ! -z "$ACCESS_TOKEN" ]; then
|
||||
echo -e "\n7. 测试用户登出..."
|
||||
LOGOUT_RESPONSE=$(curl -s -X POST "${BASE_URL}/logout?userId=test-user-id" \
|
||||
-H "$CONTENT_TYPE" \
|
||||
-H "Authorization: Bearer $ACCESS_TOKEN")
|
||||
echo "登出响应: $LOGOUT_RESPONSE"
|
||||
fi
|
||||
|
||||
echo -e "\n========================================="
|
||||
echo "认证功能测试完成"
|
||||
echo "========================================="
|
||||
@@ -1,255 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ============================================================================
|
||||
# 批量更新所有微服务的Nacos配置
|
||||
# 为每个服务创建本地、测试、生产环境的配置文件
|
||||
# ============================================================================
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}批量更新微服务Nacos配置${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
# 服务配置
|
||||
SERVICES="emotion-user:19001 emotion-ai:19002 emotion-record:19003 emotion-growth:19004 emotion-explore:19005 emotion-reward:19006 emotion-websocket:19007 emotion-stats:19008"
|
||||
|
||||
# 生成本地环境配置
|
||||
generate_local_config() {
|
||||
local service_name=$1
|
||||
local port=$2
|
||||
|
||||
cat > "backend/${service_name}/src/main/resources/application-local.yml" << EOF
|
||||
# 本地开发环境配置
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: localhost:8848
|
||||
namespace:
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
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: nacos
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# Redis配置
|
||||
data:
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password:
|
||||
database: 0
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.emotionmuseum: debug
|
||||
com.baomidou.mybatisplus: debug
|
||||
com.alibaba.nacos: info
|
||||
file:
|
||||
name: logs/${service_name}-local.log
|
||||
EOF
|
||||
}
|
||||
|
||||
# 生成测试环境配置
|
||||
generate_test_config() {
|
||||
local service_name=$1
|
||||
local port=$2
|
||||
|
||||
cat > "backend/${service_name}/src/main/resources/application-test.yml" << EOF
|
||||
# 测试环境配置
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 47.111.10.27:8848
|
||||
namespace: test
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
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: nacos
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://47.111.10.27:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
|
||||
# Redis配置
|
||||
data:
|
||||
redis:
|
||||
host: 47.111.10.27
|
||||
port: 6379
|
||||
password: EmotionMuseum2025*#
|
||||
database: 0
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.emotionmuseum: info
|
||||
com.baomidou.mybatisplus: info
|
||||
com.alibaba.nacos: warn
|
||||
file:
|
||||
name: logs/${service_name}-test.log
|
||||
EOF
|
||||
}
|
||||
|
||||
# 生成生产环境配置
|
||||
generate_prod_config() {
|
||||
local service_name=$1
|
||||
local port=$2
|
||||
|
||||
cat > "backend/${service_name}/src/main/resources/application-prod.yml" << EOF
|
||||
# 生产环境配置
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 47.111.10.27:8848
|
||||
namespace: prod
|
||||
group: DEFAULT_GROUP
|
||||
enabled: true
|
||||
username: nacos
|
||||
password: nacos
|
||||
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: nacos
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://47.111.10.27:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
|
||||
# Redis配置
|
||||
data:
|
||||
redis:
|
||||
host: 47.111.10.27
|
||||
port: 6379
|
||||
password: EmotionMuseum2025*#
|
||||
database: 0
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.emotionmuseum: warn
|
||||
com.baomidou.mybatisplus: warn
|
||||
com.alibaba.nacos: error
|
||||
file:
|
||||
name: logs/${service_name}-prod.log
|
||||
EOF
|
||||
}
|
||||
|
||||
# 处理每个服务
|
||||
for service_info in $SERVICES; do
|
||||
service_name=$(echo $service_info | cut -d: -f1)
|
||||
port=$(echo $service_info | cut -d: -f2)
|
||||
|
||||
echo -e "${YELLOW}处理服务: $service_name (端口: $port)${NC}"
|
||||
|
||||
# 检查服务目录是否存在
|
||||
if [ ! -d "backend/$service_name" ]; then
|
||||
echo -e "${RED}❌ 服务目录不存在: backend/$service_name${NC}"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 创建resources目录(如果不存在)
|
||||
mkdir -p "backend/$service_name/src/main/resources"
|
||||
|
||||
# 生成配置文件
|
||||
echo " 生成本地环境配置..."
|
||||
generate_local_config "$service_name" "$port"
|
||||
|
||||
echo " 生成测试环境配置..."
|
||||
generate_test_config "$service_name" "$port"
|
||||
|
||||
echo " 生成生产环境配置..."
|
||||
generate_prod_config "$service_name" "$port"
|
||||
|
||||
echo -e "${GREEN}✅ $service_name 配置文件生成完成${NC}"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${GREEN}✅ 所有服务的Nacos配置更新完成!${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
echo ""
|
||||
echo -e "${YELLOW}配置说明:${NC}"
|
||||
echo -e "1. 本地环境: localhost:8848, 无命名空间"
|
||||
echo -e "2. 测试环境: 47.111.10.27:8848, test命名空间"
|
||||
echo -e "3. 生产环境: 47.111.10.27:8848, prod命名空间"
|
||||
echo ""
|
||||
echo -e "${YELLOW}使用方法:${NC}"
|
||||
echo -e "启动时指定环境: ${GREEN}--spring.profiles.active=local|test|prod${NC}"
|
||||
@@ -1,157 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ============================================================================
|
||||
# 批量更新所有微服务的Nacos密码配置
|
||||
# 本地环境: Peanut2817*#
|
||||
# 测试和生产环境: EmotionMuseum2025
|
||||
# ============================================================================
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}批量更新微服务Nacos密码配置${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
# 服务列表
|
||||
SERVICES="emotion-user emotion-ai emotion-record emotion-growth emotion-explore emotion-reward emotion-websocket emotion-stats"
|
||||
|
||||
# 更新本地环境密码
|
||||
update_local_password() {
|
||||
local service_name=$1
|
||||
local config_file="backend/${service_name}/src/main/resources/application-local.yml"
|
||||
|
||||
if [ ! -f "$config_file" ]; then
|
||||
echo -e "${RED} ❌ 配置文件不存在: $config_file${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 使用sed替换密码
|
||||
sed -i.bak 's/password: nacos$/password: Peanut2817*#/g' "$config_file"
|
||||
|
||||
# 检查是否替换成功
|
||||
if grep -q "password: Peanut2817*#" "$config_file"; then
|
||||
echo -e "${GREEN} ✅ 本地环境密码更新成功${NC}"
|
||||
rm -f "${config_file}.bak"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED} ❌ 本地环境密码更新失败${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 更新测试环境密码
|
||||
update_test_password() {
|
||||
local service_name=$1
|
||||
local config_file="backend/${service_name}/src/main/resources/application-test.yml"
|
||||
|
||||
if [ ! -f "$config_file" ]; then
|
||||
echo -e "${RED} ❌ 配置文件不存在: $config_file${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 使用sed替换密码
|
||||
sed -i.bak 's/password: nacos$/password: EmotionMuseum2025/g' "$config_file"
|
||||
|
||||
# 检查是否替换成功
|
||||
if grep -q "password: EmotionMuseum2025" "$config_file"; then
|
||||
echo -e "${GREEN} ✅ 测试环境密码更新成功${NC}"
|
||||
rm -f "${config_file}.bak"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED} ❌ 测试环境密码更新失败${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 更新生产环境密码
|
||||
update_prod_password() {
|
||||
local service_name=$1
|
||||
local config_file="backend/${service_name}/src/main/resources/application-prod.yml"
|
||||
|
||||
if [ ! -f "$config_file" ]; then
|
||||
echo -e "${RED} ❌ 配置文件不存在: $config_file${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 使用sed替换密码
|
||||
sed -i.bak 's/password: nacos$/password: EmotionMuseum2025/g' "$config_file"
|
||||
|
||||
# 检查是否替换成功
|
||||
if grep -q "password: EmotionMuseum2025" "$config_file"; then
|
||||
echo -e "${GREEN} ✅ 生产环境密码更新成功${NC}"
|
||||
rm -f "${config_file}.bak"
|
||||
return 0
|
||||
else
|
||||
echo -e "${RED} ❌ 生产环境密码更新失败${NC}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 统计结果
|
||||
total_services=0
|
||||
success_services=0
|
||||
failed_services=0
|
||||
|
||||
# 处理每个服务
|
||||
for service_name in $SERVICES; do
|
||||
echo -e "${YELLOW}更新服务: $service_name${NC}"
|
||||
total_services=$((total_services + 1))
|
||||
|
||||
# 检查服务目录是否存在
|
||||
if [ ! -d "backend/$service_name" ]; then
|
||||
echo -e "${RED} ❌ 服务目录不存在: backend/$service_name${NC}"
|
||||
failed_services=$((failed_services + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
# 更新各环境密码
|
||||
service_success=true
|
||||
|
||||
if ! update_local_password "$service_name"; then
|
||||
service_success=false
|
||||
fi
|
||||
|
||||
if ! update_test_password "$service_name"; then
|
||||
service_success=false
|
||||
fi
|
||||
|
||||
if ! update_prod_password "$service_name"; then
|
||||
service_success=false
|
||||
fi
|
||||
|
||||
if [ "$service_success" = true ]; then
|
||||
echo -e "${GREEN} ✅ $service_name 密码更新完成${NC}"
|
||||
success_services=$((success_services + 1))
|
||||
else
|
||||
echo -e "${RED} ❌ $service_name 密码更新失败${NC}"
|
||||
failed_services=$((failed_services + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
# 显示统计结果
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}密码更新结果统计${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "总服务数: ${BLUE}$total_services${NC}"
|
||||
echo -e "更新成功: ${GREEN}$success_services${NC}"
|
||||
echo -e "更新失败: ${RED}$failed_services${NC}"
|
||||
|
||||
if [ $failed_services -eq 0 ]; then
|
||||
echo -e "${GREEN}🎉 所有服务密码更新完成!${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}密码配置:${NC}"
|
||||
echo -e "本地环境: ${GREEN}Peanut2817*#${NC}"
|
||||
echo -e "测试环境: ${GREEN}EmotionMuseum2025${NC}"
|
||||
echo -e "生产环境: ${GREEN}EmotionMuseum2025${NC}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${RED}❌ 有 $failed_services 个服务密码更新失败${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,81 +0,0 @@
|
||||
-- ============================================================================
|
||||
-- 数据库脚本验证查询
|
||||
-- 用于验证 mysql_emotion_museum_final.sql 执行后的表结构
|
||||
-- ============================================================================
|
||||
|
||||
-- 验证数据库是否存在
|
||||
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'emotion_museum';
|
||||
|
||||
-- 验证所有表是否创建成功
|
||||
SELECT TABLE_NAME, TABLE_COMMENT
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
ORDER BY TABLE_NAME;
|
||||
|
||||
-- 验证conversation表的字段结构(重点验证新增字段)
|
||||
SELECT
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
IS_NULLABLE,
|
||||
COLUMN_DEFAULT,
|
||||
COLUMN_COMMENT
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
AND TABLE_NAME = 'conversation'
|
||||
ORDER BY ORDINAL_POSITION;
|
||||
|
||||
-- 验证conversation表的索引
|
||||
SELECT
|
||||
INDEX_NAME,
|
||||
COLUMN_NAME,
|
||||
NON_UNIQUE
|
||||
FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
AND TABLE_NAME = 'conversation'
|
||||
ORDER BY INDEX_NAME, SEQ_IN_INDEX;
|
||||
|
||||
-- 验证新增字段是否存在
|
||||
SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 9 THEN '✅ 所有新增字段都存在'
|
||||
ELSE CONCAT('❌ 缺少字段,只找到 ', COUNT(*), ' 个,应该是 9 个')
|
||||
END AS validation_result
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
AND TABLE_NAME = 'conversation'
|
||||
AND COLUMN_NAME IN (
|
||||
'user_type', 'emotion_trend', 'keywords', 'ai_insights',
|
||||
'confidence', 'client_ip', 'user_agent', 'summary', 'tags'
|
||||
);
|
||||
|
||||
-- 验证新增索引是否存在
|
||||
SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 4 THEN '✅ 所有新增索引都存在'
|
||||
ELSE CONCAT('❌ 缺少索引,只找到 ', COUNT(*), ' 个,应该是 4 个')
|
||||
END AS index_validation_result
|
||||
FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
AND TABLE_NAME = 'conversation'
|
||||
AND INDEX_NAME IN (
|
||||
'idx_conversation_user_type',
|
||||
'idx_conversation_emotion_trend',
|
||||
'idx_conversation_confidence',
|
||||
'idx_conversation_client_ip'
|
||||
);
|
||||
|
||||
-- 统计总表数
|
||||
SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 15 THEN '✅ 所有15个表都创建成功'
|
||||
ELSE CONCAT('❌ 表数量不正确,只有 ', COUNT(*), ' 个表,应该是 15 个')
|
||||
END AS table_count_result
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum';
|
||||
|
||||
-- 统计总索引数(conversation表)
|
||||
SELECT
|
||||
CONCAT('conversation表共有 ', COUNT(DISTINCT INDEX_NAME), ' 个索引') AS conversation_index_count
|
||||
FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = 'emotion_museum'
|
||||
AND TABLE_NAME = 'conversation';
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "=== 验证后端模块启动状态 ==="
|
||||
|
||||
modules=(
|
||||
"emotion-auth:19003"
|
||||
"emotion-record:19004"
|
||||
"emotion-growth:19005"
|
||||
"emotion-explore:19006"
|
||||
"emotion-reward:19007"
|
||||
"emotion-stats:19008"
|
||||
"emotion-common:无端口"
|
||||
)
|
||||
|
||||
for module_info in "${modules[@]}"; do
|
||||
module=$(echo $module_info | cut -d: -f1)
|
||||
port=$(echo $module_info | cut -d: -f2)
|
||||
|
||||
echo "--- 验证模块: $module ---"
|
||||
|
||||
if [ ! -d "$module" ]; then
|
||||
echo "❌ 模块目录不存在: $module"
|
||||
continue
|
||||
fi
|
||||
|
||||
cd $module
|
||||
|
||||
# 检查是否有主类
|
||||
if [ "$module" = "emotion-common" ]; then
|
||||
echo "✅ emotion-common 是公共模块,无需启动"
|
||||
cd ..
|
||||
continue
|
||||
fi
|
||||
|
||||
# 尝试编译
|
||||
echo "编译模块..."
|
||||
mvn compile -q
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ 编译失败: $module"
|
||||
cd ..
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查主类是否存在
|
||||
main_class_found=$(find src/main/java -name "*Application.java" | wc -l)
|
||||
if [ $main_class_found -eq 0 ]; then
|
||||
echo "❌ 未找到主类: $module"
|
||||
cd ..
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "✅ 模块 $module 编译成功,具有主类"
|
||||
cd ..
|
||||
done
|
||||
|
||||
echo "=== 验证完成 ==="
|
||||
@@ -1,144 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ============================================================================
|
||||
# 验证所有微服务的Nacos配置
|
||||
# 检查配置文件是否正确生成,端口是否正确配置
|
||||
# ============================================================================
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}验证微服务Nacos配置${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
|
||||
# 服务配置
|
||||
SERVICES="emotion-gateway:19000 emotion-user:19001 emotion-ai:19002 emotion-record:19003 emotion-growth:19004 emotion-explore:19005 emotion-reward:19006 emotion-websocket:19007 emotion-stats:19008"
|
||||
|
||||
# 验证配置文件
|
||||
verify_config_file() {
|
||||
local service_name=$1
|
||||
local port=$2
|
||||
local env=$3
|
||||
local config_file="backend/${service_name}/src/main/resources/application-${env}.yml"
|
||||
|
||||
if [ ! -f "$config_file" ]; then
|
||||
echo -e "${RED} ❌ 配置文件不存在: $config_file${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 检查Nacos配置
|
||||
if ! grep -q "nacos:" "$config_file"; then
|
||||
echo -e "${RED} ❌ 缺少Nacos配置${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 检查服务发现配置
|
||||
if ! grep -q "discovery:" "$config_file"; then
|
||||
echo -e "${RED} ❌ 缺少服务发现配置${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 检查数据源配置(除了网关)
|
||||
if [ "$service_name" != "emotion-gateway" ]; then
|
||||
if ! grep -q "datasource:" "$config_file"; then
|
||||
echo -e "${RED} ❌ 缺少数据源配置${NC}"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 检查Redis配置
|
||||
if ! grep -q "redis:" "$config_file"; then
|
||||
echo -e "${RED} ❌ 缺少Redis配置${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN} ✅ $env 环境配置正确${NC}"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 验证主配置文件端口
|
||||
verify_main_config() {
|
||||
local service_name=$1
|
||||
local expected_port=$2
|
||||
local main_config="backend/${service_name}/src/main/resources/application.yml"
|
||||
|
||||
if [ ! -f "$main_config" ]; then
|
||||
echo -e "${RED} ❌ 主配置文件不存在: $main_config${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 检查端口配置
|
||||
local actual_port=$(grep "port:" "$main_config" | head -1 | awk '{print $2}')
|
||||
if [ "$actual_port" != "$expected_port" ]; then
|
||||
echo -e "${RED} ❌ 端口配置错误: 期望 $expected_port, 实际 $actual_port${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN} ✅ 主配置端口正确: $expected_port${NC}"
|
||||
return 0
|
||||
}
|
||||
|
||||
# 统计结果
|
||||
total_services=0
|
||||
success_services=0
|
||||
failed_services=0
|
||||
|
||||
# 处理每个服务
|
||||
for service_info in $SERVICES; do
|
||||
service_name=$(echo $service_info | cut -d: -f1)
|
||||
port=$(echo $service_info | cut -d: -f2)
|
||||
|
||||
echo -e "${YELLOW}验证服务: $service_name (端口: $port)${NC}"
|
||||
total_services=$((total_services + 1))
|
||||
|
||||
# 检查服务目录是否存在
|
||||
if [ ! -d "backend/$service_name" ]; then
|
||||
echo -e "${RED} ❌ 服务目录不存在: backend/$service_name${NC}"
|
||||
failed_services=$((failed_services + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
# 验证主配置文件
|
||||
service_success=true
|
||||
if ! verify_main_config "$service_name" "$port"; then
|
||||
service_success=false
|
||||
fi
|
||||
|
||||
# 验证环境配置文件
|
||||
for env in local test prod; do
|
||||
if ! verify_config_file "$service_name" "$port" "$env"; then
|
||||
service_success=false
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$service_success" = true ]; then
|
||||
echo -e "${GREEN} ✅ $service_name 所有配置验证通过${NC}"
|
||||
success_services=$((success_services + 1))
|
||||
else
|
||||
echo -e "${RED} ❌ $service_name 配置验证失败${NC}"
|
||||
failed_services=$((failed_services + 1))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
# 显示统计结果
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "${BLUE}验证结果统计${NC}"
|
||||
echo -e "${BLUE}===========================================${NC}"
|
||||
echo -e "总服务数: ${BLUE}$total_services${NC}"
|
||||
echo -e "验证成功: ${GREEN}$success_services${NC}"
|
||||
echo -e "验证失败: ${RED}$failed_services${NC}"
|
||||
|
||||
if [ $failed_services -eq 0 ]; then
|
||||
echo -e "${GREEN}🎉 所有服务配置验证通过!${NC}"
|
||||
exit 0
|
||||
else
|
||||
echo -e "${RED}❌ 有 $failed_services 个服务配置存在问题${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,85 +0,0 @@
|
||||
# 后端模块启动验证报告
|
||||
|
||||
## 验证时间
|
||||
2025-07-16 10:38
|
||||
|
||||
## 验证方法
|
||||
使用 `mvn spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=local"` 命令逐个验证每个模块
|
||||
|
||||
## 验证结果
|
||||
|
||||
### ✅ 成功启动的模块 (7个)
|
||||
|
||||
| 模块名称 | 端口 | 状态 | 健康检查 | 备注 |
|
||||
|---------|------|------|----------|------|
|
||||
| emotion-user | 19001 | ✅ 启动成功 | ✅ UP | 用户服务,包含认证功能 |
|
||||
| emotion-ai | 19002 | ✅ 启动成功 | ✅ UP | AI对话服务,集成Coze API |
|
||||
| emotion-gateway | 19000 | ✅ 启动成功 | ✅ UP | 网关服务,路由配置正确 |
|
||||
| emotion-record | 19003 | ✅ 启动成功 | ✅ UP | 记录服务 |
|
||||
| emotion-growth | 19004 | ✅ 启动成功 | ✅ UP | 成长服务 |
|
||||
| emotion-explore | - | ✅ 编译成功 | - | 探索服务,有主类 |
|
||||
| emotion-reward | - | ✅ 编译成功 | - | 奖励服务,有主类 |
|
||||
| emotion-stats | - | ✅ 编译成功 | - | 统计服务,有主类 |
|
||||
|
||||
### ⚠️ 特殊情况的模块 (2个)
|
||||
|
||||
| 模块名称 | 状态 | 说明 |
|
||||
|---------|------|------|
|
||||
| emotion-auth | ⚠️ 无主类 | 认证模块,可能是公共库而非独立服务 |
|
||||
| emotion-common | ✅ 公共模块 | 公共工具模块,无需独立启动 |
|
||||
|
||||
## 详细验证信息
|
||||
|
||||
### 核心服务验证
|
||||
1. **emotion-user (19001)**
|
||||
- 启动时间: ~7秒
|
||||
- 数据库连接: ✅ MySQL
|
||||
- Redis连接: ✅
|
||||
- 安全配置: ✅ JWT认证
|
||||
- 循环依赖问题: ✅ 已解决
|
||||
|
||||
2. **emotion-ai (19002)**
|
||||
- 启动时间: ~8秒
|
||||
- 数据库连接: ✅ MySQL
|
||||
- Redis连接: ✅
|
||||
- Coze API配置: ✅
|
||||
|
||||
3. **emotion-gateway (19000)**
|
||||
- 启动时间: ~13秒
|
||||
- 路由配置: ✅ 4个路由规则
|
||||
- 负载均衡: ✅ Spring Cloud LoadBalancer
|
||||
- 限流配置: ✅ Sentinel
|
||||
|
||||
### 业务服务验证
|
||||
4. **emotion-record (19003)**
|
||||
- 启动时间: ~5秒
|
||||
- 数据库连接: ✅ MySQL
|
||||
- Redis连接: ✅
|
||||
|
||||
5. **emotion-growth (19004)**
|
||||
- 启动时间: ~4秒
|
||||
- 数据库连接: ✅ MySQL
|
||||
- Redis连接: ✅
|
||||
|
||||
## 共同特征
|
||||
- 所有服务都使用Spring Boot 3.0.2
|
||||
- 所有服务都集成了Nacos配置中心
|
||||
- 所有服务都支持多环境配置(local/dev/prod)
|
||||
- 所有服务都包含Actuator健康检查端点
|
||||
- 所有服务都使用MySQL + Redis
|
||||
- 所有服务都支持热重载(DevTools)
|
||||
|
||||
## 启动命令验证
|
||||
✅ 所有可启动的模块都支持标准的Maven Spring Boot启动命令:
|
||||
```bash
|
||||
mvn spring-boot:run -Dspring-boot.run.arguments="--spring.profiles.active=local"
|
||||
```
|
||||
|
||||
## 总结
|
||||
- **总模块数**: 10个
|
||||
- **可独立启动**: 8个
|
||||
- **验证成功**: 5个完整验证 + 3个编译验证
|
||||
- **公共模块**: 2个
|
||||
- **成功率**: 100% (所有预期可启动的模块都能正常启动)
|
||||
|
||||
所有后端模块都可以通过mvn spring-boot:run正常启动!
|
||||
@@ -1,111 +0,0 @@
|
||||
# 数据库字段更新总结
|
||||
|
||||
## 📋 更新概述
|
||||
|
||||
**更新时间**: 2025-07-13
|
||||
**更新版本**: v3.1
|
||||
**更新原因**: 修复AI模块与数据库字段不匹配问题
|
||||
|
||||
## 🔧 问题背景
|
||||
|
||||
在启动AI服务时遇到以下错误:
|
||||
```
|
||||
Unknown column 'user_type' in 'field list'
|
||||
```
|
||||
|
||||
**根本原因**: Java实体类 `Conversation.java` 中定义的字段与数据库表 `conversation` 的字段不匹配。
|
||||
|
||||
## 📊 新增字段详情
|
||||
|
||||
### conversation表新增字段
|
||||
|
||||
| 字段名 | 数据类型 | 默认值 | 说明 |
|
||||
|--------|----------|--------|------|
|
||||
| `user_type` | VARCHAR(20) | 'registered' | 用户类型: registered-注册用户, guest-访客用户 |
|
||||
| `emotion_trend` | VARCHAR(50) | NULL | 情绪趋势 |
|
||||
| `keywords` | JSON | NULL | 关键词 |
|
||||
| `ai_insights` | TEXT | NULL | AI洞察 |
|
||||
| `confidence` | DECIMAL(3,2) | NULL | 分析置信度 |
|
||||
| `client_ip` | VARCHAR(45) | NULL | 客户端IP地址 (支持IPv6) |
|
||||
| `user_agent` | TEXT | NULL | 用户代理信息 |
|
||||
| `summary` | TEXT | NULL | 对话摘要 |
|
||||
| `tags` | JSON | NULL | 标签 |
|
||||
|
||||
### 新增索引
|
||||
|
||||
| 索引名 | 字段 | 用途 |
|
||||
|--------|------|------|
|
||||
| `idx_conversation_user_type` | user_type | 按用户类型查询优化 |
|
||||
| `idx_conversation_emotion_trend` | emotion_trend | 按情绪趋势查询优化 |
|
||||
| `idx_conversation_confidence` | confidence | 按置信度查询优化 |
|
||||
| `idx_conversation_client_ip` | client_ip | 按IP地址查询优化 |
|
||||
|
||||
## 🛠️ 执行的操作
|
||||
|
||||
### 1. 临时修复(已执行)
|
||||
通过ALTER TABLE语句临时添加缺失字段:
|
||||
```sql
|
||||
ALTER TABLE conversation ADD COLUMN user_type VARCHAR(20) NOT NULL DEFAULT 'registered' COMMENT '用户类型: registered-注册用户, guest-访客用户' AFTER user_id;
|
||||
-- ... 其他字段
|
||||
```
|
||||
|
||||
### 2. 脚本更新(已完成)
|
||||
更新 `mysql_emotion_museum_final.sql` 脚本:
|
||||
- ✅ 在CREATE TABLE语句中添加所有新字段
|
||||
- ✅ 添加相应的索引定义
|
||||
- ✅ 更新字段注释和说明
|
||||
|
||||
### 3. 服务重启(已完成)
|
||||
- ✅ 重启AI服务以获取新的数据库连接
|
||||
- ✅ 验证服务正常启动
|
||||
|
||||
## ✅ 验证结果
|
||||
|
||||
### 服务状态
|
||||
- ✅ Gateway服务 (端口9000) - 运行正常
|
||||
- ✅ AI服务 (端口9002) - 运行正常,字段问题已解决
|
||||
- ✅ Web前端 (端口3000) - 运行正常
|
||||
|
||||
### 数据库验证
|
||||
可以使用以下脚本验证更新结果:
|
||||
```bash
|
||||
mysql -u root -p emotion_museum < verify-database-script.sql
|
||||
```
|
||||
|
||||
## 🔄 影响范围
|
||||
|
||||
### 正面影响
|
||||
- ✅ 修复AI服务启动错误
|
||||
- ✅ 支持访客用户功能
|
||||
- ✅ 增强对话数据分析能力
|
||||
- ✅ 提供更丰富的用户行为追踪
|
||||
|
||||
### 兼容性
|
||||
- ✅ 向后兼容:新字段都允许NULL或有默认值
|
||||
- ✅ 现有数据不受影响
|
||||
- ✅ 现有API接口继续正常工作
|
||||
|
||||
## 📝 后续建议
|
||||
|
||||
### 开发流程改进
|
||||
1. **字段同步检查**: 在添加实体类字段时,同步更新数据库脚本
|
||||
2. **自动化测试**: 增加数据库字段一致性检查
|
||||
3. **版本管理**: 建立数据库版本管理机制
|
||||
|
||||
### 监控建议
|
||||
1. 监控新字段的使用情况
|
||||
2. 关注访客用户的数据增长
|
||||
3. 定期检查索引性能
|
||||
|
||||
## 🔗 相关文件
|
||||
|
||||
- `backend/mysql_emotion_museum_final.sql` - 更新后的数据库脚本
|
||||
- `backend/verify-database-script.sql` - 验证脚本
|
||||
- `backend/数据库脚本版本说明.md` - 版本说明文档
|
||||
- `backend/emotion-ai/src/main/java/com/emotionmuseum/ai/entity/Conversation.java` - 实体类
|
||||
|
||||
---
|
||||
|
||||
**更新完成时间**: 2025-07-13 10:50
|
||||
**更新状态**: ✅ 完成
|
||||
**验证状态**: ✅ 通过
|
||||
@@ -1,181 +0,0 @@
|
||||
# 数据库无外键设计说明
|
||||
|
||||
## 📋 设计原则
|
||||
|
||||
### 🚫 不使用外键约束
|
||||
本项目采用无外键约束的数据库设计,通过应用层代码维护数据关联关系。
|
||||
|
||||
## 🎯 设计理由
|
||||
|
||||
### 1. 性能优化
|
||||
- **减少约束检查**: 数据库不需要在每次插入/更新时检查外键约束
|
||||
- **提高并发性**: 避免外键锁定导致的并发问题
|
||||
- **加快批量操作**: 大批量数据导入时无需考虑外键顺序
|
||||
|
||||
### 2. 开发灵活性
|
||||
- **表结构调整**: 修改表结构时不需要先删除外键约束
|
||||
- **数据迁移**: 数据迁移和同步更加简单
|
||||
- **测试便利**: 测试数据准备更加灵活
|
||||
|
||||
### 3. 分布式友好
|
||||
- **微服务架构**: 不同微服务可以独立管理自己的数据表
|
||||
- **数据分片**: 便于后期进行数据库分片和分布式部署
|
||||
- **跨库关联**: 支持跨数据库的数据关联
|
||||
|
||||
### 4. 维护简化
|
||||
- **避免级联问题**: 不会因为外键级联操作导致意外的数据删除
|
||||
- **减少死锁**: 降低因外键约束导致的数据库死锁概率
|
||||
- **简化备份恢复**: 数据备份和恢复时无需考虑外键依赖顺序
|
||||
|
||||
## 🔗 关联关系维护
|
||||
|
||||
### 代码层面维护
|
||||
通过业务代码确保数据一致性:
|
||||
|
||||
```java
|
||||
// 示例:创建对话时关联用户
|
||||
@Service
|
||||
public class ConversationService {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private ConversationMapper conversationMapper;
|
||||
|
||||
public Conversation createConversation(String userId, String title) {
|
||||
// 1. 验证用户是否存在
|
||||
User user = userService.getById(userId);
|
||||
if (user == null) {
|
||||
throw new BusinessException("用户不存在");
|
||||
}
|
||||
|
||||
// 2. 创建对话
|
||||
Conversation conversation = new Conversation();
|
||||
conversation.setUserId(userId); // 通过ID关联,不使用外键
|
||||
conversation.setTitle(title);
|
||||
|
||||
conversationMapper.insert(conversation);
|
||||
return conversation;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 数据一致性保证
|
||||
1. **业务层验证**: 在业务逻辑中验证关联数据的存在性
|
||||
2. **事务管理**: 使用数据库事务确保操作的原子性
|
||||
3. **定期检查**: 定期运行数据一致性检查脚本
|
||||
|
||||
## 📊 表关联关系
|
||||
|
||||
### 主要关联关系
|
||||
```
|
||||
user (用户表)
|
||||
├── conversation.user_id → user.id
|
||||
├── emotion_record.user_id → user.id
|
||||
├── community_post.user_id → user.id
|
||||
└── user_stats.user_id → user.id
|
||||
|
||||
conversation (对话表)
|
||||
├── message.conversation_id → conversation.id
|
||||
└── coze_api_call.conversation_id → conversation.id
|
||||
|
||||
message (消息表)
|
||||
├── emotion_analysis.message_id → message.id
|
||||
└── coze_api_call.message_id → message.id
|
||||
|
||||
community_post (社区帖子表)
|
||||
└── comment.post_id → community_post.id
|
||||
|
||||
growth_topic (成长课题表)
|
||||
├── topic_interaction.topic_id → growth_topic.id
|
||||
└── reward.topic_id → growth_topic.id
|
||||
|
||||
achievement (成就表)
|
||||
└── reward.achievement_id → achievement.id
|
||||
```
|
||||
|
||||
### 关联字段命名规范
|
||||
- **外部ID字段**: 统一使用 `{table_name}_id` 格式
|
||||
- **主键字段**: 统一使用 `id`
|
||||
- **数据类型**: 统一使用 `VARCHAR(36)` 雪花算法ID
|
||||
|
||||
## 🛡️ 数据完整性保证
|
||||
|
||||
### 1. 应用层验证
|
||||
```java
|
||||
// 删除用户前检查关联数据
|
||||
public void deleteUser(String userId) {
|
||||
// 检查是否有关联的对话
|
||||
if (conversationService.countByUserId(userId) > 0) {
|
||||
throw new BusinessException("用户存在关联对话,无法删除");
|
||||
}
|
||||
|
||||
// 检查是否有关联的情绪记录
|
||||
if (emotionRecordService.countByUserId(userId) > 0) {
|
||||
throw new BusinessException("用户存在情绪记录,无法删除");
|
||||
}
|
||||
|
||||
userService.deleteById(userId);
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 定期数据检查
|
||||
```sql
|
||||
-- 检查孤立的对话记录(用户不存在)
|
||||
SELECT c.id, c.user_id
|
||||
FROM conversation c
|
||||
LEFT JOIN user u ON c.user_id = u.id
|
||||
WHERE u.id IS NULL AND c.is_deleted = 0;
|
||||
|
||||
-- 检查孤立的消息记录(对话不存在)
|
||||
SELECT m.id, m.conversation_id
|
||||
FROM message m
|
||||
LEFT JOIN conversation c ON m.conversation_id = c.id
|
||||
WHERE c.id IS NULL AND m.is_deleted = 0;
|
||||
```
|
||||
|
||||
### 3. 软删除策略
|
||||
- 使用 `is_deleted` 字段标记删除状态
|
||||
- 保留历史数据,避免硬删除导致的关联数据问题
|
||||
- 定期清理真正需要删除的数据
|
||||
|
||||
## 🔧 最佳实践
|
||||
|
||||
### 1. 服务层设计
|
||||
- **单一职责**: 每个服务只管理自己的数据表
|
||||
- **接口调用**: 跨表查询通过服务接口调用
|
||||
- **缓存策略**: 合理使用缓存减少跨表查询
|
||||
|
||||
### 2. 查询优化
|
||||
- **索引设计**: 为关联字段创建合适的索引
|
||||
- **批量查询**: 使用 IN 查询减少数据库访问次数
|
||||
- **分页处理**: 大数据量查询时合理分页
|
||||
|
||||
### 3. 数据迁移
|
||||
- **脚本化**: 数据迁移操作脚本化,可重复执行
|
||||
- **验证机制**: 迁移后验证数据完整性
|
||||
- **回滚方案**: 准备数据回滚方案
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
### 1. 开发规范
|
||||
- 严格按照关联关系进行数据操作
|
||||
- 删除数据前必须检查关联关系
|
||||
- 使用事务确保数据一致性
|
||||
|
||||
### 2. 监控告警
|
||||
- 监控孤立数据的产生
|
||||
- 定期检查数据一致性
|
||||
- 异常情况及时告警
|
||||
|
||||
### 3. 文档维护
|
||||
- 及时更新关联关系文档
|
||||
- 记录数据操作规范
|
||||
- 维护数据字典
|
||||
|
||||
---
|
||||
|
||||
**设计原则**: 简单、高效、可维护
|
||||
**实施策略**: 代码约束 + 定期检查
|
||||
**适用场景**: 微服务架构 + 高并发系统
|
||||
@@ -1,159 +0,0 @@
|
||||
# 数据库脚本使用说明
|
||||
|
||||
## 📋 脚本信息
|
||||
|
||||
- **脚本名称**: `mysql_emotion_museum_final.sql`
|
||||
- **版本**: v3.0 Final (雪花算法主键版本) - 开发版本
|
||||
- **数据库类型**: MySQL 8.0+
|
||||
- **字符集**: utf8mb4
|
||||
- **主键类型**: VARCHAR(36) 使用雪花算法生成
|
||||
- **关联策略**: 无外键约束,通过代码中的ID字段关联
|
||||
|
||||
## ⚠️ 开发版本特性
|
||||
|
||||
### 🔄 DROP & CREATE 模式
|
||||
该脚本针对开发阶段优化,采用先删除再创建的策略:
|
||||
|
||||
1. **数据库创建**: 使用 `CREATE DATABASE IF NOT EXISTS`
|
||||
2. **表删除**: 先删除所有现有表 `DROP TABLE IF EXISTS`
|
||||
3. **表创建**: 重新创建所有表结构
|
||||
4. **索引创建**: 创建所有优化索引
|
||||
5. **事务控制**: 使用事务确保原子性操作
|
||||
|
||||
### ⚠️ 重要警告
|
||||
- **数据丢失**: 每次执行都会删除所有现有数据
|
||||
- **仅限开发**: 此版本仅适用于开发环境
|
||||
- **表结构更新**: 确保表结构始终是最新的
|
||||
- **快速迭代**: 适合频繁调整表结构的开发阶段
|
||||
|
||||
## 🚀 使用方法
|
||||
|
||||
### 方法1: 命令行执行
|
||||
```bash
|
||||
# 进入backend目录
|
||||
cd backend
|
||||
|
||||
# 执行脚本(需要输入MySQL root密码)
|
||||
mysql -u root -p < mysql_emotion_museum_final.sql
|
||||
```
|
||||
|
||||
### 方法2: MySQL客户端执行
|
||||
```sql
|
||||
-- 连接到MySQL
|
||||
mysql -u root -p
|
||||
|
||||
-- 执行脚本
|
||||
source /path/to/backend/mysql_emotion_museum_final.sql;
|
||||
```
|
||||
|
||||
### 方法3: 图形化工具执行
|
||||
- 使用 MySQL Workbench、phpMyAdmin 等工具
|
||||
- 打开脚本文件并执行
|
||||
|
||||
## 📊 执行结果
|
||||
|
||||
### 成功执行后会显示:
|
||||
1. **完成消息**: 确认部署成功
|
||||
2. **表统计**: 显示创建的表数量
|
||||
3. **表列表**: 显示所有创建的表及其注释
|
||||
|
||||
### 预期输出示例:
|
||||
```
|
||||
message: Emotion Museum Database v3.0 Final (雪花算法主键版本) - 开发版本 deployment completed successfully!
|
||||
completion_time: 2025-07-13 10:30:00
|
||||
description: All tables dropped and recreated with VARCHAR(36) primary keys. Development version - data will be lost on re-execution!
|
||||
|
||||
total_tables: 15
|
||||
|
||||
table_name | comment | engine
|
||||
--------------------|----------------|--------
|
||||
achievement | 成就表 | InnoDB
|
||||
coze_api_call | Coze API调用表 | InnoDB
|
||||
comment | 评论表 | InnoDB
|
||||
community_post | 社区帖子表 | InnoDB
|
||||
conversation | 对话表 | InnoDB
|
||||
emotion_analysis | 情绪分析表 | InnoDB
|
||||
emotion_record | 情绪记录表 | InnoDB
|
||||
growth_topic | 成长课题表 | InnoDB
|
||||
guest_user | 访客用户表 | InnoDB
|
||||
location_pin | 地点标记表 | InnoDB
|
||||
message | 消息表 | InnoDB
|
||||
reward | 奖励表 | InnoDB
|
||||
topic_interaction | 课题互动表 | InnoDB
|
||||
user | 用户表 | InnoDB
|
||||
user_stats | 用户统计表 | InnoDB
|
||||
```
|
||||
|
||||
## 🔧 脚本内容
|
||||
|
||||
### 创建的数据库表 (15个)
|
||||
1. **user** - 用户表
|
||||
2. **conversation** - 对话表
|
||||
3. **message** - 消息表
|
||||
4. **coze_api_call** - Coze API调用表
|
||||
5. **emotion_analysis** - 情绪分析表
|
||||
6. **emotion_record** - 情绪记录表
|
||||
7. **growth_topic** - 成长课题表
|
||||
8. **topic_interaction** - 课题互动表
|
||||
9. **location_pin** - 地点标记表
|
||||
10. **community_post** - 社区帖子表
|
||||
11. **comment** - 评论表
|
||||
12. **achievement** - 成就表
|
||||
13. **reward** - 奖励表
|
||||
14. **guest_user** - 访客用户表
|
||||
15. **user_stats** - 用户统计表
|
||||
|
||||
### 创建的索引 (131个)
|
||||
- 为所有表的关键字段创建了优化索引
|
||||
- 包括单列索引和复合索引
|
||||
- 针对查询性能进行了优化
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
### 执行前检查
|
||||
1. **MySQL版本**: 确保使用MySQL 8.0+
|
||||
2. **权限**: 确保有创建数据库和表的权限
|
||||
3. **磁盘空间**: 确保有足够的磁盘空间
|
||||
4. **备份**: 如果是生产环境,建议先备份
|
||||
|
||||
### 重复执行说明
|
||||
- ⚠️ **数据丢失**: 每次执行都会删除所有现有数据
|
||||
- 🔄 **表重建**: 所有表都会被删除并重新创建
|
||||
- 📊 **结构更新**: 确保表结构始终是最新版本
|
||||
- 📝 **日志**: 建议保存执行日志以便排查问题
|
||||
|
||||
### 常见问题
|
||||
1. **权限不足**: 确保MySQL用户有足够权限
|
||||
2. **字符集问题**: 确保MySQL支持utf8mb4字符集
|
||||
3. **存储引擎**: 确保MySQL支持InnoDB存储引擎
|
||||
4. **数据备份**: 开发版本会删除数据,生产环境请谨慎使用
|
||||
|
||||
## 🧪 测试验证
|
||||
|
||||
### 验证脚本
|
||||
项目中包含测试脚本 `test-sql-repeatability.sql` 用于验证可重复执行性:
|
||||
|
||||
```bash
|
||||
mysql -u root -p < test-sql-repeatability.sql
|
||||
```
|
||||
|
||||
### 验证步骤
|
||||
1. 首次执行主脚本
|
||||
2. 再次执行主脚本
|
||||
3. 检查表结构和数据完整性
|
||||
4. 验证索引是否正确创建
|
||||
|
||||
## 📞 技术支持
|
||||
|
||||
如果在执行过程中遇到问题:
|
||||
1. 检查MySQL错误日志
|
||||
2. 确认MySQL版本和配置
|
||||
3. 验证用户权限设置
|
||||
4. 查看脚本执行输出
|
||||
|
||||
---
|
||||
|
||||
**更新时间**: 2025-07-13
|
||||
**脚本版本**: v3.0 Final - 开发版本
|
||||
**特性**: DROP & CREATE 模式 ⚠️
|
||||
**警告**: 会删除现有数据,仅限开发环境使用
|
||||
@@ -1,153 +0,0 @@
|
||||
# 数据库脚本版本说明
|
||||
|
||||
## 📋 当前可用脚本
|
||||
|
||||
### 🔧 开发版本(当前使用)
|
||||
- **文件名**: `mysql_emotion_museum_final.sql`
|
||||
- **版本**: v3.0 Final - 开发版本
|
||||
- **特性**: DROP & CREATE 模式
|
||||
- **关联策略**: 无外键约束,代码层维护关联
|
||||
- **适用**: 开发环境
|
||||
|
||||
#### ⚠️ 开发版本特点
|
||||
- **先删除后创建**: 每次执行都会删除所有现有表
|
||||
- **数据丢失**: 会清空所有现有数据
|
||||
- **表结构最新**: 确保表结构始终是最新版本
|
||||
- **快速迭代**: 适合频繁调整表结构的开发阶段
|
||||
|
||||
#### 🚀 使用场景
|
||||
- ✅ 本地开发环境
|
||||
- ✅ 测试环境
|
||||
- ✅ 表结构调整频繁的开发阶段
|
||||
- ❌ 生产环境(会丢失数据)
|
||||
|
||||
## 🔄 脚本执行流程
|
||||
|
||||
### 开发版本执行流程
|
||||
1. **设置环境**: 配置SQL模式和字符集
|
||||
2. **禁用外键检查**: 便于删除表
|
||||
3. **创建数据库**: 如果不存在则创建
|
||||
4. **删除现有表**: 按依赖关系顺序删除所有表
|
||||
5. **创建新表**: 重新创建所有15个表
|
||||
6. **创建索引**: 创建所有131个优化索引
|
||||
7. **重新启用外键检查**: 恢复外键约束
|
||||
8. **提交事务**: 确保原子性操作
|
||||
|
||||
## 📊 表结构信息
|
||||
|
||||
### 创建的表 (15个)
|
||||
1. **user** - 用户表
|
||||
2. **conversation** - 对话表
|
||||
3. **message** - 消息表
|
||||
4. **coze_api_call** - Coze API调用表
|
||||
5. **emotion_analysis** - 情绪分析表
|
||||
6. **emotion_record** - 情绪记录表
|
||||
7. **growth_topic** - 成长课题表
|
||||
8. **topic_interaction** - 课题互动表
|
||||
9. **location_pin** - 地点标记表
|
||||
10. **community_post** - 社区帖子表
|
||||
11. **comment** - 评论表
|
||||
12. **achievement** - 成就表
|
||||
13. **reward** - 奖励表
|
||||
14. **guest_user** - 访客用户表
|
||||
15. **user_stats** - 用户统计表
|
||||
|
||||
### 索引统计
|
||||
- **总索引数**: 131个
|
||||
- **单列索引**: 主要字段的查询优化
|
||||
- **复合索引**: 多字段组合查询优化
|
||||
- **唯一索引**: 通过表定义的UNIQUE约束自动创建
|
||||
|
||||
## 🛠️ 使用方法
|
||||
|
||||
### 执行命令
|
||||
```bash
|
||||
# 进入backend目录
|
||||
cd backend
|
||||
|
||||
# 执行开发版本脚本
|
||||
mysql -u root -p < mysql_emotion_museum_final.sql
|
||||
```
|
||||
|
||||
### 执行前检查
|
||||
- ✅ 确认是开发环境
|
||||
- ✅ 备份重要数据(如有)
|
||||
- ✅ 确认MySQL版本 8.0+
|
||||
- ✅ 确认用户权限充足
|
||||
|
||||
## ⚠️ 重要提醒
|
||||
|
||||
### 数据安全
|
||||
- **开发版本会删除所有数据**
|
||||
- **每次执行都是全新开始**
|
||||
- **不适合有重要数据的环境**
|
||||
|
||||
### 版本选择建议
|
||||
- **开发阶段**: 使用当前开发版本
|
||||
- **测试阶段**: 可以使用开发版本
|
||||
- **生产部署**: 需要创建生产安全版本
|
||||
|
||||
## 🔮 未来计划
|
||||
|
||||
### 生产版本特性(待开发)
|
||||
- 使用 `CREATE TABLE IF NOT EXISTS`
|
||||
- 保护现有数据不被删除
|
||||
- 支持增量更新和迁移
|
||||
- 包含数据迁移脚本
|
||||
|
||||
### 版本管理
|
||||
- 开发版本: 快速迭代,数据重置
|
||||
- 生产版本: 安全升级,数据保护
|
||||
- 迁移脚本: 版本间数据迁移
|
||||
|
||||
## 📞 技术支持
|
||||
|
||||
### 常见问题
|
||||
1. **执行失败**: 检查MySQL权限和版本
|
||||
2. **数据丢失**: 开发版本的正常行为
|
||||
3. **表结构错误**: 重新执行脚本即可修复
|
||||
|
||||
### 联系方式
|
||||
- 查看执行日志排查问题
|
||||
- 确认环境配置是否正确
|
||||
- 验证MySQL服务状态
|
||||
|
||||
## 📝 版本更新记录
|
||||
|
||||
### v3.1 (2025-07-13) - conversation表字段完善
|
||||
**🔧 重要更新:修复AI模块数据库字段不匹配问题**
|
||||
|
||||
#### 新增字段
|
||||
- `user_type` VARCHAR(20) - 用户类型 (registered/guest)
|
||||
- `emotion_trend` VARCHAR(50) - 情绪趋势
|
||||
- `keywords` JSON - 关键词
|
||||
- `ai_insights` TEXT - AI洞察
|
||||
- `confidence` DECIMAL(3,2) - 分析置信度
|
||||
- `client_ip` VARCHAR(45) - 客户端IP地址 (支持IPv6)
|
||||
- `user_agent` TEXT - 用户代理信息
|
||||
- `summary` TEXT - 对话摘要
|
||||
- `tags` JSON - 标签
|
||||
|
||||
#### 新增索引
|
||||
- `idx_conversation_user_type` - 用户类型索引
|
||||
- `idx_conversation_emotion_trend` - 情绪趋势索引
|
||||
- `idx_conversation_confidence` - 分析置信度索引
|
||||
- `idx_conversation_client_ip` - 客户端IP索引
|
||||
|
||||
#### 解决问题
|
||||
- ✅ 修复AI服务启动时的 `Unknown column 'user_type'` 错误
|
||||
- ✅ 确保Java实体类与数据库表结构完全匹配
|
||||
- ✅ 支持访客用户和注册用户的区分管理
|
||||
- ✅ 增强对话数据的分析和统计能力
|
||||
|
||||
### v3.0 (2025-07-12) - 初始开发版本
|
||||
- 创建15个核心数据表
|
||||
- 实现雪花算法主键策略
|
||||
- 添加131个优化索引
|
||||
- 支持完整的情绪博物馆功能模块
|
||||
|
||||
---
|
||||
|
||||
**更新时间**: 2025-07-13
|
||||
**当前版本**: v3.1 - conversation表字段完善版本
|
||||
**状态**: 开发中 🚧
|
||||
@@ -1,168 +0,0 @@
|
||||
# 情绪博物馆数据库雪花算法主键实施总结
|
||||
|
||||
## 📋 任务完成情况
|
||||
|
||||
### ✅ 已完成任务
|
||||
|
||||
1. **收集和分析数据库相关文件** ✅
|
||||
- 扫描了项目中所有的数据库变更语句、实体类和相关配置文件
|
||||
- 分析了当前数据库结构和实体类继承关系
|
||||
|
||||
2. **生成终版数据库初始化脚本** ✅
|
||||
- 更新了 `backend/mysql_emotion_museum_final.sql` 为 v3.0 版本
|
||||
- 所有主键使用 VARCHAR(36) 类型,支持雪花算法生成的字符串ID
|
||||
- 添加了缺失的 `guest_user` 表
|
||||
- 完善了所有表的索引配置
|
||||
|
||||
3. **实现雪花算法工具类** ✅
|
||||
- 创建了 `SnowflakeIdGenerator` 类,支持高性能ID生成
|
||||
- 创建了 `SnowflakeConfig` 配置类,支持自动机器ID分配
|
||||
- 实现了完整的测试用例,验证了并发安全性和唯一性
|
||||
|
||||
4. **更新EmotionMetaObjectHandler** ✅
|
||||
- 增加了主键自动填充逻辑
|
||||
- 当ID为空时自动使用雪花算法生成ID
|
||||
- 保持了异常安全性,不影响业务逻辑
|
||||
|
||||
5. **更新BaseEntity和所有实体类** ✅
|
||||
- 更新了 `BaseEntity` 使用 `IdType.INPUT` 配置
|
||||
- 修复了 `GuestUser` 实体类,使其继承 `BaseEntity`
|
||||
- 为所有模块创建了完整的实体类
|
||||
|
||||
6. **验证和测试** ✅
|
||||
- 项目编译成功,无语法错误
|
||||
- 雪花算法测试全部通过
|
||||
- 验证了ID生成的唯一性和并发安全性
|
||||
|
||||
## 🏗️ 架构改进
|
||||
|
||||
### 主键策略
|
||||
- **类型**: VARCHAR(36) → 避免前端JavaScript精度丢失
|
||||
- **生成**: 雪花算法 → 保证全局唯一性和高性能
|
||||
- **配置**: 自动机器ID分配 → 支持分布式部署
|
||||
|
||||
### 关联策略
|
||||
- **无外键约束**: 不使用数据库外键,避免复杂的约束管理
|
||||
- **代码关联**: 通过业务代码中的ID字段维护表间关联关系
|
||||
- **性能优化**: 减少数据库约束检查,提高插入和更新性能
|
||||
- **灵活性**: 便于数据迁移和表结构调整
|
||||
|
||||
### 数据库表结构
|
||||
- **15个核心表**: 覆盖用户、对话、情绪、成长、探索、奖励、统计等功能
|
||||
- **统一字段**: 所有表继承公共字段(id, create_by, create_time, update_by, update_time, is_deleted, remarks)
|
||||
- **完整索引**: 针对查询场景优化的索引配置
|
||||
|
||||
### 实体类设计
|
||||
- **继承体系**: 所有实体类继承 `BaseEntity`
|
||||
- **字段映射**: 使用 `@TableField` 注解明确字段映射
|
||||
- **类型处理**: JSON字段使用 `JacksonTypeHandler`
|
||||
|
||||
## 📁 文件清单
|
||||
|
||||
### 新增文件
|
||||
```
|
||||
backend/emotion-common/src/main/java/com/emotionmuseum/common/util/SnowflakeIdGenerator.java
|
||||
backend/emotion-common/src/main/java/com/emotionmuseum/common/config/SnowflakeConfig.java
|
||||
backend/emotion-common/src/test/java/com/emotionmuseum/common/util/SnowflakeIdGeneratorTest.java
|
||||
backend/emotion-record/src/main/java/com/emotionmuseum/record/entity/EmotionRecord.java
|
||||
backend/emotion-growth/src/main/java/com/emotionmuseum/growth/entity/GrowthTopic.java
|
||||
backend/emotion-growth/src/main/java/com/emotionmuseum/growth/entity/TopicInteraction.java
|
||||
backend/emotion-explore/src/main/java/com/emotionmuseum/explore/entity/LocationPin.java
|
||||
backend/emotion-explore/src/main/java/com/emotionmuseum/explore/entity/CommunityPost.java
|
||||
backend/emotion-explore/src/main/java/com/emotionmuseum/explore/entity/Comment.java
|
||||
backend/emotion-reward/src/main/java/com/emotionmuseum/reward/entity/Achievement.java
|
||||
backend/emotion-reward/src/main/java/com/emotionmuseum/reward/entity/Reward.java
|
||||
backend/emotion-stats/src/main/java/com/emotionmuseum/stats/entity/UserStats.java
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
```
|
||||
backend/mysql_emotion_museum_final.sql (v2.1 → v3.0)
|
||||
backend/emotion-common/src/main/java/com/emotionmuseum/common/entity/BaseEntity.java
|
||||
backend/emotion-common/src/main/java/com/emotionmuseum/common/handler/EmotionMetaObjectHandler.java
|
||||
backend/emotion-ai/src/main/java/com/emotionmuseum/ai/entity/GuestUser.java
|
||||
```
|
||||
|
||||
## 🔧 技术特性
|
||||
|
||||
### 雪花算法特性
|
||||
- **高性能**: 单机每毫秒可生成4096个ID
|
||||
- **全局唯一**: 64位长整型,转换为字符串避免精度丢失
|
||||
- **时间有序**: ID包含时间戳信息,天然有序
|
||||
- **分布式友好**: 支持1024个机器节点
|
||||
|
||||
### 自动填充特性
|
||||
- **主键自动生成**: ID为空时自动生成雪花算法ID
|
||||
- **时间自动填充**: 自动填充创建时间和更新时间
|
||||
- **用户信息填充**: 支持创建人和更新人信息
|
||||
- **逻辑删除**: 自动设置删除标记默认值
|
||||
|
||||
### 配置灵活性
|
||||
- **机器ID配置**: 支持配置文件指定或自动分配
|
||||
- **异常安全**: 自动填充失败不影响业务逻辑
|
||||
- **扩展性**: 支持批量ID生成和解析功能
|
||||
|
||||
## 🚀 使用方式
|
||||
|
||||
### 1. 数据库初始化
|
||||
```bash
|
||||
mysql -u root -p < backend/mysql_emotion_museum_final.sql
|
||||
```
|
||||
|
||||
### 2. 配置机器ID(可选)
|
||||
```yaml
|
||||
# application.yml
|
||||
snowflake:
|
||||
machine-id: 1 # 可选,不配置则自动分配
|
||||
```
|
||||
|
||||
### 3. 实体类使用
|
||||
```java
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("your_table")
|
||||
public class YourEntity extends BaseEntity {
|
||||
// 业务字段
|
||||
@TableField("your_field")
|
||||
private String yourField;
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 手动生成ID
|
||||
```java
|
||||
@Autowired
|
||||
private SnowflakeIdGenerator snowflakeIdGenerator;
|
||||
|
||||
public void generateId() {
|
||||
String id = snowflakeIdGenerator.nextIdAsString();
|
||||
// 使用生成的ID
|
||||
}
|
||||
```
|
||||
|
||||
## ✅ 验证结果
|
||||
|
||||
- ✅ 项目编译成功
|
||||
- ✅ 雪花算法测试通过(唯一性、并发安全性)
|
||||
- ✅ 数据库脚本语法正确
|
||||
- ✅ 实体类继承关系正确
|
||||
- ✅ 自动填充逻辑完整
|
||||
|
||||
## 📝 注意事项
|
||||
|
||||
1. **时钟回退**: 雪花算法依赖系统时钟,需要确保服务器时钟同步
|
||||
2. **机器ID**: 分布式部署时需要确保不同节点使用不同的机器ID
|
||||
3. **ID长度**: 生成的ID为19位数字字符串,前端需要使用字符串类型处理
|
||||
4. **数据库兼容**: 脚本针对MySQL 8.0+优化,其他版本可能需要调整
|
||||
|
||||
## 🎯 后续建议
|
||||
|
||||
1. **监控**: 建议添加ID生成性能监控
|
||||
2. **配置中心**: 考虑使用配置中心管理机器ID
|
||||
3. **测试**: 建议在生产环境前进行压力测试
|
||||
4. **文档**: 为开发团队提供使用指南
|
||||
|
||||
---
|
||||
|
||||
**实施完成时间**: 2025-07-13
|
||||
**版本**: v3.0 Final (雪花算法主键版本)
|
||||
**状态**: ✅ 全部完成
|
||||
@@ -1,205 +0,0 @@
|
||||
# 后端认证模块重构总结
|
||||
|
||||
## 重构目标
|
||||
|
||||
将后端登录鉴权逻辑集中到emotion-auth模块,从emotion-user模块中移除所有认证相关功能,实现职责分离。
|
||||
|
||||
## 重构内容
|
||||
|
||||
### 1. emotion-auth模块完善
|
||||
|
||||
#### 新增功能
|
||||
- **AuthController**: 用户认证控制器
|
||||
- 用户注册 `/auth/register`
|
||||
- 用户登录 `/auth/login`
|
||||
- 刷新Token `/auth/refresh`
|
||||
- 用户登出 `/auth/logout`
|
||||
- 验证Token `/auth/validate-token`
|
||||
- 获取用户信息 `/auth/user-info`
|
||||
- 检查账号/邮箱/手机号是否存在
|
||||
|
||||
- **AuthService**: 认证服务接口和实现
|
||||
- 完整的用户认证逻辑
|
||||
- JWT Token管理
|
||||
- 密码加密验证
|
||||
- 用户状态检查
|
||||
|
||||
- **User实体**: 用户数据模型
|
||||
- 完整的用户字段定义
|
||||
- 成长数据字段
|
||||
- 第三方登录支持
|
||||
|
||||
- **UserMapper**: 用户数据访问层
|
||||
- 基础CRUD操作
|
||||
- 按账号/邮箱/手机号查询
|
||||
- 第三方登录查询
|
||||
|
||||
#### 配置文件
|
||||
- **application.yml**: 完整的服务配置
|
||||
- 数据库连接配置
|
||||
- Redis配置
|
||||
- JWT配置
|
||||
- 验证码配置
|
||||
- OAuth配置
|
||||
|
||||
- **SecurityConfig**: 安全配置更新
|
||||
- 新增认证接口的公开访问权限
|
||||
- JWT过滤器配置
|
||||
|
||||
### 2. emotion-user模块简化
|
||||
|
||||
#### 移除的功能
|
||||
- **认证相关Controller**:
|
||||
- 移除UserController中的登录、注册、登出接口
|
||||
- 删除CaptchaController
|
||||
- 删除OAuthController
|
||||
|
||||
- **认证相关Service**:
|
||||
- 移除UserService中的认证方法
|
||||
- 删除CaptchaService及其实现
|
||||
- 删除OAuthService及其实现
|
||||
- 删除SliderCaptchaService及其实现
|
||||
|
||||
- **认证相关DTO/VO**:
|
||||
- 删除LoginRequest、RegisterRequest
|
||||
- 删除LoginResponse
|
||||
- 删除CaptchaResponse、SliderCaptchaResponse
|
||||
- 删除OAuthLoginRequest等
|
||||
|
||||
- **认证相关Mapper方法**:
|
||||
- 移除UserMapper中的认证查询方法
|
||||
- 简化UserMapper.xml
|
||||
|
||||
#### 保留的功能
|
||||
- **用户信息管理**:
|
||||
- 获取用户信息
|
||||
- 更新用户信息
|
||||
- 更新最后活跃时间
|
||||
|
||||
- **数据模型**:
|
||||
- User实体(用户基础信息)
|
||||
- UserInfoResponse(用户信息响应)
|
||||
- UserUpdateRequest(用户更新请求)
|
||||
|
||||
### 3. 网关路由配置
|
||||
|
||||
#### 新增路由
|
||||
```yaml
|
||||
# 认证服务路由
|
||||
- id: emotion-auth
|
||||
uri: lb://emotion-auth
|
||||
predicates:
|
||||
- Path=/api/auth/**
|
||||
filters:
|
||||
- StripPrefix=2
|
||||
```
|
||||
|
||||
#### 路由分配
|
||||
- `/api/auth/**` → emotion-auth模块(认证功能)
|
||||
- `/api/user/**` → emotion-user模块(用户信息管理)
|
||||
|
||||
### 4. 前端API调用
|
||||
|
||||
前端认证相关API调用已配置为:
|
||||
- 基础URL: `/api/auth`
|
||||
- 通过网关自动路由到emotion-auth模块
|
||||
|
||||
## 重构后的架构
|
||||
|
||||
### emotion-auth模块职责
|
||||
- 用户注册和登录
|
||||
- JWT Token生成和验证
|
||||
- 密码加密和验证
|
||||
- 验证码生成和验证
|
||||
- 第三方OAuth登录
|
||||
- 用户认证状态管理
|
||||
|
||||
### emotion-user模块职责
|
||||
- 用户基础信息管理
|
||||
- 用户资料更新
|
||||
- 用户活跃状态维护
|
||||
- 用户成长数据管理
|
||||
|
||||
## 数据库设计
|
||||
|
||||
### 用户表结构
|
||||
```sql
|
||||
CREATE TABLE user (
|
||||
id VARCHAR(32) PRIMARY KEY,
|
||||
account VARCHAR(50) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
username VARCHAR(50),
|
||||
email VARCHAR(100),
|
||||
phone VARCHAR(20),
|
||||
avatar VARCHAR(255),
|
||||
nickname VARCHAR(50),
|
||||
birth_date DATE,
|
||||
location VARCHAR(100),
|
||||
bio TEXT,
|
||||
member_level VARCHAR(20) DEFAULT 'free',
|
||||
total_days INT DEFAULT 0,
|
||||
self_awareness DECIMAL(5,2) DEFAULT 50.00,
|
||||
emotional_resilience DECIMAL(5,2) DEFAULT 50.00,
|
||||
action_power DECIMAL(5,2) DEFAULT 50.00,
|
||||
empathy DECIMAL(5,2) DEFAULT 50.00,
|
||||
life_enthusiasm DECIMAL(5,2) DEFAULT 50.00,
|
||||
status INT DEFAULT 1,
|
||||
is_verified INT DEFAULT 0,
|
||||
last_active_time DATETIME,
|
||||
oauth_platform VARCHAR(20),
|
||||
oauth_id VARCHAR(100),
|
||||
create_by VARCHAR(32),
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_by VARCHAR(32),
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
is_deleted INT DEFAULT 0,
|
||||
remarks TEXT
|
||||
);
|
||||
```
|
||||
|
||||
## 部署配置
|
||||
|
||||
### emotion-auth服务
|
||||
- 端口: 19001
|
||||
- 服务名: emotion-auth
|
||||
- 数据库: emotion_museum
|
||||
- Redis: 用于Token存储
|
||||
|
||||
### 服务依赖
|
||||
- emotion-common: 公共工具和实体
|
||||
- MySQL: 用户数据存储
|
||||
- Redis: Token和验证码缓存
|
||||
- Nacos: 服务注册和配置管理
|
||||
|
||||
## 测试验证
|
||||
|
||||
创建了测试脚本 `test-auth.sh` 用于验证认证功能:
|
||||
- 验证码生成测试
|
||||
- 用户注册测试
|
||||
- 用户登录测试
|
||||
- Token验证测试
|
||||
- 用户信息获取测试
|
||||
- 用户登出测试
|
||||
|
||||
## 重构优势
|
||||
|
||||
1. **职责分离**: 认证和用户管理功能明确分离
|
||||
2. **可维护性**: 认证逻辑集中管理,便于维护和升级
|
||||
3. **可扩展性**: 认证模块独立,便于添加新的认证方式
|
||||
4. **安全性**: 认证逻辑统一管理,安全策略一致
|
||||
5. **性能优化**: 认证服务可独立扩展和优化
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **数据一致性**: 两个模块都需要访问用户表,需要保证数据一致性
|
||||
2. **服务通信**: emotion-user模块如需用户认证信息,需通过emotion-auth模块获取
|
||||
3. **缓存同步**: Token和用户状态缓存需要在两个模块间保持同步
|
||||
4. **错误处理**: 统一错误码和异常处理机制
|
||||
|
||||
## 后续优化建议
|
||||
|
||||
1. **服务间通信**: 使用Feign客户端实现模块间调用
|
||||
2. **缓存策略**: 优化Redis缓存策略,提高性能
|
||||
3. **监控告警**: 添加认证服务的监控和告警
|
||||
4. **安全加固**: 增强密码策略和防暴力破解机制
|
||||
5. **审计日志**: 添加用户认证操作的审计日志
|
||||
@@ -1,97 +0,0 @@
|
||||
# 项目文件清理总结
|
||||
|
||||
## 🗑️ 已移除的文件
|
||||
|
||||
### 数据库相关文件(已被终版脚本替代)
|
||||
- ❌ `mysql_database_indexes.sql` - 旧的索引脚本
|
||||
- ❌ `mysql_database_init_data.sql` - 旧的初始数据脚本
|
||||
- ❌ `mysql_database_schema.sql` - 旧的表结构脚本
|
||||
- ❌ `mysql_deploy_database.sql` - 旧的部署脚本
|
||||
- ❌ `backend/sql/ai_chat_basic.sql` - AI聊天基础脚本
|
||||
- ❌ `backend/sql/ai_chat_optimization.sql` - AI聊天优化脚本
|
||||
- ❌ `backend/sql/` - 整个sql目录(已清空)
|
||||
|
||||
### 测试文件
|
||||
- ❌ `backend/emotion-common/src/test/java/com/emotionmuseum/common/handler/EmotionMetaObjectHandlerTest.java` - 测试文件(在当前环境无法正常运行)
|
||||
- ❌ `backend/emotion-ai/test-conversation-flow.sh` - 对话流程测试脚本
|
||||
- ❌ `backend/emotion-ai/test-coze-api.sh` - Coze API测试脚本
|
||||
- ❌ `backend/test-coze-api.sh` - Coze API测试脚本
|
||||
- ❌ `backend/test-services.sh` - 服务测试脚本
|
||||
|
||||
### 启动脚本(保留主要脚本)
|
||||
- ❌ `backend/start-ai.sh` - AI服务启动脚本
|
||||
- ❌ `backend/start-frontend.sh` - 前端启动脚本
|
||||
- ❌ `backend/start-gateway.sh` - 网关启动脚本
|
||||
- ❌ `backend/start-record.sh` - 记录服务启动脚本
|
||||
- ❌ `backend/start-user.sh` - 用户服务启动脚本
|
||||
|
||||
### 文档文件(重复或过时)
|
||||
- ❌ `backend/开发启动指南.md` - 开发启动指南
|
||||
- ❌ `backend/本地开发启动完成.md` - 本地开发启动完成
|
||||
- ❌ `backend/端口配置更新总结.md` - 端口配置更新总结
|
||||
- ❌ `web/前端接口配置完成总结.md` - 前端接口配置完成总结
|
||||
- ❌ `web/接口连通性测试完成.md` - 接口连通性测试完成
|
||||
- ❌ `web/环境变量配置完成总结.md` - 环境变量配置完成总结
|
||||
- ❌ `MySQL数据库设计总结.md` - MySQL数据库设计总结
|
||||
- ❌ `数据库设计方案.md` - 数据库设计方案
|
||||
- ❌ `项目分析总结报告.md` - 项目分析总结报告
|
||||
|
||||
### 临时文件
|
||||
- ❌ `web/test-env.js` - 环境测试文件
|
||||
|
||||
## ✅ 保留的重要文件
|
||||
|
||||
### 数据库文件
|
||||
- ✅ `backend/mysql_emotion_museum_final.sql` - **终版数据库脚本(v3.0)**
|
||||
|
||||
### 核心启动脚本
|
||||
- ✅ `backend/dev-auto.sh` - 自动化开发脚本
|
||||
- ✅ `backend/dev-start.sh` - 开发启动脚本
|
||||
- ✅ `backend/start-services.sh` - 服务启动脚本
|
||||
- ✅ `backend/stop-services.sh` - 服务停止脚本
|
||||
|
||||
### 测试文件(保留有效的)
|
||||
- ✅ `backend/emotion-common/src/test/java/com/emotionmuseum/common/util/SnowflakeIdGeneratorTest.java` - 雪花算法测试
|
||||
|
||||
### 重要文档
|
||||
- ✅ `backend/数据库雪花算法主键实施总结.md` - **实施总结文档**
|
||||
- ✅ `backend/README.md` - 后端项目说明
|
||||
- ✅ `web/README.md` - 前端项目说明
|
||||
- ✅ `web/ENV_CONFIG.md` - 环境配置说明
|
||||
- ✅ `CLAUDE.md` - 项目总体说明
|
||||
- ✅ `情绪博物馆MVP需求规格书.md` - MVP需求规格
|
||||
- ✅ `情绪博物馆完整功能需求与数据库设计.md` - 完整功能需求
|
||||
- ✅ `EmotionMuseum功能完善实施计划.md` - 功能完善计划
|
||||
- ✅ `Spring Cloud Alibaba微服务架构设计.md` - 架构设计
|
||||
- ✅ `UI设计实施指南.md` - UI设计指南
|
||||
- ✅ `技术架构完善建议.md` - 技术架构建议
|
||||
- ✅ `功能模块详细梳理.md` - 功能模块梳理
|
||||
- ✅ `MVP功能需求文档.md` - MVP功能需求
|
||||
|
||||
## 📊 清理统计
|
||||
|
||||
- **移除文件数量**: 23个
|
||||
- **保留核心文件**: 数据库脚本、启动脚本、重要文档
|
||||
- **项目结构**: 更加清晰,去除冗余
|
||||
|
||||
## 🎯 清理原则
|
||||
|
||||
1. **保留终版文件**: 只保留最新、最完整的版本
|
||||
2. **移除重复文件**: 删除功能重复或过时的文件
|
||||
3. **保留核心功能**: 保留项目运行必需的文件
|
||||
4. **保留重要文档**: 保留对项目理解和维护有价值的文档
|
||||
|
||||
## 📝 使用建议
|
||||
|
||||
现在项目结构更加清晰,主要使用以下文件:
|
||||
|
||||
1. **数据库初始化**: `backend/mysql_emotion_museum_final.sql`
|
||||
2. **开发启动**: `backend/dev-auto.sh` 或 `backend/dev-start.sh`
|
||||
3. **服务管理**: `backend/start-services.sh` 和 `backend/stop-services.sh`
|
||||
4. **项目文档**: 各种.md文档文件
|
||||
|
||||
---
|
||||
|
||||
**清理完成时间**: 2025-07-13
|
||||
**清理状态**: ✅ 完成
|
||||
**项目状态**: 🚀 准备就绪
|
||||
Reference in New Issue
Block a user