调整log代码,兼容zap扩展支持fields
This commit is contained in:
1 parent
39dd1ee6f8
commit
75711922b4
47 files changed
+267
-275
No files matched your search
@@ -2,11 +2,11 @@ package dto
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/go-admin-team/go-admin-core/logger"
|
||||
"go-admin/common/apis"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
common "go-admin/common/models"
|
||||
"go-admin/tools"
|
||||
)
|
||||
|
||||
type SysCategorySearch struct {
|
||||
@@ -21,10 +21,10 @@ func (m *SysCategorySearch) GetNeedSearch() interface{} {
|
||||
}
|
||||
|
||||
func (m *SysCategorySearch) Bind(ctx *gin.Context) error {
|
||||
msgID := tools.GenerateMsgIDFromContext(ctx)
|
||||
log := apis.GetRequestLogger(ctx)
|
||||
err := ctx.ShouldBind(m)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBind error: %s", msgID, err.Error())
|
||||
log.Debugf("ShouldBind error: %s", err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -49,15 +49,15 @@ type SysCategoryControl struct {
|
||||
}
|
||||
|
||||
func (s *SysCategoryControl) Bind(ctx *gin.Context) error {
|
||||
msgID := tools.GenerateMsgIDFromContext(ctx)
|
||||
log := apis.GetRequestLogger(ctx)
|
||||
err := ctx.ShouldBindUri(s)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBindUri error: %s", msgID, err.Error())
|
||||
log.Debugf("ShouldBindUri error: %s", err.Error())
|
||||
return err
|
||||
}
|
||||
err = ctx.ShouldBind(s)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
|
||||
log.Debugf("ShouldBind error: %s", err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -93,4 +93,4 @@ func (s *SysCategoryById) Generate() dto.Control {
|
||||
|
||||
func (s *SysCategoryById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysCategory{}, nil
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user