MCPcopy Create free account
hub / github.com/MQEnergy/go-skeleton / Command

Method Command

internal/command/gen_controller.go:29–62  ·  view source on GitHub ↗

Command ...

()

Source from the content-addressed store, hash-verified

27
28// Command ...
29func (g *GenController) Command() *cli.Command {
30 var (
31 name string
32 dir string
33 )
34 return &cli.Command{
35 Name: "genController",
36 Usage: "Create a new controller",
37 Flags: []cli.Flag{
38 &cli.StringFlag{
39 Name: "name",
40 Aliases: []string{"n"},
41 Value: "",
42 Usage: "请输入controller名称 如:user",
43 Destination: &name,
44 Required: true,
45 },
46 &cli.StringFlag{
47 Name: "dir",
48 Aliases: []string{"d"},
49 Value: "",
50 Usage: "请输入controller目录 如:backend or backend/user",
51 Destination: &dir,
52 Required: false,
53 },
54 },
55 Before: func(ctx *cli.Context) error {
56 return boots.InitConfig()
57 },
58 Action: func(ctx *cli.Context) error {
59 return handleGenController(name, dir)
60 },
61 }
62}
63
64var _ command.Interface = (*GenController)(nil)
65

Callers

nothing calls this directly

Calls 2

InitConfigFunction · 0.92
handleGenControllerFunction · 0.85

Tested by

no test coverage detected