feat 更新service

This commit is contained in:
wenjianzhang
2021-05-07 19:57:45 +08:00
parent 50a5d6f48d
commit c6d94c03fb
11 changed files with 55 additions and 158 deletions
+8 -8
View File
@@ -21,7 +21,7 @@ type Gen struct {
apis.Api
}
func (e *Gen) Preview(c *gin.Context) {
func (e Gen) Preview(c *gin.Context) {
e.Context = c
log := e.GetLogger()
table := tools.SysTables{}
@@ -109,7 +109,7 @@ func (e *Gen) Preview(c *gin.Context) {
e.OK(mp, "")
}
func (e *Gen) GenCode(c *gin.Context) {
func (e Gen) GenCode(c *gin.Context) {
e.Context = c
log := e.GetLogger()
table := tools.SysTables{}
@@ -139,7 +139,7 @@ func (e *Gen) GenCode(c *gin.Context) {
e.OK("", "Code generated successfully")
}
func (e *Gen) GenApiToFile(c *gin.Context) {
func (e Gen) GenApiToFile(c *gin.Context) {
e.Context = c
log := e.GetLogger()
table := tools.SysTables{}
@@ -164,7 +164,7 @@ func (e *Gen) GenApiToFile(c *gin.Context) {
e.OK("", "Code generated successfully")
}
func (e *Gen) NOActionsGen(c *gin.Context, tab tools.SysTables) {
func (e Gen) NOActionsGen(c *gin.Context, tab tools.SysTables) {
e.Context = c
log := e.GetLogger()
@@ -249,7 +249,7 @@ func (e *Gen) NOActionsGen(c *gin.Context, tab tools.SysTables) {
}
func (e *Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
func (e Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
e.Context = c
log := e.GetLogger()
@@ -272,7 +272,7 @@ func (e *Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
}
func (e *Gen) ActionsGen(c *gin.Context, tab tools.SysTables) {
func (e Gen) ActionsGen(c *gin.Context, tab tools.SysTables) {
log := api.GetRequestLogger(c)
basePath := "template/v4/"
routerFile := basePath + "actions/router_check_role.go.template"
@@ -336,7 +336,7 @@ func (e *Gen) ActionsGen(c *gin.Context, tab tools.SysTables) {
pkg.FileCreate(b6, "./app/"+tab.PackageName+"/service/dto/"+tab.BusinessName+".go")
}
func (e *Gen) GenMenuAndApi(c *gin.Context) {
func (e Gen) GenMenuAndApi(c *gin.Context) {
log := api.GetRequestLogger(c)
table := tools.SysTables{}
@@ -578,4 +578,4 @@ func (e *Gen) GenMenuAndApi(c *gin.Context) {
ADelete.MenuId, err = ADelete.Create(db)
e.OK("", "数据生成成功!")
}
}