feat✨ 去除生成方法版本信息
This commit is contained in:
1 parent
debe808f83
commit
c6ccd844f5
2 files changed
+10
-7
No files matched your search
@@ -109,7 +109,7 @@ func (e *Gen) Preview(c *gin.Context) {
|
|||||||
e.OK(mp, "")
|
e.OK(mp, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Gen) GenCodeV3(c *gin.Context) {
|
func (e *Gen) GenCode(c *gin.Context) {
|
||||||
e.Context = c
|
e.Context = c
|
||||||
log := e.GetLogger()
|
log := e.GetLogger()
|
||||||
table := tools.SysTables{}
|
table := tools.SysTables{}
|
||||||
@@ -131,9 +131,9 @@ func (e *Gen) GenCodeV3(c *gin.Context) {
|
|||||||
tab, _ := table.Get(db)
|
tab, _ := table.Get(db)
|
||||||
|
|
||||||
if tab.IsActions == 1 {
|
if tab.IsActions == 1 {
|
||||||
e.ActionsGenV3(c, tab)
|
e.ActionsGen(c, tab)
|
||||||
} else {
|
} else {
|
||||||
e.NOActionsGenV3(c, tab)
|
e.NOActionsGen(c, tab)
|
||||||
}
|
}
|
||||||
|
|
||||||
e.OK("", "Code generated successfully!")
|
e.OK("", "Code generated successfully!")
|
||||||
@@ -164,7 +164,7 @@ func (e *Gen) GenApiToFile(c *gin.Context) {
|
|||||||
e.OK("", "Code generated successfully!")
|
e.OK("", "Code generated successfully!")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Gen) NOActionsGenV3(c *gin.Context, tab tools.SysTables) {
|
func (e *Gen) NOActionsGen(c *gin.Context, tab tools.SysTables) {
|
||||||
e.Context = c
|
e.Context = c
|
||||||
log := e.GetLogger()
|
log := e.GetLogger()
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ func (e *Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Gen) ActionsGenV3(c *gin.Context, tab tools.SysTables) {
|
func (e *Gen) ActionsGen(c *gin.Context, tab tools.SysTables) {
|
||||||
log := api.GetRequestLogger(c)
|
log := api.GetRequestLogger(c)
|
||||||
basePath := "template/v4/"
|
basePath := "template/v4/"
|
||||||
routerFile := basePath + "actions/router_check_role.go.template"
|
routerFile := basePath + "actions/router_check_role.go.template"
|
||||||
|
|||||||
@@ -46,7 +46,10 @@ func sysBaseRouter(r *gin.RouterGroup) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sysStaticFileRouter(r *gin.RouterGroup) {
|
func sysStaticFileRouter(r *gin.RouterGroup) {
|
||||||
mime.AddExtensionType(".js", "application/javascript")
|
err := mime.AddExtensionType(".js", "application/javascript")
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
r.Static("/static", "./static")
|
r.Static("/static", "./static")
|
||||||
r.Static("/form-generator", "./static/form-generator")
|
r.Static("/form-generator", "./static/form-generator")
|
||||||
}
|
}
|
||||||
@@ -64,7 +67,7 @@ func sysNoCheckRoleRouter(r *gin.RouterGroup) {
|
|||||||
v1.GET("/getCaptcha", sys.GenerateCaptchaHandler)
|
v1.GET("/getCaptcha", sys.GenerateCaptchaHandler)
|
||||||
gen := tools.Gen{}
|
gen := tools.Gen{}
|
||||||
v1.GET("/gen/preview/:tableId", gen.Preview)
|
v1.GET("/gen/preview/:tableId", gen.Preview)
|
||||||
v1.GET("/gen/toproject/:tableId", gen.GenCodeV3)
|
v1.GET("/gen/toproject/:tableId", gen.GenCode)
|
||||||
v1.GET("/gen/apitofile/:tableId", gen.GenApiToFile)
|
v1.GET("/gen/apitofile/:tableId", gen.GenApiToFile)
|
||||||
|
|
||||||
v1.GET("/gen/todb/:tableId", gen.GenMenuAndApi)
|
v1.GET("/gen/todb/:tableId", gen.GenMenuAndApi)
|
||||||
|
|||||||
Reference in new issue
Block a user