초기 관제 시스템 뼈대 구성
This commit is contained in:
29
scripts/post-demo-location.ps1
Normal file
29
scripts/post-demo-location.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
param(
|
||||
[string]$BaseUrl = "http://127.0.0.1:8080",
|
||||
[string]$DeviceToken = "demo-token",
|
||||
[string]$DriverId = "demo-driver",
|
||||
[string]$VehicleNo = "SEOUL-12-3456",
|
||||
[double]$Latitude = 37.5665,
|
||||
[double]$Longitude = 126.9780
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$body = @{
|
||||
driverId = $DriverId
|
||||
vehicleNo = $VehicleNo
|
||||
latitude = $Latitude
|
||||
longitude = $Longitude
|
||||
accuracy = 12
|
||||
speed = 42
|
||||
heading = 90
|
||||
provider = "script"
|
||||
recordedAt = (Get-Date).ToUniversalTime().ToString("o")
|
||||
} | ConvertTo-Json
|
||||
|
||||
Invoke-RestMethod `
|
||||
-Uri "$BaseUrl/api/v1/locations" `
|
||||
-Method Post `
|
||||
-Headers @{ "X-Device-Token" = $DeviceToken } `
|
||||
-ContentType "application/json" `
|
||||
-Body $body
|
||||
Reference in New Issue
Block a user