From 1b3de32c39a97618111ba0071b32603ac262c1f5 Mon Sep 17 00:00:00 2001 From: Robin <7434053+warrior_of_light_robin@user.noreply.gitee.com> Date: Thu, 21 Nov 2024 16:19:58 +0800 Subject: [PATCH] by Robin at 20241121 --- app/mix/service/apiservice.go | 23 ++++++++++++++++++++++- app/mix/service/utilservice.go | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 75770958..590d350b 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2472,6 +2472,10 @@ func (s *Service) ApiGetMomentListByIdsFromCreater(ctx *gin.Context, req *moment ec = errcode.ErrCodeZoneMomentSrvFail return } + momentIds := make([]string, 0) + for _, moment := range list { + momentIds = append(momentIds, fmt.Sprint(moment.GetId())) + } // 2.通过mid获取主播信息map ignoreMap := make(map[string]bool) @@ -2484,8 +2488,19 @@ func (s *Service) ApiGetMomentListByIdsFromCreater(ctx *gin.Context, req *moment } streamerExt := streamerExtMap[req.GetBaseRequest().Mid] + // 3.获取审核信息 + tasks, err := _DefaultMomentAuditTask.GetByMomentIds(ctx, momentIds) + if err != nil { + logger.Error("GetByMomentIds fail") + return + } + taskMp := make(map[string]*dbstruct.MomentAuditTask) + for _, task := range tasks { + taskMp[task.GetAssociativeTableId()] = task + } + volist = make([]*momentproto.ApiMomentVO, 0) - // 3.填充所有信息 + // 4.填充所有信息 for _, moment := range list { if moment.GetMid() != req.GetBaseRequest().Mid { volist, ec = make([]*momentproto.ApiMomentVO, 0), errcode.ErrCodeMomentNotHisOwn @@ -2496,6 +2511,12 @@ func (s *Service) ApiGetMomentListByIdsFromCreater(ctx *gin.Context, req *moment } // 主播信息 vo.CopyStreamerExt(streamerExt) + + // 填充审核信息 + vo.ImageAuditOpinion = taskMp[fmt.Sprint(vo.Moment.GetId())].GetImageAuditOpinion() + vo.TextAuditOpinion = taskMp[fmt.Sprint(vo.Moment.GetId())].GetTextAuditOpinion() + vo.ManuallyReviewOpinion = taskMp[fmt.Sprint(vo.Moment.GetId())].GetManuallyReviewOpinion() + volist = append(volist, vo) } diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index e4b3a8b3..0c80440b 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -276,7 +276,7 @@ func (s *Service) utilFillMomentsWithApiVOInfo(ctx *gin.Context, list []*dbstruc return } - // 4.获取审核信息1 + // 4.获取审核信息 tasks, err := _DefaultMomentAuditTask.GetByMomentIds(ctx, momentIds) if err != nil { logger.Error("GetByMomentIds fail")