add backend

This commit is contained in:
yoyuzh
2026-03-14 11:03:07 +08:00
parent d993d3f943
commit 8db2fa2aab
130 changed files with 15152 additions and 11861 deletions

View File

@@ -0,0 +1,37 @@
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$javaExe = 'C:\Program Files\Java\jdk-22\bin\java.exe'
$out = Join-Path $root 'backend-dev.out.log'
$err = Join-Path $root 'backend-dev.err.log'
if (Test-Path $out) {
Remove-Item $out -Force
}
if (Test-Path $err) {
Remove-Item $err -Force
}
$proc = Start-Process `
-FilePath $javaExe `
-ArgumentList '-jar', 'backend/target/yoyuzh-portal-backend-0.0.1-SNAPSHOT.jar', '--spring.profiles.active=dev' `
-WorkingDirectory $root `
-PassThru `
-RedirectStandardOutput $out `
-RedirectStandardError $err
Start-Sleep -Seconds 10
try {
$resp = Invoke-WebRequest -Uri 'http://127.0.0.1:8080/swagger-ui.html' -UseBasicParsing -TimeoutSec 5
Write-Output "PID=$($proc.Id)"
Write-Output "STATUS=$($resp.StatusCode)"
Write-Output 'URL=http://127.0.0.1:8080/swagger-ui.html'
}
catch {
Write-Output "PID=$($proc.Id)"
Write-Output 'STATUS=STARTED_BUT_NOT_READY'
if (Test-Path $err) {
Get-Content -Tail 40 $err
}
}