添加ui界面

This commit is contained in:
谢小军
2020-01-21 22:31:08 +08:00
parent bb224315a1
commit 5230c6f242
12 changed files with 277 additions and 63 deletions

View File

@@ -1,12 +0,0 @@
package gtools
import (
"github.com/xxjwxc/gormt/data/view/model"
"github.com/xxjwxc/gormt/data/view/model/genmysql"
)
// GetMysqlModel get model interface. 获取model接口
func GetMysqlModel() model.IModel {
//now just support mysql
return &genmysql.MySQLModel
}

View File

@@ -9,6 +9,7 @@ import (
"github.com/xxjwxc/gormt/data/config"
"github.com/xxjwxc/gormt/data/view/model/genmysql"
"github.com/xxjwxc/public/tools"
)
@@ -19,7 +20,6 @@ func Execute() {
} else {
showCmd()
}
}
func showCmd() {
@@ -27,14 +27,13 @@ func showCmd() {
// tt.Nickname = "ticket_001"
// orm.Where("nickname = ?", "ticket_001").Find(&tt)
// fmt.Println(tt)
modeldb := GetMysqlModel()
modeldb := genmysql.GetMysqlModel()
pkg := modeldb.GenModel()
// just for test
// out, _ := json.Marshal(pkg)
// tools.WriteFile("test.txt", []string{string(out)}, true)
list := model.Generate(pkg)
list, _ := model.Generate(pkg)
for _, v := range list {
path := config.GetOutDir() + "/" + v.FileName