From 3685510d254c85d157f7d07c659db8516e56400a Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Wed, 7 Sep 2022 20:08:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=F0=9F=90=9B:=E6=A8=A1=E6=9D=BFUpdate?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8Cerr=E6=B2=A1=E6=9C=89=E8=A2=AB?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=EF=BC=8C=E8=BF=94=E5=9B=9E=E7=9A=84err?= =?UTF-8?q?=E6=B0=B8=E8=BF=9C=E6=98=AFnil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/service.go.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/v4/no_actions/service.go.template b/template/v4/no_actions/service.go.template index 8ab3ef6f..84e8886f 100644 --- a/template/v4/no_actions/service.go.template +++ b/template/v4/no_actions/service.go.template @@ -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 } @@ -106,4 +106,4 @@ func (e *{{.ClassName}}) Remove(d *dto.{{.ClassName}}DeleteReq, p *actions.DataP return errors.New("无权删除该数据") } return nil -} \ No newline at end of file +}