feat 协议

This commit is contained in:
2026-01-12 00:44:26 +08:00
parent 6bc9f18199
commit 43ca340d54
9 changed files with 22 additions and 14 deletions

View File

@@ -1,10 +1,14 @@
# gen.ps1 - 极简
# gen.ps1 - 支持参数
param(
[Parameter(Mandatory=$true)]
[string]$dbName
)
& .\gentool.exe `
-dsn "root:gR9pV4tY7zR6qL3e@tcp(47.108.184.184:3306)/user_db?charset=utf8mb4&parseTime=True&loc=Local" `
-dsn "root:gR9pV4tY7zR6qL3e@tcp(47.108.184.184:3306)/${dbName}?charset=utf8mb4&parseTime=True&loc=Local" `
-fieldSignable `
-outPath "./user_db/query"
-outPath "./${dbName}/query"
Get-ChildItem ./user_db/model/*.gen.go | ForEach-Object {
Get-ChildItem ./${dbName}/model/*.gen.go | ForEach-Object {
$c = Get-Content $_.FullName -Raw -Encoding UTF8
if ($c -match '\bSn\s+string\b' -and $c -notmatch 'BeforeCreate') {
$c -match 'type\s+(\w+)\s+struct' | Out-Null