초기 관제 시스템 뼈대 구성

This commit is contained in:
2026-06-06 14:58:54 +09:00
parent d982777718
commit cab7394b1f
29 changed files with 3221 additions and 1 deletions

32
scripts/health-check.ps1 Normal file
View File

@@ -0,0 +1,32 @@
param(
[string]$BaseUrl = "http://127.0.0.1:8080",
[string]$AdminToken = ""
)
$ErrorActionPreference = "Stop"
function Invoke-CargoRadarJson {
param(
[Parameter(Mandatory = $true)]
[string]$Path
)
$headers = @{}
if ($AdminToken) {
$headers["X-Admin-Token"] = $AdminToken
}
Invoke-RestMethod -Uri "$BaseUrl$Path" -Method Get -Headers $headers
}
$health = Invoke-CargoRadarJson -Path "/health"
$drivers = Invoke-CargoRadarJson -Path "/api/v1/drivers"
$latest = Invoke-CargoRadarJson -Path "/api/v1/locations/latest"
[pscustomobject]@{
BaseUrl = $BaseUrl
Health = $health.status
ServerTime = $health.time
DriverCount = $drivers.drivers.Count
LatestLocationCount = $latest.locations.Count
} | Format-List