tyc-server/deploy/script/gen_models.ps1

40 lines
1.0 KiB
PowerShell
Raw Permalink Normal View History

2025-04-09 15:58:06 +08:00
# 设置输出编码为UTF-8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# 数据库连接信息 - 修改了URL格式
$DB_URL = "tyc:5vg67b3UNHu8@(127.0.0.1:20001)/tyc"
$OUTPUT_DIR = "./model"
$TEMPLATE_DIR = "../template"
# 表名列表
$tables = @(
2025-05-09 17:54:28 +08:00
# "example_params"
2025-04-23 17:48:38 +08:00
# "feature",
2025-05-27 18:35:01 +08:00
"global_notifications"
2025-04-23 17:48:38 +08:00
# "order",
# "product",
# "product_feature",
# "product_render",
# "query",
# "user",
# "user_auth"
2025-05-09 17:54:28 +08:00
# "admin_user"
# "admin_user_role"
# "admin_api",
# "admin_menu"
# "admin_role",
# "admin_role_api",
# "admin_role_menu",
# "admin_dict_data"
# "admin_dict_type"
# "admin_promotion_link"
# "admin_promotion_link_stats_total"
# "admin_promotion_link_stats_history"
2025-05-27 18:35:01 +08:00
# "admin_promotion_order"
# "order_refund"
2025-04-09 15:58:06 +08:00
)
# 为每个表生成模型
foreach ($table in $tables) {
goctl model mysql datasource -url="tyc:5vg67b3UNHu8@tcp(127.0.0.1:20001)/tyc" -table="$table" -dir="./model" --home="../template" -cache=true --style=goZero
}