mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
feat:update tpl
This commit is contained in:
@@ -191,6 +191,8 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
|
||||
column.IsPk = "1"
|
||||
column.Pk = true
|
||||
data.PkColumn = dbcolumn[i].ColumnName
|
||||
column.GoField = strings.ToUpper(column.GoField)
|
||||
column.JsonField = strings.ToUpper(column.JsonField)
|
||||
data.PkGoField = column.GoField
|
||||
data.PkJsonField = column.JsonField
|
||||
}
|
||||
@@ -202,7 +204,9 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
|
||||
|
||||
if strings.Contains(dbcolumn[i].ColumnType, "int") {
|
||||
if strings.Contains(dbcolumn[i].ColumnKey, "PR") {
|
||||
column.GoType = "int"
|
||||
column.GoType = "uint"
|
||||
} else if strings.Contains(dbcolumn[i].ColumnType, "unsigned") {
|
||||
column.GoType = "uint"
|
||||
} else {
|
||||
column.GoType = "string"
|
||||
}
|
||||
@@ -210,6 +214,9 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
|
||||
} else if strings.Contains(dbcolumn[i].ColumnType, "timestamp") {
|
||||
column.GoType = "time.Time"
|
||||
column.HtmlType = "datetime"
|
||||
} else if strings.Contains(dbcolumn[i].ColumnType, "datetime") {
|
||||
column.GoType = "time.Time"
|
||||
column.HtmlType = "datetime"
|
||||
} else {
|
||||
column.GoType = "string"
|
||||
column.HtmlType = "input"
|
||||
|
||||
Reference in New Issue
Block a user