goctl added
This commit is contained in:
30
tools/goctl/model/mongomodel/genmongocmd.go
Normal file
30
tools/goctl/model/mongomodel/genmongocmd.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package mongomodel
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/model/mongomodel/gen"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func ModelCommond(c *cli.Context) error {
|
||||
src := c.String("src")
|
||||
cache := c.String("cache")
|
||||
|
||||
if len(src) == 0 {
|
||||
return errors.New("missing -src")
|
||||
}
|
||||
var needCache bool
|
||||
if cache == "yes" {
|
||||
needCache = true
|
||||
}
|
||||
|
||||
lang.Must(gen.GenMongoModel(src, needCache))
|
||||
|
||||
fmt.Println(aurora.Green("Done."))
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user