From 48d087d6df04ce43d09b2c5958a8c25afcb260c6 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Fri, 23 Feb 2024 17:20:36 +0800 Subject: [PATCH] by Robin at 202240223; fix --- app/mix/service/apiservice.go | 4 ++-- app/mix/service/utilservice.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 38e983bb..550bf769 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -1611,13 +1611,13 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))), ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created), TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created), + AuditedMedia: req.Moment.MediaComp, + AuditedText: req.Moment.Text, } if len(imageaudittasks) > 0 { - momentAuditTask.AuditedMedia = imageaudittasks[0].AuditedMedia momentAuditTask.ImageAuditTaskId = imageaudittasks[0].Id } if len(textaudittasks) > 0 { - momentAuditTask.AuditedText = textaudittasks[0].AuditedText momentAuditTask.TextAuditTaskId = textaudittasks[0].Id } if err := _DefaultMomentAuditTask.OpCreate(ctx, &moment_audit_taskproto.OpCreateReq{ diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 34c41323..6f6a1751 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -454,6 +454,9 @@ func (s *Service) utilFillIsThumbedUpFillable(ctx *gin.Context, visitorMid int64 } func (s *Service) utilFillImageAuditTaskVO(ctx *gin.Context, vo *imageaudittaskproto.ImageAuditTaskVO) error { + if vo == nil || vo.ImageAuditTask == nil { + return nil + } task := vo.ImageAuditTask if util.DerefInt64(task.IsFragmented) == 1 { imageaudits, err := _DefaultImageAudit.GetListByIds(ctx, util.DerefStringSlice(task.ImageAuditFragmentIds)) @@ -476,6 +479,9 @@ func (s *Service) utilFillImageAuditTaskVO(ctx *gin.Context, vo *imageaudittaskp } func (s *Service) utilFillTextAuditTaskVO(ctx *gin.Context, vo *textaudittaskproto.TextAuditTaskVO) error { + if vo == nil || vo.TextAuditTask == nil { + return nil + } task := vo.TextAuditTask textaudit, err := _DefaultTextAudit.OpList(ctx, &textauditproto.OpListReq{ Id: task.TextAuditId,