goctl added

This commit is contained in:
kim
2020-07-29 17:11:41 +08:00
parent b1975d29a7
commit 121323b8c3
142 changed files with 10690 additions and 0 deletions

View 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
}