fix:fix parameter setting

This commit is contained in:
zhangwenjian
2020-07-23 18:11:10 +08:00
parent ca62b4ef1d
commit 791d07d09b
+4 -2
View File
@@ -55,6 +55,8 @@ func Preview(c *gin.Context) {
func GenCode(c *gin.Context) { func GenCode(c *gin.Context) {
table := tools.SysTables{} table := tools.SysTables{}
id, err := tools2.StringToInt(c.Param("tableId")) id, err := tools2.StringToInt(c.Param("tableId"))
tools2.HasError(err, "", -1)
table.TableId = id
ischeckrole := true ischeckrole := true
rouyerfile := "template/routercheckrole.go.template" rouyerfile := "template/routercheckrole.go.template"
@@ -77,8 +79,8 @@ func GenCode(c *gin.Context) {
rouyerfile = "template/routernocheckrole.go.template" rouyerfile = "template/routernocheckrole.go.template"
} }
tools2.HasError(err, "", -1)
table.TableId = id
t1, err := template.ParseFiles("template/model.go.template") t1, err := template.ParseFiles("template/model.go.template")
tools2.HasError(err, "", -1) tools2.HasError(err, "", -1)