feat(admin): 添加用户管理相关文件

添加用户管理视图、API和状态管理文件
This commit is contained in:
张翔
2026-03-28 14:37:29 +08:00
commit 08ea5fbe98
1643 changed files with 255646 additions and 0 deletions
+160
View File
@@ -0,0 +1,160 @@
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "=========================================="
echo " 全面自动化测试执行器"
echo "=========================================="
echo ""
echo "开始时间: $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
run_api_tests() {
echo ""
echo "=========================================="
echo " 阶段一:API 单元/集成测试"
echo "=========================================="
echo ""
cd "$PROJECT_ROOT/everything-is-suitable-api/everything-is-suitable-app"
if [ ! -f "pom.xml" ]; then
echo "❌ 未找到 API 项目"
return 1
fi
echo "运行 API 测试..."
if mvn clean test -q; then
echo ""
echo "✅ API 测试通过"
return 0
else
echo ""
echo "❌ API 测试失败"
return 1
fi
}
run_integration_tests() {
echo ""
echo "=========================================="
echo " 阶段二:前端对接 API 测试"
echo "=========================================="
echo ""
echo "启动所有服务..."
"$SCRIPT_DIR/start-all-services.sh"
if [ $? -ne 0 ]; then
echo "❌ 服务启动失败"
return 1
fi
echo ""
echo "运行集成测试..."
cd "$PROJECT_ROOT/everything-is-suitable-test"
if npx playwright test --project=integration-chromium --reporter=html; then
echo ""
echo "✅ 集成测试通过"
return 0
else
echo ""
echo "❌ 集成测试失败"
echo "环境已保留,可手动检查"
return 1
fi
}
run_e2e_tests() {
echo ""
echo "=========================================="
echo " 阶段三:全链路 E2E 测试"
echo "=========================================="
echo ""
cd "$PROJECT_ROOT/everything-is-suitable-test"
echo "运行 E2E 测试..."
if npx playwright test --reporter=html; then
echo ""
echo "✅ E2E 测试通过"
return 0
else
echo ""
echo "❌ E2E 测试失败"
echo "环境已保留,可手动检查"
return 1
fi
}
generate_final_report() {
echo ""
echo "=========================================="
echo " 生成最终测试报告"
echo "=========================================="
echo ""
"$SCRIPT_DIR/generate-test-report.sh"
}
cleanup() {
echo ""
echo "=========================================="
echo " 清理环境"
echo "=========================================="
echo ""
"$SCRIPT_DIR/stop-services.sh"
}
trap cleanup EXIT
MAIN_RESULT=0
if ! run_api_tests; then
echo ""
echo "=========================================="
echo " ❌ 测试失败:API 测试未通过"
echo "=========================================="
MAIN_RESULT=1
exit $MAIN_RESULT
fi
if ! run_integration_tests; then
echo ""
echo "=========================================="
echo " ❌ 测试失败:集成测试未通过"
echo "=========================================="
generate_final_report
MAIN_RESULT=1
exit $MAIN_RESULT
fi
if ! run_e2e_tests; then
echo ""
echo "=========================================="
echo " ❌ 测试失败:E2E 测试未通过"
echo "=========================================="
generate_final_report
MAIN_RESULT=1
exit $MAIN_RESULT
fi
generate_final_report
echo ""
echo "=========================================="
echo " ✅ 所有测试通过!"
echo "=========================================="
echo ""
echo "结束时间: $(date '+%Y-%m-%d %H:%M:%S')"
echo ""
exit $MAIN_RESULT