Skip to content

Commit

Permalink
fix🐛:模板Update方法,err没有被赋值,返回的err永远是nil
Browse files Browse the repository at this point in the history
  • Loading branch information
zyd committed Sep 7, 2022
1 parent d7e6855 commit 3685510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions template/v4/no_actions/service.go.template
Expand Up @@ -80,7 +80,7 @@ func (e *{{.ClassName}}) Update(c *dto.{{.ClassName}}UpdateReq, p *actions.DataP
c.Generate(&data)

db := e.Orm.Save(&data)
if db.Error != nil {
if err = db.Error; err != nil {
e.Log.Errorf("{{.ClassName}}Service Save error:%s \r\n", err)
return err
}
Expand All @@ -106,4 +106,4 @@ func (e *{{.ClassName}}) Remove(d *dto.{{.ClassName}}DeleteReq, p *actions.DataP
return errors.New("无权删除该数据")
}
return nil
}
}

0 comments on commit 3685510

Please sign in to comment.