初次提交

This commit is contained in:
2025-10-14 20:05:29 +08:00
commit 6e4e48fdd2
673 changed files with 437006 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
#!/bin/bash
# 启动服务并测试API的脚本
echo "🚀 云盘应用启动和测试脚本"
echo "=================================="
# 检查Python环境
if ! command -v python3 &> /dev/null; then
echo "❌ Python3 未安装"
exit 1
fi
echo "✅ Python3 已安装"
# 检查端口8080是否被占用
if lsof -Pi :8080 -sTCP:LISTEN -t >/dev/null ; then
echo "❌ 端口8080已被占用"
echo "🔧 尝试停止占用端口的进程..."
lsof -ti:8080 | xargs kill -9 2>/dev/null || echo "无法停止进程"
sleep 2
fi
# 启动服务器(后台)
echo "🚀 启动服务器在端口8080..."
python3 start_8080.py &
SERVER_PID=$!
# 等待服务器启动
echo "⏳ 等待服务器启动..."
sleep 5
# 测试服务器是否启动成功
if curl -s http://localhost:8080/health > /dev/null; then
echo "✅ 服务器启动成功"
else
echo "❌ 服务器启动失败"
kill $SERVER_PID 2>/dev/null
exit 1
fi
# 运行API测试
echo ""
echo "🧪 开始API测试..."
echo "=================================="
python3 test_api_8080.py
# 停止服务器
echo ""
echo "🛑 停止服务器..."
kill $SERVER_PID 2>/dev/null
wait $SERVER_PID 2>/dev/null
echo ""
echo "✅ 测试完成!"