feat 协议
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user