fix logout
整理代码输出
This commit is contained in:
@@ -13,9 +13,9 @@ is_foreign_key : true # 是否导出外键关联
|
|||||||
is_gui : false # 是否ui模式显示
|
is_gui : false # 是否ui模式显示
|
||||||
is_table_name : false # 是否直接生成表名函数
|
is_table_name : false # 是否直接生成表名函数
|
||||||
mysql_info:
|
mysql_info:
|
||||||
host : 127.0.0.1
|
host : 101.132.130.169
|
||||||
port : 3306
|
port : 3306
|
||||||
username : root
|
username : root
|
||||||
password : qwer
|
password : 123456
|
||||||
database : oauth_db
|
database : ams
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/xxjwxc/public/tools"
|
"github.com/xxjwxc/public/mylog"
|
||||||
|
|
||||||
"github.com/xxjwxc/gormt/data/view/gtools"
|
"github.com/xxjwxc/gormt/data/view/gtools"
|
||||||
|
"github.com/xxjwxc/public/tools"
|
||||||
|
|
||||||
"github.com/xxjwxc/gormt/data/config"
|
"github.com/xxjwxc/gormt/data/config"
|
||||||
|
|
||||||
@@ -85,12 +85,12 @@ func initConfig() {
|
|||||||
validate := validator.New()
|
validate := validator.New()
|
||||||
err := validate.Struct(config.GetMysqlDbInfo())
|
err := validate.Struct(config.GetMysqlDbInfo())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Can't read cmd: using (-h, --help) to get more imfo")
|
mylog.Info("Can't read cmd: using (-h, --help) to get more imfo")
|
||||||
fmt.Println("error info: ", err, err)
|
mylog.Error(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("using config info:")
|
mylog.Info("using database info:")
|
||||||
fmt.Println(tools.GetJSONStr(config.GetMysqlDbInfo(), true))
|
mylog.Info(tools.GetJSONStr(config.GetMysqlDbInfo(), true))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var _map = Config{
|
|||||||
var configPath string
|
var configPath string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
configPath = path.Join(tools.GetModelPath(), "config.yml")
|
configPath = path.Join(tools.GetCurrentDirectory(), "config.yml")
|
||||||
onInit()
|
onInit()
|
||||||
dev.OnSetDev(_map.IsDev)
|
dev.OnSetDev(_map.IsDev)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package gtools
|
package gtools
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
|
"github.com/xxjwxc/public/mylog"
|
||||||
|
|
||||||
"github.com/xxjwxc/gormt/data/dlg"
|
"github.com/xxjwxc/gormt/data/dlg"
|
||||||
"github.com/xxjwxc/gormt/data/view/model"
|
"github.com/xxjwxc/gormt/data/view/model"
|
||||||
|
|
||||||
@@ -39,12 +40,12 @@ func showCmd() {
|
|||||||
path := config.GetOutDir() + "/" + v.FileName
|
path := config.GetOutDir() + "/" + v.FileName
|
||||||
tools.WriteFile(path, []string{v.FileCtx}, true)
|
tools.WriteFile(path, []string{v.FileCtx}, true)
|
||||||
|
|
||||||
fmt.Println("formatting differs from goimport's:")
|
mylog.Info("formatting differs from goimport's:")
|
||||||
cmd, _ := exec.Command("goimports", "-l", "-w", path).Output()
|
cmd, _ := exec.Command("goimports", "-l", "-w", path).Output()
|
||||||
fmt.Println(string(cmd))
|
mylog.Info(string(cmd))
|
||||||
|
|
||||||
fmt.Println("formatting differs from gofmt's:")
|
mylog.Info("formatting differs from gofmt's:")
|
||||||
cmd, _ = exec.Command("gofmt", "-l", "-w", path).Output()
|
cmd, _ = exec.Command("gofmt", "-l", "-w", path).Output()
|
||||||
fmt.Println(string(cmd))
|
mylog.Info(string(cmd))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
|||||||
github.com/leodido/go-urn v1.2.0 // indirect
|
github.com/leodido/go-urn v1.2.0 // indirect
|
||||||
github.com/nicksnyder/go-i18n/v2 v2.0.3
|
github.com/nicksnyder/go-i18n/v2 v2.0.3
|
||||||
github.com/spf13/cobra v0.0.5
|
github.com/spf13/cobra v0.0.5
|
||||||
github.com/xxjwxc/public v0.0.0-20200404170513-2f5f74aae818
|
github.com/xxjwxc/public v0.0.0-20200501040822-aad701d0c120
|
||||||
golang.org/x/text v0.3.2
|
golang.org/x/text v0.3.2
|
||||||
gopkg.in/go-playground/validator.v9 v9.30.2
|
gopkg.in/go-playground/validator.v9 v9.30.2
|
||||||
gopkg.in/yaml.v2 v2.2.7 // indirect
|
gopkg.in/yaml.v2 v2.2.7 // indirect
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -152,8 +152,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
|
|||||||
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
|
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
|
||||||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
github.com/xxjwxc/public v0.0.0-20200404170513-2f5f74aae818 h1:A1ImXFyLbNBEhuAkvBtpEAQVADN8mxuoZYA53VsNr2Y=
|
github.com/xxjwxc/public v0.0.0-20200501040822-aad701d0c120 h1:VOQeHJdmUdPiKapx+0Uf+Et27Fg6mBSG7oUvvwBgruc=
|
||||||
github.com/xxjwxc/public v0.0.0-20200404170513-2f5f74aae818/go.mod h1:8c3gMuRJkSGX3DpDvxU0fWfEEbuMi1LxPsKEBp97dnc=
|
github.com/xxjwxc/public v0.0.0-20200501040822-aad701d0c120/go.mod h1:8c3gMuRJkSGX3DpDvxU0fWfEEbuMi1LxPsKEBp97dnc=
|
||||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
|||||||
Reference in New Issue
Block a user