feat :模版优化

This commit is contained in:
zhangwenjian
2021-02-25 23:40:55 +08:00
parent 734a48dbb8
commit 19e96a01de
7 changed files with 26 additions and 29 deletions
+5 -5
View File
@@ -206,7 +206,7 @@ func GenMenuAndApi(c *gin.Context) {
Cmenu.Path = tab.TBName
Cmenu.MenuType = "C"
Cmenu.Action = "无"
Cmenu.Permission = tab.ModuleName + ":" + tab.BusinessName + ":list"
Cmenu.Permission = tab.PackageName + ":" + tab.BusinessName + ":list"
Cmenu.ParentId = Mmenu.MenuId
Cmenu.NoCache = false
Cmenu.Component = "/" + tab.BusinessName + "/index"
@@ -226,7 +226,7 @@ func GenMenuAndApi(c *gin.Context) {
MList.Path = tab.TBName
MList.MenuType = "F"
MList.Action = "无"
MList.Permission = tab.ModuleName + ":" + tab.BusinessName + ":query"
MList.Permission = tab.PackageName + ":" + tab.BusinessName + ":query"
MList.ParentId = Cmenu.MenuId
MList.NoCache = false
MList.Sort = 0
@@ -245,7 +245,7 @@ func GenMenuAndApi(c *gin.Context) {
MCreate.Path = tab.TBName
MCreate.MenuType = "F"
MCreate.Action = "无"
MCreate.Permission = tab.ModuleName + ":" + tab.BusinessName + ":add"
MCreate.Permission = tab.PackageName + ":" + tab.BusinessName + ":add"
MCreate.ParentId = Cmenu.MenuId
MCreate.NoCache = false
MCreate.Sort = 0
@@ -264,7 +264,7 @@ func GenMenuAndApi(c *gin.Context) {
MUpdate.Path = tab.TBName
MUpdate.MenuType = "F"
MUpdate.Action = "无"
MUpdate.Permission = tab.ModuleName + ":" + tab.BusinessName + ":edit"
MUpdate.Permission = tab.PackageName + ":" + tab.BusinessName + ":edit"
MUpdate.ParentId = Cmenu.MenuId
MUpdate.NoCache = false
MUpdate.Sort = 0
@@ -283,7 +283,7 @@ func GenMenuAndApi(c *gin.Context) {
MDelete.Path = tab.TBName
MDelete.MenuType = "F"
MDelete.Action = "无"
MDelete.Permission = tab.ModuleName + ":" + tab.BusinessName + ":remove"
MDelete.Permission = tab.PackageName + ":" + tab.BusinessName + ":remove"
MDelete.ParentId = Cmenu.MenuId
MDelete.NoCache = false
MDelete.Sort = 0
+4 -6
View File
@@ -191,8 +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)
//column.GoField = strings.ToUpper(column.GoField)
//column.JsonField = strings.ToUpper(column.JsonField)
data.PkGoField = column.GoField
data.PkJsonField = column.JsonField
}
@@ -204,10 +204,8 @@ 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 = "uint"
} else if strings.Contains(dbcolumn[i].ColumnType, "unsigned") {
column.GoType = "uint"
} else {
column.GoType = "int"
} else {
column.GoType = "string"
}
column.HtmlType = "input"