diff --git a/resource/template/go/router.template b/resource/template/go/router.template index 66ef5a0..b50a620 100644 --- a/resource/template/go/router.template +++ b/resource/template/go/router.template @@ -18,29 +18,24 @@ func Init{{.ClassName}}Router(router *gin.RouterGroup) { } routerGroup := router.Group("{{.BusinessName}}") - {{.ClassName}}ListLog := ginx.NewLogInfo("获取{{.FunctionName}}分页列表") routerGroup.GET("list", func(c *gin.Context) { - ginx.NewReqCtx(c).WithLog({{.ClassName}}ListLog).Handle(s.Get{{.ClassName}}List) + ginx.NewReqCtx(c).WithLog("获取{{.FunctionName}}分页列表").Handle(s.Get{{.ClassName}}List) }) - {{.ClassName}}Log := ginx.NewLogInfo("获取{{.FunctionName}}信息") routerGroup.GET(":{{.PkJsonField}}", func(c *gin.Context) { - ginx.NewReqCtx(c).WithLog({{.ClassName}}Log).Handle(s.Get{{.ClassName}}) + ginx.NewReqCtx(c).WithLog("获取{{.FunctionName}}信息").Handle(s.Get{{.ClassName}}) }) - insert{{.ClassName}}Log := ginx.NewLogInfo("添加{{.FunctionName}}信息") routerGroup.POST("", func(c *gin.Context) { - ginx.NewReqCtx(c).WithLog(insert{{.ClassName}}Log).Handle(s.Insert{{.ClassName}}) + ginx.NewReqCtx(c).WithLog("添加{{.FunctionName}}信息").Handle(s.Insert{{.ClassName}}) }) - update{{.ClassName}}Log := ginx.NewLogInfo("修改{{.FunctionName}}信息") routerGroup.PUT("", func(c *gin.Context) { - ginx.NewReqCtx(c).WithLog(update{{.ClassName}}Log).Handle(s.Update{{.ClassName}}) + ginx.NewReqCtx(c).WithLog("修改{{.FunctionName}}信息").Handle(s.Update{{.ClassName}}) }) - delete{{.ClassName}}Log := ginx.NewLogInfo("删除{{.FunctionName}}信息") routerGroup.DELETE(":{{.PkJsonField}}", func(c *gin.Context) { - ginx.NewReqCtx(c).WithLog(delete{{.ClassName}}Log).Handle(s.Delete{{.ClassName}}) + ginx.NewReqCtx(c).WithLog("删除{{.FunctionName}}信息").Handle(s.Delete{{.ClassName}}) }) }