feat: FastAPI+SSE API server, JRXML auto-reorder, session integrity fixes

This commit is contained in:
2026-05-22 17:53:59 +08:00
parent 1144a86d02
commit 1e5ce9725b
32 changed files with 9189 additions and 309 deletions
+50
View File
@@ -0,0 +1,50 @@
@echo off
setlocal enabledelayedexpansion
echo ================================================
echo agent_jrxml 启动 (全栈)
echo ================================================
cd /d "%~dp0"
:: 清理残留进程
echo [清理] 检查残留进程...
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8000.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":8001.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":5173.*LISTENING"') do taskkill /F /PID %%a >nul 2>&1
echo.
:: 1. 验证服务
echo [1/3] 验证服务 :8001
start "jrxml-validator" /MIN .venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('validation_service.main:app',host='0.0.0.0',port=8001,reload=False)"
:wait_val
ping -n 2 127.0.0.1 >nul
powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:8001/health -TimeoutSec 2 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
if errorlevel 1 goto wait_val
echo :8001 就绪
:: 2. API 服务
echo [2/3] API 服务 :8000
start "jrxml-api" /MIN .venv\Scripts\python.exe -c "import uvicorn; uvicorn.run('api_server:app',host='0.0.0.0',port=8000,reload=False)"
:wait_api
ping -n 2 127.0.0.1 >nul
powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:8000/api/health -TimeoutSec 2 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
if errorlevel 1 goto wait_api
echo :8000 就绪
:: 3. 前端
echo [3/3] 前端 :5173
start "jrxml-frontend" /MIN cmd /c "cd /d "%~dp0frontend" && npm run dev"
:wait_fe
ping -n 3 127.0.0.1 >nul
powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:5173 -TimeoutSec 3 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1
if errorlevel 1 goto wait_fe
echo :5173 就绪
echo.
echo ================================================
echo 全部就绪:
echo 前端: http://localhost:5173
echo API: http://localhost:8000/docs
echo 验证: http://localhost:8001/health
echo 运行 stop.bat 停止所有服务
echo ================================================
pause