@echo off @echo 开始生成数据模型 set tables=user,user_platform set targetDir=.\model set templateDir=..\..\doc\template set host=127.0.0.1 set port=23306 set dbname=dcg set username=root set password=root for %%i in (%tables%) do ( echo 开始创建库: %dbname% 的表: %%i goctl model mysql datasource --url "%username%:%password%@tcp(%host%:%port%)/%dbname%" -t %%i -d %targetDir% --style go_zero --home %templateDir% )