package cmd import ( "gadmin/internal/generate" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) var generateCmd = &cobra.Command{ Use: "gendbmodel", Short: "根据gorm数据库表,直接生成gorm模型和相应的查询gen", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { logrus.Info("generate called") generate.GenModel() }, } func init() { rootCmd.AddCommand(generateCmd) }