api-platform/hack/gorm-gen/gorm.go

26 lines
454 B
Go
Raw Permalink Normal View History

2024-11-21 11:25:32 +00:00
package main
import (
"gorm.io/gen"
2024-11-23 17:38:32 +00:00
"leafdev.top/Leaf/api-platform/internal/entity"
2024-11-21 11:25:32 +00:00
)
func main() {
g := gen.NewGenerator(gen.Config{
OutPath: "../../internal/dao",
Mode: gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
})
g.ApplyBasic(
2024-11-23 17:38:32 +00:00
entity.Packages{},
2024-11-23 17:28:44 +00:00
entity.Api{},
2024-11-23 17:38:32 +00:00
entity.ApiDocument{},
entity.Order{},
entity.OrderItem{},
entity.UserPackage{},
entity.PromoCode{},
2024-11-21 11:25:32 +00:00
)
g.Execute()
}