swagger_generator_flutter/run_swagger.bat

67 lines
1.3 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
REM 简化版 Swagger CLI 运行脚本
REM 提供便捷的命令行界面
REM 颜色定义 (Windows不支持ANSI颜色使用echo)
REM GREEN='\033[0;32m'
REM YELLOW='\033[1;33m'
REM CYAN='\033[0;36m'
REM NC='\033[0m' # No Color
REM 脚本路径
set SCRIPT_DIR=%~dp0
set CLI_DART_FILE=%SCRIPT_DIR%bin\main.dart
REM 显示帮助
:show_help
if "%1"=="help" goto help_content
if "%1"=="--help" goto help_content
if "%1"=="" goto help_content
goto :eof
:help_content
echo.
echo 🚀 Swagger CLI 工具
echo.
echo 用法: %0 [命令] [选项]
echo.
echo 快速命令:
echo %0 all # 生成所有文件
echo %0 models # 生成数据模型
echo %0 docs # 生成API文档
echo %0 api # 生成Retrofit API
echo.
echo 直接使用:
echo dart run bin\main.dart generate --help
echo.
goto :eof
REM 主函数
:main
if "%1"=="" goto show_help
if "%1"=="help" goto show_help
if "%1"=="--help" goto show_help
if "%1"=="all" (
dart run "%CLI_DART_FILE%" generate --models --api --split-by-tags
goto :eof
)
if "%1"=="models" (
dart run "%CLI_DART_FILE%" generate --models
goto :eof
)
if "%1"=="docs" (
dart run "%CLI_DART_FILE%" generate --docs
goto :eof
)
if "%1"=="api" (
dart run "%CLI_DART_FILE%" generate --api
goto :eof
)
echo 未知命令: %1
goto show_help