29 lines
668 B
Batchfile
29 lines
668 B
Batchfile
@echo off
|
|
REM Handler Generator Script for Windows
|
|
REM Usage: generate.bat <handler-name> [methods]
|
|
|
|
if "%~1"=="" (
|
|
echo Usage: generate.bat ^<handler-name^> [methods]
|
|
echo Example: generate.bat user get post put delete
|
|
echo Methods: get, post, put, delete (optional, default: get post)
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
set HANDLER_NAME=%~1
|
|
shift
|
|
|
|
set METHODS=%*
|
|
if "%METHODS%"=="" set METHODS=get post
|
|
|
|
echo Generating handler: %HANDLER_NAME% with methods: %METHODS%
|
|
echo.
|
|
|
|
cd /d "%~dp0.."
|
|
go run tools/general/generate-handler.go %HANDLER_NAME% %METHODS%
|
|
|
|
echo.
|
|
echo Handler generated successfully!
|
|
echo Don't forget to run: swag init -g cmd/api/main.go
|
|
pause
|