Feature mongo gen (#546)

* add feature: mongo code generation

* upgrade version

* update doc

* format code

* update update.tpl of mysql
This commit is contained in:
anqiansong
2021-03-12 17:49:28 +08:00
committed by GitHub
parent c954568b61
commit dda7666097
10 changed files with 569 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/configgen"
"github.com/tal-tech/go-zero/tools/goctl/docker"
"github.com/tal-tech/go-zero/tools/goctl/kube"
"github.com/tal-tech/go-zero/tools/goctl/model/mongo"
model "github.com/tal-tech/go-zero/tools/goctl/model/sql/command"
"github.com/tal-tech/go-zero/tools/goctl/plugin"
rpc "github.com/tal-tech/go-zero/tools/goctl/rpc/cli"
@@ -28,7 +29,7 @@ import (
)
var (
buildVersion = "1.1.5"
buildVersion = "1.1.6"
commands = []cli.Command{
{
Name: "upgrade",
@@ -447,6 +448,29 @@ var (
},
},
},
{
Name: "mongo",
Usage: `generate mongo model`,
Flags: []cli.Flag{
cli.StringSliceFlag{
Name: "type, t",
Usage: "specified model type name",
},
cli.BoolFlag{
Name: "cache, c",
Usage: "generate code with cache [optional]",
},
cli.StringFlag{
Name: "dir, d",
Usage: "the target dir",
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
},
},
Action: mongo.Action,
},
},
},
{