mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[优化]结构
This commit is contained in:
@@ -18,29 +18,24 @@ func Init{{.ClassName}}Router(router *gin.RouterGroup) {
|
|||||||
}
|
}
|
||||||
routerGroup := router.Group("{{.BusinessName}}")
|
routerGroup := router.Group("{{.BusinessName}}")
|
||||||
|
|
||||||
{{.ClassName}}ListLog := ginx.NewLogInfo("获取{{.FunctionName}}分页列表")
|
|
||||||
routerGroup.GET("list", func(c *gin.Context) {
|
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) {
|
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) {
|
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) {
|
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) {
|
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}})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user