feat: add gen model

This commit is contained in:
Rogee
2024-12-19 14:40:13 +08:00
parent ab9e8ed8b4
commit 797ff49fc7
7 changed files with 347 additions and 9 deletions

21
cmd/gen.go Normal file
View File

@@ -0,0 +1,21 @@
package cmd
import "github.com/spf13/cobra"
func CommandGen(root *cobra.Command) {
cmd := &cobra.Command{
Use: "gen",
Short: "Generate code",
}
cmd.PersistentFlags().StringP("config", "c", "config.toml", "database config file")
cmds := []func(*cobra.Command){
CommandGenModel,
}
for _, c := range cmds {
c(cmd)
}
root.AddCommand(cmd)
}