This commit is contained in:
sjk
2025-11-17 14:09:17 +08:00
commit 31e46c5bf6
479 changed files with 109324 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
@echo off
echo.
echo Testing Backend Log Format
echo ================================
echo.
set BASE_URL=http://localhost:8080
echo [1/5] Testing Health Check (GET 200)
curl -s "%BASE_URL%/health" >nul 2>&1
timeout /t 1 /nobreak >nul
echo [2/5] Testing Login (POST 200)
curl -s -X POST "%BASE_URL%/api/v1/auth/login" -H "Content-Type: application/json" -d "{\"account\":\"test@example.com\",\"password\":\"Test@123\"}" >nul 2>&1
timeout /t 1 /nobreak >nul
echo [3/5] Testing 404 Error (GET 404)
curl -s "%BASE_URL%/api/v1/not-found" >nul 2>&1
timeout /t 1 /nobreak >nul
echo [4/5] Testing OPTIONS Preflight (OPTIONS 204)
curl -s -X OPTIONS "%BASE_URL%/api/v1/user/profile" -H "Origin: http://localhost:3001" >nul 2>&1
timeout /t 1 /nobreak >nul
echo [5/5] Testing Unauthorized (GET 401)
curl -s "%BASE_URL%/api/v1/user/profile" >nul 2>&1
timeout /t 1 /nobreak >nul
echo.
echo Test Complete!
echo.
echo View logs:
echo type logs\app.log
echo.
echo View last 20 lines:
echo powershell "Get-Content logs\app.log -Tail 20"
echo.
pause