From 5e7ba8288fd7970132fafe48c54a6e405dab7320 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 12 Mar 2024 09:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=93=E6=AD=A6=E5=8D=87?= =?UTF-8?q?=E6=98=9F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/exclusive/api_starup.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/exclusive/api_starup.go b/modules/exclusive/api_starup.go index b8695f956..e33b6c47f 100644 --- a/modules/exclusive/api_starup.go +++ b/modules/exclusive/api_starup.go @@ -1,6 +1,7 @@ package exclusive import ( + "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" ) @@ -21,7 +22,7 @@ func (this *apiComp) StarUp(session comm.IUserSession, req *pb.ExclusiveStarUpRe err error ) - if list, err = this.module.model.getExclusivesByIds(session.GetUserId(), req.Eatid); err != nil { + if list, err = this.module.model.getExclusivesByIds(session.GetUserId(), append(req.Eatid, req.Oid)); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), @@ -36,6 +37,13 @@ func (this *apiComp) StarUp(session comm.IUserSession, req *pb.ExclusiveStarUpRe stars += v.Star } } + if info != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Message: fmt.Sprintf("no found info id:%s", req.Oid), + } + return + } info.Star += stars if err = this.module.model.updateExclusive(session.GetUserId(), info); err != nil { errdata = &pb.ErrorData{