by Robin at 20241121

This commit is contained in:
Robin 2024-11-21 16:19:58 +08:00
parent 660d636141
commit 1b3de32c39
2 changed files with 23 additions and 2 deletions

View File

@ -2472,6 +2472,10 @@ func (s *Service) ApiGetMomentListByIdsFromCreater(ctx *gin.Context, req *moment
ec = errcode.ErrCodeZoneMomentSrvFail ec = errcode.ErrCodeZoneMomentSrvFail
return return
} }
momentIds := make([]string, 0)
for _, moment := range list {
momentIds = append(momentIds, fmt.Sprint(moment.GetId()))
}
// 2.通过mid获取主播信息map // 2.通过mid获取主播信息map
ignoreMap := make(map[string]bool) ignoreMap := make(map[string]bool)
@ -2484,8 +2488,19 @@ func (s *Service) ApiGetMomentListByIdsFromCreater(ctx *gin.Context, req *moment
} }
streamerExt := streamerExtMap[req.GetBaseRequest().Mid] 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) volist = make([]*momentproto.ApiMomentVO, 0)
// 3.填充所有信息 // 4.填充所有信息
for _, moment := range list { for _, moment := range list {
if moment.GetMid() != req.GetBaseRequest().Mid { if moment.GetMid() != req.GetBaseRequest().Mid {
volist, ec = make([]*momentproto.ApiMomentVO, 0), errcode.ErrCodeMomentNotHisOwn 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.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) volist = append(volist, vo)
} }

View File

@ -276,7 +276,7 @@ func (s *Service) utilFillMomentsWithApiVOInfo(ctx *gin.Context, list []*dbstruc
return return
} }
// 4.获取审核信息1 // 4.获取审核信息
tasks, err := _DefaultMomentAuditTask.GetByMomentIds(ctx, momentIds) tasks, err := _DefaultMomentAuditTask.GetByMomentIds(ctx, momentIds)
if err != nil { if err != nil {
logger.Error("GetByMomentIds fail") logger.Error("GetByMomentIds fail")