feat(api): docs basic curd implemention
This commit is contained in:
20
cmd/gen/main.go
Normal file
20
cmd/gen/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"octopus/internal/dal/model"
|
||||
|
||||
"gorm.io/gen"
|
||||
)
|
||||
|
||||
// generate code.
|
||||
func main() {
|
||||
g := gen.NewGenerator(gen.Config{
|
||||
OutPath: "internal/dal/query",
|
||||
Mode: gen.WithDefaultQuery | gen.WithoutContext,
|
||||
})
|
||||
g.ApplyBasic(
|
||||
new(model.Doc),
|
||||
new(model.DocFolder),
|
||||
)
|
||||
g.Execute()
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package main
|
||||
import (
|
||||
"octopus/cmd/octopus/scripts"
|
||||
"octopus/cmd/octopus/server"
|
||||
"octopus/internal/dal"
|
||||
"octopus/internal/dal/query"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
@@ -17,6 +19,7 @@ var rootCmd = &cobra.Command{
|
||||
func main() {
|
||||
rootCmd.AddCommand(server.CmdRun)
|
||||
rootCmd.AddCommand(scripts.CmdScripts)
|
||||
query.SetDefault(dal.GetPostgres())
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to execute root command")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user