You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
483 B
Go
31 lines
483 B
Go
4 years ago
|
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
|
||
|
}
|