fix🐛 gen问题修正

This commit is contained in:
wenjianzhang
2021-05-08 17:16:52 +08:00
parent 9bc2791b26
commit 6a2557064c
4 changed files with 11 additions and 10 deletions
+2 -3
View File
@@ -19,12 +19,11 @@ type Api struct {
func (e Api) SetContext(c *gin.Context) {
e.Context = c
e.Logger = api.GetRequestLogger(c)
}
// GetLogger 获取上下文提供的日志
func (e Api) GetLogger() *logger.Logger {
return e.Logger
return api.GetRequestLogger(e.Context)
}
func (e Api) Bind(d interface{}, bindings ...binding.Binding) error {
@@ -71,4 +70,4 @@ func (e Api) PageOK(result interface{}, count int, pageIndex int, pageSize int,
// Custom 兼容函数
func (e Api) Custom(data gin.H) {
response.Custum(e.Context, data)
}
}