|
|
@ -68,14 +68,14 @@ func OnGetPackageInfo(orm *mysqldb.MySqlDB, tabls map[string]string) generate.Ge
|
|
|
|
func OnGetTableElement(orm *mysqldb.MySqlDB, tab string) []generate.GenElement {
|
|
|
|
func OnGetTableElement(orm *mysqldb.MySqlDB, tab string) []generate.GenElement {
|
|
|
|
var el []generate.GenElement
|
|
|
|
var el []generate.GenElement
|
|
|
|
var list []struct {
|
|
|
|
var list []struct {
|
|
|
|
Field string `gorm:"Field"`
|
|
|
|
Field string `gorm:"column:Field"`
|
|
|
|
Type string `gorm:"Type"`
|
|
|
|
Type string `gorm:"column:Type"`
|
|
|
|
Key string `gorm:"key"`
|
|
|
|
Key string `gorm:"column:key"`
|
|
|
|
Desc string `gorm:"Comment"`
|
|
|
|
Desc string `gorm:"column:Comment"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取表注释
|
|
|
|
//获取表注释
|
|
|
|
orm.Raw("show FULL COLUMNS from ?;", tab).Find(&list)
|
|
|
|
orm.Raw("show FULL COLUMNS from " + tab).Find(&list)
|
|
|
|
for _, v := range list {
|
|
|
|
for _, v := range list {
|
|
|
|
var tmp generate.GenElement
|
|
|
|
var tmp generate.GenElement
|
|
|
|
tmp.SetName(OnGetCamelName(v.Field))
|
|
|
|
tmp.SetName(OnGetCamelName(v.Field))
|
|
|
|