diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 1bc14b5a..fbb6a16e 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -33,7 +33,7 @@ func (m *{{.ClassName}}Search) Bind(ctx *gin.Context) error { log := api.GetRequestLogger(ctx) err := ctx.ShouldBind(m) if err != nil { - log.Debugf("ShouldBind error: %s", err.Error()) + log.Warnf("ShouldBind error: %s", err.Error()) } return err } @@ -63,12 +63,12 @@ func (s *{{.ClassName}}Control) Bind(ctx *gin.Context) error { log := api.GetRequestLogger(ctx) err := ctx.ShouldBindUri(s) if err != nil { - log.Debugf("ShouldBindUri error: %s", err.Error()) + log.Warnf("ShouldBindUri error: %s", err.Error()) return err } err = ctx.ShouldBind(s) if err != nil { - log.Debugf("ShouldBind error: %s", err.Error()) + log.Warnf("ShouldBind error: %s", err.Error()) } return err } @@ -111,12 +111,12 @@ func (s *{{.ClassName}}ById) Bind(ctx *gin.Context) error { log := api.GetRequestLogger(ctx) err := ctx.ShouldBindUri(s) if err != nil { - log.Debugf("ShouldBindUri error: %s", err.Error()) + log.Warnf("ShouldBindUri error: %s", err.Error()) return err } err = ctx.ShouldBind(s) if err != nil { - log.Debugf("ShouldBind error: %s", err.Error()) + log.Warnf("ShouldBind error: %s", err.Error()) } return err } diff --git a/template/v4/no_actions/apis.go.template b/template/v4/no_actions/apis.go.template index ae09942d..4af74e22 100644 --- a/template/v4/no_actions/apis.go.template +++ b/template/v4/no_actions/apis.go.template @@ -147,7 +147,7 @@ func (e *{{.ClassName}}) Insert{{.ClassName}}(c *gin.Context) { service{{.ClassName}} := service.{{.ClassName}}{} service{{.ClassName}}.Orm = db service{{.ClassName}}.Log = log - err = service{{.ClassName}}.Insert{{.ClassName}}(object.(*(models.{{.ClassName}}))) + err = service{{.ClassName}}.Insert{{.ClassName}}(object.(*models.{{.ClassName}})) if err != nil { log.Errorf("Insert {{.ClassName}} error, %s", err.Error()) e.Error(c, http.StatusInternalServerError, err, "创建失败")