gen : upgrade gen

This commit is contained in:
zhangwenjian
2020-08-01 12:56:19 +08:00
parent 80ef9e46ab
commit 89fe63c915
3 changed files with 31 additions and 6 deletions
+8 -1
View File
@@ -168,8 +168,15 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
}
if strings.Contains(dbcolumn[i].ColumnType, "int") {
column.GoType = "int"
if strings.Contains(dbcolumn[i].ColumnKey, "PR") {
column.GoType = "int"
} else {
column.GoType = "string"
}
column.HtmlType = "input"
} else if strings.Contains(dbcolumn[i].ColumnType, "timestamp") {
column.GoType = "time.Time"
column.HtmlType = "datetime"
} else {
column.GoType = "string"
column.HtmlType = "input"