尝试登录逻辑
This commit is contained in:
27
srv/tools/gorm_generate/main.go
Normal file
27
srv/tools/gorm_generate/main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"Crimson-Gatekeeper/internal/common"
|
||||
"fmt"
|
||||
|
||||
"gorm.io/gen"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, clean := common.GetDataBaseClient()
|
||||
defer func() {
|
||||
err := clean()
|
||||
if err != nil {
|
||||
fmt.Println("关闭数据库链接失败")
|
||||
}
|
||||
}()
|
||||
g := gen.NewGenerator(gen.Config{
|
||||
OutPath: "./internal/query",
|
||||
ModelPkgPath: "./internal/model",
|
||||
Mode: gen.WithDefaultQuery,
|
||||
FieldNullable: true,
|
||||
})
|
||||
g.UseDB(client)
|
||||
g.ApplyBasic(g.GenerateAllTable()...)
|
||||
g.Execute()
|
||||
}
|
||||
Reference in New Issue
Block a user