diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5daba3f..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index b90bf62..20c5283 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ db/oauth_db.go .vscode/settings.json +/.idea +/err +/model +gormt.yml +gormt diff --git a/Makefile b/Makefile index 35a2b0f..666e8f1 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,21 @@ -all: - make windows - make mac - make linux +all: # 构建 + make tar make clear windows: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o gormt.exe main.go - tar czvf gormt_windows.zip gormt.exe config.yml mac: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o gormt main.go - tar czvf gormt_mac.zip gormt config.yml linux: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gormt main.go +tar: # 打包 + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o gormt.exe main.go + tar czvf gormt_windows.zip gormt.exe config.yml + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o gormt main.go + tar czvf gormt_mac.zip gormt config.yml + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gormt main.go tar czvf gormt_linux.zip gormt config.yml clear: - rm gormt - rm gormt.exe - rm -rf model/* - rm -rf err/ - + - rm -rf model/* + - rm -rf err/ + - rm gormt + - rm gormt.exe diff --git a/README.md b/README.md index a090fb7..516a39e 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ is_out_func : true # Whether to output function is_url_tag : true # Whether to mark web or not is_foreign_key : true # Whether to mark foreign key or not is_gui : false # Whether to operate on gui +is_table_name : false # Whether to out GetTableName function mysql_info : host : "127.0.0.1" diff --git a/README_zh_cn.md b/README_zh_cn.md index 8abd75d..02c0b26 100644 --- a/README_zh_cn.md +++ b/README_zh_cn.md @@ -42,6 +42,7 @@ is_out_func : true # 是否输出 快捷函数 is_url_tag : true # 是否打web标记 is_foreign_key : true # 是否导出外键关联 is_gui : false # 是否ui模式显示 +is_table_name : false # 是否直接生成表名函数 mysql_info: host : 127.0.0.1 port : 3306 diff --git a/config.yml b/config.yml index 52029ab..d429c33 100644 --- a/config.yml +++ b/config.yml @@ -8,9 +8,10 @@ singular_table : true # 单表模式:true:禁用表名复数,false:采用表名 simple : false # 简单输出(默认gorm标签不输出) is_out_sql : false # 是否输出 sql 原信息 is_out_func : true # 是否输出 快捷函数 -is_url_tag : true # 是否打web标记 +is_web_tag : true # 是否打web标记(json标记前提条件) is_foreign_key : true # 是否导出外键关联 is_gui : false # 是否ui模式显示 +is_table_name : false # 是否直接生成表名函数 mysql_info: host : 127.0.0.1 port : 3306 diff --git a/data/cmd/cmd.go b/data/cmd/cmd.go index 8c9bca4..3609dbb 100644 --- a/data/cmd/cmd.go +++ b/data/cmd/cmd.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "strings" "github.com/xxjwxc/public/tools" @@ -21,6 +22,7 @@ var foreignKey bool var funcKey bool var ui bool var urlTag string +var outFileName string var rootCmd = &cobra.Command{ Use: "main", @@ -72,6 +74,8 @@ func init() { rootCmd.PersistentFlags().StringVarP(&urlTag, "url", "l", "", "url标签(json,url)") rootCmd.MarkFlagRequired("url tag") + rootCmd.Flags().StringVar(&outFileName, "outfilename", "", "输出文件名,默认以数据库名称命名") + rootCmd.Flags().IntVar(&mysqlInfo.Port, "port", 3306, "端口号") } @@ -86,7 +90,7 @@ func initConfig() { os.Exit(1) } else { fmt.Println("using config info:") - fmt.Println(tools.GetJSONStr(config.GetMysqlDbInfo())) + fmt.Println(tools.GetJSONStr(config.GetMysqlDbInfo(), true)) } } @@ -111,6 +115,12 @@ func MergeMysqlDbInfo() { if len(urlTag) > 0 { config.SetURLTag(urlTag) } + if len(outFileName) > 0 { + if !strings.HasSuffix(outFileName, ".go") { + outFileName += ".go" + } + config.SetOutFileName(outFileName) + } config.SetMysqlDbInfo(&tmp) diff --git a/data/config/MyIni.go b/data/config/MyIni.go index d5cfc15..5b7225e 100644 --- a/data/config/MyIni.go +++ b/data/config/MyIni.go @@ -21,6 +21,8 @@ type Config struct { IsOutSQL bool `yaml:"is_out_sql"` IsOutFunc bool `yaml:"is_out_func"` IsGUI bool `yaml:"is_gui"` // + IsTableName bool `yaml:"is_table_name"` + OutFileName string `yaml:"-"` } // MysqlDbInfo mysql database information. mysql 数据库信息 @@ -132,6 +134,24 @@ func SetIsGUI(b bool) { _map.IsGUI = b } +// GetIsTableName if is table name . +func GetIsTableName() bool { + return _map.IsTableName +} + +// SetIsTableName if is table name . +func SetIsTableName(b bool) { + _map.IsTableName = b +} + +func SetOutFileName(f string) { + _map.OutFileName = f +} + +func GetOutFileName() string { + return _map.OutFileName +} + // GetURLTag get url tag. func GetURLTag() string { if _map.URLTag != "json" && _map.URLTag != "url" { diff --git a/data/config/common.go b/data/config/common.go index e389f97..af1fbd6 100644 --- a/data/config/common.go +++ b/data/config/common.go @@ -3,6 +3,8 @@ package config import ( "fmt" "io/ioutil" + "os" + "path" "github.com/xxjwxc/public/dev" "github.com/xxjwxc/public/tools" @@ -18,33 +20,65 @@ type CfgBase struct { IsDev bool `json:"is_dev" yaml:"is_dev"` // Is it a development version?是否是开发版本 } -var _map = Config{} +var _map = Config{ + CfgBase: CfgBase{ + IsDev: false, + }, + MySQLInfo: MysqlDbInfo{ + Host: "127.0.0.1", + Port: 3306, + Username: "root", + Password: "root", + Database: "test", + }, + OutDir: "./model", + URLTag: "json", + Language: "中 文", + DbTag: "gorm", + Simple: false, + IsWEBTag: false, + SingularTable: true, + IsForeignKey: true, + IsOutSQL: false, + IsOutFunc: true, + IsGUI: false, +} + +var configPath string func init() { + configPath = path.Join(tools.GetModelPath(), "config.yml") onInit() dev.OnSetDev(_map.IsDev) } func onInit() { - path := tools.GetModelPath() - err := InitFile(path + "/config.yml") + err := InitFile(configPath) if err != nil { - fmt.Println("InitFile: ", err.Error()) + fmt.Println("Load config file error: ", err.Error()) return } } // InitFile default value from file . func InitFile(filename string) error { + if _, e := os.Stat(filename); e != nil { + fmt.Println("init default config file: ", filename) + if err := SaveToFile(); err == nil { + fmt.Println("done,please restart.") + } else { + fmt.Println("shit,fail", err) + } + os.Exit(0) + } bs, err := ioutil.ReadFile(filename) if err != nil { return err } if err := yaml.Unmarshal(bs, &_map); err != nil { - fmt.Println("read toml error: ", err.Error()) + fmt.Println("read config file error: ", err.Error()) return err } - return nil } @@ -72,9 +106,8 @@ func SaveToFile() error { if err != nil { return err } - tools.WriteFile(tools.GetModelPath()+"/config.yml", []string{ + tools.WriteFile(configPath, []string{ string(d), }, true) - return nil } diff --git a/data/dlg/cui.go b/data/dlg/cui.go index dd7c695..8e5fc4e 100644 --- a/data/dlg/cui.go +++ b/data/dlg/cui.go @@ -230,6 +230,8 @@ func enterSet(g *gocui.Gui, v *gocui.View) error { AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsForeignKey()))) form.AddSelect("is_gui", SLocalize("is_gui"), formPart[0], formPart[2]). AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsGUI()))) + form.AddSelect("is_table_name", SLocalize("is_table_name"), formPart[0], formPart[2]). + AddOptions(SLocalize("true"), SLocalize("false")).SetSelected(SLocalize(tools.AsString(config.GetIsTableName()))) form.AddSelect("url_tag", SLocalize("url_tag"), formPart[0], formPart[2]). AddOptions("json", "url").SetSelected(tools.AsString(config.GetURLTag())) form.AddSelect("db_tag", SLocalize("db_tag"), formPart[0], formPart[2]). @@ -294,6 +296,7 @@ func buttonSave(g *gocui.Gui, v *gocui.View) error { config.SetIsOutFunc(getBool(mp["is_out_func"])) config.SetForeignKey(getBool(mp["is_foreign_key"])) config.SetIsGUI(getBool(mp["is_gui"])) + config.SetIsTableName(getBool(mp["is_table_name"])) config.SetURLTag(mp["url_tag"]) config.SetDBTag(mp["db_tag"]) config.SetLG(mp["language"]) diff --git a/data/dlg/i18n.go b/data/dlg/i18n.go index 8e7e375..8896b57 100644 --- a/data/dlg/i18n.go +++ b/data/dlg/i18n.go @@ -89,6 +89,9 @@ func addChinese() error { }, &i18n.Message{ ID: "is_gui", Other: " 界 面 模 式 :", + }, &i18n.Message{ + ID: "is_table_name", + Other: " 生 成 表 名 :", }, &i18n.Message{ ID: "url_tag", Other: " web 标 签:", @@ -180,6 +183,9 @@ func addEnglish() error { }, &i18n.Message{ ID: "is_gui", Other: "is show gui:", + }, &i18n.Message{ + ID: "is_table_name", + Other: "is table name:", }, &i18n.Message{ ID: "url_tag", Other: "url tag:", diff --git a/data/view/cnf/def.go b/data/view/cnf/def.go index 96c259f..de2c5b2 100644 --- a/data/view/cnf/def.go +++ b/data/view/cnf/def.go @@ -10,13 +10,19 @@ var EImportsHead = map[string]string{ // TypeMysqlDicMp Accurate matching type.精确匹配类型 var TypeMysqlDicMp = map[string]string{ + "smallint": "int16", + "smallint unsigned": "uint16", "int": "int", + "int unsigned": "uint", "bigint": "int64", + "bigint unsigned": "uint64", "varchar": "string", "char": "string", "date": "time.Time", "datetime": "time.Time", "bit(1)": "int8", + "tinyint": "int8", + "tinyint unsigned": "uint8", "tinyint(1)": "int8", "tinyint(1) unsigned": "int8", "json": "string", @@ -26,22 +32,26 @@ var TypeMysqlDicMp = map[string]string{ "mediumtext": "string", "longtext": "string", "float": "float32", - "tinytext": "stirng", + "tinytext": "string", "enum": "string", + "time": "time.Time", } // TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型 var TypeMysqlMatchMp = map[string]string{ - `^(tinyint)[(]\d+[)]`: "int8", - `^(smallint)[(]\d+[)]`: "int8", - `^(int)[(]\d+[)]`: "int", - `^(bigint)[(]\d+[)]`: "int64", - `^(char)[(]\d+[)]`: "string", - `^(enum)[(](.)+[)]`: "string", - `^(varchar)[(]\d+[)]`: "string", - `^(varbinary)[(]\d+[)]`: "[]byte", - `^(decimal)[(]\d+,\d+[)]`: "float64", - `^(mediumint)[(]\d+[)]`: "string", - `^(double)[(]\d+,\d+[)]`: "float64", - `^(float)[(]\d+,\d+[)]`: "float64", + `^(tinyint)[(]\d+[)]`: "int8", + `^(tinyint)[(]\d+[)] unsigned`: "uint8", + `^(smallint)[(]\d+[)]`: "int16", + `^(int)[(]\d+[)]`: "int", + `^(bigint)[(]\d+[)]`: "int64", + `^(char)[(]\d+[)]`: "string", + `^(enum)[(](.)+[)]`: "string", + `^(varchar)[(]\d+[)]`: "string", + `^(varbinary)[(]\d+[)]`: "[]byte", + `^(binary)[(]\d+[)]`: "[]byte", + `^(decimal)[(]\d+,\d+[)]`: "float64", + `^(mediumint)[(]\d+[)]`: "string", + `^(double)[(]\d+,\d+[)]`: "float64", + `^(float)[(]\d+,\d+[)]`: "float64", + `^(datetime)[(]\d+[)]`: "time.Time", } diff --git a/data/view/genfunc/def.go b/data/view/genfunc/def.go index c269546..11eb72a 100644 --- a/data/view/genfunc/def.go +++ b/data/view/genfunc/def.go @@ -1,6 +1,12 @@ package genfunc const ( + genTnf = ` +// TableName get sql table name.获取数据库表名 +func (m *{{.StructName}}) TableName() string { + return "{{.TableName}}" +} +` genBase = ` package {{.PackageName}} import ( diff --git a/data/view/genfunc/genfunc.go b/data/view/genfunc/genfunc.go index bb09499..7e201dc 100644 --- a/data/view/genfunc/genfunc.go +++ b/data/view/genfunc/genfunc.go @@ -1,5 +1,10 @@ package genfunc +// GetGenTableNameTemp get gen base template str +func GetGenTableNameTemp() string { + return genTnf +} + // GetGenBaseTemp get gen base template str func GetGenBaseTemp() string { return genBase diff --git a/data/view/genstruct/common.go b/data/view/genstruct/common.go index 6ac64b0..83dd6c1 100644 --- a/data/view/genstruct/common.go +++ b/data/view/genstruct/common.go @@ -1,13 +1,16 @@ package genstruct import ( + "bytes" "fmt" "sort" "strings" + "text/template" "github.com/xxjwxc/gormt/data/config" "github.com/xxjwxc/gormt/data/view/cnf" "github.com/xxjwxc/gormt/data/view/generate" + "github.com/xxjwxc/gormt/data/view/genfunc" ) // SetName Setting element name.设置元素名字 @@ -96,6 +99,11 @@ func (s *GenStruct) SetCreatTableStr(sql string) { s.SQLBuildStr = sql } +// SetTableName Setting the name of struct.设置struct名字 +func (s *GenStruct) SetTableName(name string) { + s.TableName = name +} + // SetStructName Setting the name of struct.设置struct名字 func (s *GenStruct) SetStructName(name string) { s.Name = name @@ -125,6 +133,21 @@ func (s *GenStruct) AddElement(e ...GenElement) { s.Em = append(s.Em, e...) } +func (s *GenStruct) GenerateTableName() []string { + tmpl, err := template.New("gen_tnf").Parse(genfunc.GetGenTableNameTemp()) + if err != nil { + panic(err) + } + var data struct { + TableName string + StructName string + } + data.TableName, data.StructName = s.TableName, s.Name + var buf bytes.Buffer + tmpl.Execute(&buf, data) + return []string{buf.String()} +} + // Generates Get the result data.获取结果数据 func (s *GenStruct) Generates() []string { var p generate.PrintAtom @@ -212,6 +235,12 @@ func (p *GenPackage) Generate() string { for _, v1 := range v.Generates() { pa.Add(v1) } + + if config.GetIsTableName() { // add table name func + for _, v1 := range v.GenerateTableName() { + pa.Add(v1) + } + } } // -----------end diff --git a/data/view/genstruct/def.go b/data/view/genstruct/def.go index 5ecc8e9..4845d55 100644 --- a/data/view/genstruct/def.go +++ b/data/view/genstruct/def.go @@ -11,6 +11,7 @@ type GenElement struct { // GenStruct struct of IStruct .结构体 type GenStruct struct { SQLBuildStr string // Create SQL statements.创建sql语句 + TableName string // table_name.表名 Name string // name.名字 Notes string // notes.注释 Em []GenElement // em.元素组合 diff --git a/data/view/model/genmysql/genmysql.go b/data/view/model/genmysql/genmysql.go index 4b45371..b5067be 100644 --- a/data/view/model/genmysql/genmysql.go +++ b/data/view/model/genmysql/genmysql.go @@ -60,9 +60,20 @@ func (m *mysqlModel) GetPkgName() string { } func getPackageInfo(orm *mysqldb.MySqlDB, info *model.DBInfo) { - tables := getTables(orm) // get table and notes - - for tabName, notes := range tables { + tabls := getTables(orm) // get table and notes + // if m := config.GetTableList(); len(m) > 0 { + // // 制定了表之后 + // newTabls := make(map[string]string) + // for t := range m { + // if notes, ok := tabls[t]; ok { + // newTabls[t] = notes + // } else { + // fmt.Printf("table: %s not found in db\n", t) + // } + // } + // tabls = newTabls + // } + for tabName, notes := range tabls { var tab model.TabInfo tab.Name = tabName tab.Notes = notes diff --git a/data/view/model/model.go b/data/view/model/model.go index 48273a0..7fc3458 100644 --- a/data/view/model/model.go +++ b/data/view/model/model.go @@ -30,6 +30,7 @@ func Generate(info DBInfo) (out []GenOutInfo, m _Model) { var stt GenOutInfo stt.FileCtx = m.generate() stt.FileName = info.DbName + ".go" + out = append(out, stt) // ------end @@ -48,6 +49,7 @@ func (m *_Model) GetPackage() genstruct.GenPackage { pkg.SetPackage(m.info.PackageName) //package name for _, tab := range m.info.TabList { var sct genstruct.GenStruct + sct.SetTableName(tab.Name) sct.SetStructName(getCamelName(tab.Name)) // Big hump.大驼峰 sct.SetNotes(tab.Notes) sct.AddElement(m.genTableElement(tab.Em)...) // build element.构造元素 diff --git a/data/view/model/model_test.go b/data/view/model/model_test.go index a22749d..a95cd3b 100644 --- a/data/view/model/model_test.go +++ b/data/view/model/model_test.go @@ -8,6 +8,10 @@ import ( "github.com/xxjwxc/gormt/data/config" ) +func TestTypeName(t *testing.T) { + fmt.Println(getTypeName("tinyint")) +} + func TestTools(t *testing.T) { str := `{"DbName":"oauth_db","PackageName":"model","TabList":[{"Name":"user_account_tbl","Notes":"用户账号","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"account","Notes":"","Type":"varchar(64)","Index":[{"Key":2,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"password","Notes":"","Type":"varchar(64)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"account_type","Notes":"帐号类型:0手机号,1邮件","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"app_key","Notes":"authbucket_oauth2_client表的id","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"user_info_tbl_id","Notes":"","Type":"int(11)","Index":[{"Key":3,"KeyName":"user_info_id"}],"IsNull":false,"ForeignKeyList":[{"TableName":"user_info_tbl","ColumnName":"id"}]},{"Name":"reg_time","Notes":"","Type":"datetime","Index":null,"IsNull":true,"ForeignKeyList":null},{"Name":"reg_ip","Notes":"","Type":"varchar(15)","Index":[{"Key":3,"KeyName":"user_info_id"}],"IsNull":true,"ForeignKeyList":null},{"Name":"bundle_id","Notes":"","Type":"varchar(255)","Index":null,"IsNull":true,"ForeignKeyList":null},{"Name":"describ","Notes":"","Type":"varchar(255)","Index":null,"IsNull":true,"ForeignKeyList":null}]},{"Name":"user_info_tbl","Notes":"用户信息","SQLBuildStr":"","Em":[{"Name":"","Notes":"","Type":"gorm.Model","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"nickname","Notes":"","Type":"varchar(32)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"headurl","Notes":"","Type":"varchar(255)","Index":null,"IsNull":true,"ForeignKeyList":null}]},{"Name":"oauth2_access_token","Notes":"token认证","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"access_token","Notes":"","Type":"varchar(255)","Index":[{"Key":2,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"token_type","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"app_key","Notes":"key","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"username","Notes":"用户名","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"expires","Notes":"过期时间","Type":"datetime","Index":null,"IsNull":false,"ForeignKeyList":null}]},{"Name":"user","Notes":"","SQLBuildStr":"","Em":[{"Name":"userId","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"name","Notes":"","Type":"varchar(30)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"sex","Notes":"","Type":"int(11)","Index":[{"Key":3,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"job","Notes":"","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null}]},{"Name":"organ","Notes":"","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"userId","Notes":"","Type":"int(11)","Index":[{"Key":3,"KeyName":""}],"IsNull":true,"ForeignKeyList":[{"TableName":"user","ColumnName":"sex"}]},{"Name":"type","Notes":"","Type":"int(11)","Index":null,"IsNull":true,"ForeignKeyList":null},{"Name":"score","Notes":"","Type":"int(11)","Index":null,"IsNull":true,"ForeignKeyList":null}]},{"Name":"sign_client_tbl","Notes":"","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"app_key","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"app_secret","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"expire_time","Notes":"超时时间","Type":"datetime","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"strict_sign","Notes":"是否强制验签:0:用户自定义,1:强制","Type":"int(255)","Index":null,"IsNull":true,"ForeignKeyList":null},{"Name":"strict_verify","Notes":"是否强制验证码:0:用户自定义,1:强制","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"token_expire_time","Notes":"token过期时间","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null}]},{"Name":"user_paybill_order","Notes":"","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"paybill_id","Notes":"二次账单id","Type":"bigint(20)","Index":[{"Key":3,"KeyName":"order_id"}],"IsNull":false,"ForeignKeyList":null},{"Name":"order_id_mysql","Notes":"MySql中的订单Id","Type":"bigint(20)","Index":[{"Key":3,"KeyName":"order_id"}],"IsNull":false,"ForeignKeyList":null},{"Name":"order_item_id_mysql","Notes":"MySql中的订单ItemId","Type":"bigint(20)","Index":[{"Key":3,"KeyName":"order_id"}],"IsNull":false,"ForeignKeyList":null},{"Name":"order_id_mssql","Notes":"MsSql中的订单Id","Type":"bigint(20)","Index":null,"IsNull":false,"ForeignKeyList":null}]},{"Name":"oauth2_client_tbl","Notes":"client key 信息","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"app_key","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"app_secret","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"expire_time","Notes":"超时时间","Type":"datetime","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"strict_sign","Notes":"是否强制验签:0:用户自定义,1:强制","Type":"int(255)","Index":null,"IsNull":true,"ForeignKeyList":null},{"Name":"strict_verify","Notes":"是否强制验证码:0:用户自定义,1:强制","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"token_expire_time","Notes":"token过期时间","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"aaa","Notes":"","Type":"json","Index":null,"IsNull":true,"ForeignKeyList":null}]},{"Name":"oauth2_refresh_token","Notes":"刷新token","SQLBuildStr":"","Em":[{"Name":"id","Notes":"","Type":"int(11)","Index":[{"Key":1,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"refresh_token","Notes":"","Type":"varchar(255)","Index":[{"Key":2,"KeyName":""}],"IsNull":false,"ForeignKeyList":null},{"Name":"token_type","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"app_key","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"username","Notes":"","Type":"varchar(255)","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"expires","Notes":"","Type":"datetime","Index":null,"IsNull":false,"ForeignKeyList":null},{"Name":"token_expire_time","Notes":"","Type":"int(11)","Index":null,"IsNull":false,"ForeignKeyList":null}]}]}` var pkg DBInfo diff --git a/doc/export.md b/doc/export.md index cef3192..789550c 100644 --- a/doc/export.md +++ b/doc/export.md @@ -60,7 +60,7 @@ type UserAccountTbl struct { ### Simple-export-with-JSON -- param:singular_table = false simple = true is_json_tag = true is_foreign_key = false +- param:singular_table = false simple = true is_web_tag = true is_foreign_key = false ###### --->export result @@ -84,7 +84,7 @@ type UserAccountTbl struct { ### Simple export without JSON -- param:singular_table = false simple = true is_json_tag = false is_foreign_key = false +- param:singular_table = false simple = true is_web_tag = false is_foreign_key = false ###### --->export result @@ -108,7 +108,7 @@ type UserAccountTbl struct { ### Simple with foreign key mode export -- param:singular_table = false simple = true is_json_tag = false is_foreign_key = true +- param:singular_table = false simple = true is_web_tag = false is_foreign_key = true ###### --->export result @@ -147,7 +147,7 @@ CREATE TABLE `user_info_tbl` ( ### Support export gorm.model -- param:singular_table = false simple = true is_json_tag = false +- param:singular_table = false simple = true is_web_tag = false ###### --->export result diff --git a/doc/export_cn.md b/doc/export_cn.md index f643d61..8521058 100644 --- a/doc/export_cn.md +++ b/doc/export_cn.md @@ -60,7 +60,7 @@ type UserAccountTbl struct { ### 简单带json导出 -- 参数:singular_table = false simple = true is_json_tag = true is_foreign_key = false +- 参数:singular_table = false simple = true is_web_tag = true is_foreign_key = false ###### --->导出结果 @@ -84,7 +84,7 @@ type UserAccountTbl struct { ### 简单不带json导出 -- 参数:singular_table = false simple = true is_json_tag = false is_foreign_key = false +- 参数:singular_table = false simple = true is_web_tag = false is_foreign_key = false ###### --->导出结果 @@ -108,7 +108,7 @@ type UserAccountTbl struct { ### 简单带外键模式导出 -- 参数:singular_table = false simple = true is_json_tag = false is_foreign_key = true +- 参数:singular_table = false simple = true is_web_tag = false is_foreign_key = true ###### --->导出结果 @@ -147,7 +147,7 @@ CREATE TABLE `user_info_tbl` ( ### 支持gorm.Model模式导出 -- 参数:singular_table = false simple = true is_json_tag = false +- 参数:singular_table = false simple = true is_web_tag = false ###### --->导出结果 diff --git a/go.mod b/go.mod index d129b38..e492224 100644 --- a/go.mod +++ b/go.mod @@ -3,19 +3,16 @@ module github.com/xxjwxc/gormt go 1.13 require ( - github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835 // indirect github.com/go-playground/universal-translator v0.17.0 // indirect github.com/go-sql-driver/mysql v1.4.1 github.com/jinzhu/gorm v1.9.11 github.com/jroimartin/gocui v0.4.0 - github.com/kr/pretty v0.1.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect github.com/nicksnyder/go-i18n/v2 v2.0.3 github.com/spf13/cobra v0.0.5 - github.com/xxjwxc/public v0.0.0-20200221114751-56810b3fcc29 + github.com/xxjwxc/public v0.0.0-20200329130606-2b6bdf6dc342 golang.org/x/text v0.3.2 - gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v9 v9.30.2 - gopkg.in/yaml.v2 v2.2.7 + gopkg.in/yaml.v2 v2.2.7 // indirect gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 ) diff --git a/go.sum b/go.sum index 3b9251a..4874d52 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU= cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -11,12 +12,14 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/ant0ine/go-json-rest v3.3.2+incompatible/go.mod h1:q6aCt0GfU6LhpBsnZ/2U+mwe+0XB5WStbmwyoPfc+sk= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/astaxie/beego v1.7.1/go.mod h1:0R4++1tUqERR0WYFWdfkcrsyoVBCG4DgpDGokT3yb+U= github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY= github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 h1:OYA+5W64v3OgClL+IrOD63t4i/RW7RqrAVl9LTZ9UqQ= github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394/go.mod h1:Q8n74mJTIgjX4RBBcHnJ05h//6/k6foqmgE45jTQtxg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bradfitz/gomemcache v0.0.0-20160117192205-fb1f79c6b65a/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -24,6 +27,7 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= @@ -34,8 +38,7 @@ github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DP github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/ezbuy/tgen v0.0.0-20180109020500-95ef13895032/go.mod h1:OeW1N0acAlRaGTlOG8jRZZUKEtyiGa0qvD+lWNWb9vs= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835 h1:roDmqJ4Qes7hrDOsWsMCce0vQHz3xiMPjJ9m4c2eeNs= -github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835/go.mod h1:BjL/N0+C+j9uNX+1xcNuM9vdSIcXCZrQZUYbXOFbgN8= +github.com/gin-gonic/gin v1.1.4/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -50,9 +53,12 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v0.0.0-20161117033126-8ee79997227b/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomodule/redigo v2.0.1-0.20180627144507-2cd21d9966bf+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -81,8 +87,10 @@ github.com/kardianos/service v1.0.1-0.20191017145738-4df36c9fc1c6/go.mod h1:8CzD github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= @@ -90,6 +98,8 @@ github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739/go.mod h1:zUx1mhth20V3VKgL5jbd1BSQcW4Fy6Qs4PZvQwRFwzM= +github.com/mattn/go-isatty v0.0.0-20161123143637-30a891c33c7c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= @@ -97,8 +107,8 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/muesli/cache2go v0.0.0-20191019095710-4098a3aa8c94/go.mod h1:414R+qZrt4f9S2TO/s6YVQMNAXR2KdwqQ7pW+O4oYzU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nicksnyder/go-i18n v2.0.3+incompatible h1:XCCaWsCoy4KlWkhOr+63dkv6oJmitJ573uJqDBAiFiQ= github.com/nicksnyder/go-i18n/v2 v2.0.3 h1:ks/JkQiOEhhuF6jpNvx+Wih1NIiXzUnZeZVnJuI8R8M= github.com/nicksnyder/go-i18n/v2 v2.0.3/go.mod h1:oDab7q8XCYMRlcrBnaY/7B1eOectbvj6B1UPBT+p5jo= github.com/nsf/termbox-go v0.0.0-20191229070316-58d4fcbce2a7 h1:OkWEy7aQeQTbgdrcGi9bifx+Y6bMM7ae7y42hDFaBvA= @@ -112,6 +122,7 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -122,6 +133,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/silenceper/wechat v1.2.3/go.mod h1:sEqmYpYrwwMCXUSzTaxcA78+fd0p+srrj8qRkOnpbLQ= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -135,23 +147,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 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/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f h1:PyaqoUhjkgpBGR/8LXWvk3yzrILMXC7Ygu8xhl5+sM8= -github.com/xxjwxc/public v0.0.0-20191107073037-ea6b812d567f/go.mod h1:j0CCXMUDtykGMfOoBpy1pfmzEeBk2JVusosjbgjfMZg= -github.com/xxjwxc/public v0.0.0-20200120133922-c61314a90a4a h1:sQ+O2UwDj1ShdZ6NLgp98cmaZLWrkFpVJB+wOzj1kDQ= -github.com/xxjwxc/public v0.0.0-20200120133922-c61314a90a4a/go.mod h1:UYQUNNJmUzNKpjY5ctz1n/XoJonmhAIgD51zS2rEsek= -github.com/xxjwxc/public v0.0.0-20200120153226-f36cf754df21 h1:1OF0Q6FGQhmziN4yvHLiF9XXOqfChL5z4rcogSQqCos= -github.com/xxjwxc/public v0.0.0-20200221114751-56810b3fcc29 h1:C0fnjiwnCBjovovCTkrjVXQtqd+UdVD2N8yaVK8LHwk= -github.com/xxjwxc/public v0.0.0-20200221114751-56810b3fcc29/go.mod h1:lhh94GsxhTweM/OaF7eFzOAgVV6fSSbBvA6zOtOVmdU= +github.com/xxjwxc/public v0.0.0-20200329130606-2b6bdf6dc342 h1:qHG/g/AaeBKx+8XiGr5QTYIOoTojfea9ikTCqdYuAEs= +github.com/xxjwxc/public v0.0.0-20200329130606-2b6bdf6dc342/go.mod h1:8c3gMuRJkSGX3DpDvxU0fWfEEbuMi1LxPsKEBp97dnc= 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-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284 h1:rlLehGeYg6jfoyz/eDqDU1iRXLKfR42nnNh57ytKEWo= golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -167,6 +176,7 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20191125084936-ffdde1057850/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -174,6 +184,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -198,6 +209,7 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -206,12 +218,18 @@ google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/eapache/queue.v1 v1.1.0/go.mod h1:wNtmx1/O7kZSR9zNT1TTOJ7GLpm3Vn7srzlfylFbQwU= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.1/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.30.2 h1:icxYLlYflpazIV3ufMoNB9h9SYMQ37DZ8CTwkU4pnOs= gopkg.in/go-playground/validator.v9 v9.30.2/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/go-with/wxpay.v1 v1.3.0/go.mod h1:12lWy92n19pAUSSE3BrOiEZbWRkl+9tneOd/aU/LU6g= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=