Files
Authenticator/script/goctl/GenApi.ps1
cialloo b6c464cb12
Some checks failed
CI - Build and Push / Build and Push Docker Image (push) Failing after 32s
feat: Implement Steam login initialization logic
- Added SteamLoginInitLogic to handle the initiation of Steam login.
- Created service context for managing configuration and Redis connection.
- Defined types for Steam login requests and callbacks.
- Implemented utility functions for building OpenID query strings and validating responses from Steam.
- Updated go.mod and go.sum to include necessary dependencies.
- Modified GenApi.ps1 script to generate code in the correct directory.
2025-10-12 10:54:11 +08:00

35 lines
866 B
PowerShell

# script should be execute in current `script` directory.
# Usage: ./genApi.ps1 [-s]
# -s : also run swagger generation and convert to OpenAPI3
param(
[switch]$s
)
# Save the original location
$originalLocation = Get-Location
# Change to the target directory
Set-Location -Path (Resolve-Path "../../api")
# format api files
goctl api format -dir .
# generate go-zero code
goctl api go -api Authenticator.api -dir ../app --style=gozero
# generate swagger and convert to openapi3 only when -s is provided
if ($s) {
# generate swagger
goctl api swagger --api Authenticator.api --dir .
# swagger to openapi3
npx swagger2openapi -o Authenticator.yaml -p Authenticator.json
} else {
Write-Host "Skipping swagger and openapi conversion (pass -s to execute)."
}
# Restore original location (optional but good practice)
Set-Location -Path $originalLocation