From 697fb1aa8b31f1783a978c0867afa9bec7fdfdc9 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Wed, 20 Nov 2024 15:20:17 +0800 Subject: [PATCH] 1 --- app/mix/dao/mongo.go | 16 ++++++++++++++++ app/mix/service/apiservice.go | 2 +- app/mix/service/logic/moment_audit_task.go | 9 +++++++++ app/mix/service/service.go | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index e5511fad..58575635 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -4194,6 +4194,22 @@ func (m *Mongo) TryToFinishVideoModerationTaskOfMoment(ctx *gin.Context, task *d return &instance, nil } +func (m *Mongo) GetMomentAuditTaskListByIds(ctx *gin.Context, ids []int64) ([]*dbstruct.MomentAuditTask, error) { + list := make([]*dbstruct.MomentAuditTask, 0) + col := m.getColMomentAuditTask() + query := qmgo.M{ + "_id": qmgo.M{ + "$in": ids, + }, + } + err := col.Find(ctx, query).All(&list) + if err == qmgo.ErrNoSuchDocuments { + err = nil + return list, err + } + return list, err +} + // 联系客服对话表相关 func (m *Mongo) CreateContactCustomerServiceSession(ctx *gin.Context, contact_customer_service_session *dbstruct.ContactCustomerServiceSession) error { col := m.getColContactCustomerServiceSession() diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 952dc3a6..d157e264 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2205,7 +2205,7 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe // 封装动态审核任务 momentAuditTask := &dbstruct.MomentAuditTask{ - AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))), + AssociativeTableId: goproto.String(fmt.Sprint(req.Moment.GetId())), AuditedMedia: req.Moment.MediaComp, AuditedText: req.Moment.Text, Status: goproto.Int64(consts.MomentAudit_Created), diff --git a/app/mix/service/logic/moment_audit_task.go b/app/mix/service/logic/moment_audit_task.go index f9fe2aac..34bb3239 100644 --- a/app/mix/service/logic/moment_audit_task.go +++ b/app/mix/service/logic/moment_audit_task.go @@ -129,3 +129,12 @@ func (p *MomentAuditTask) TryToFinishVideoModerationTask(ctx *gin.Context, task } return instance.GetImageAuditTaskStatus() != consts.ImageAudit_Created && instance.GetTextAuditTaskStatus() != consts.TextAudit_Created, nil } + +func (p *MomentAuditTask) GetByIds(ctx *gin.Context, ids []int64) ([]*dbstruct.MomentAuditTask, error) { + list, err := p.store.GetMomentAuditTaskListByIds(ctx, ids) + if err != nil { + logger.Error("GetMomentAuditTaskListByIds fail, err: %v", err) + return make([]*dbstruct.MomentAuditTask, 0), err + } + return list, nil +} diff --git a/app/mix/service/service.go b/app/mix/service/service.go index c2a8a7ec..7a10907c 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -3486,7 +3486,7 @@ func (s *Service) OpGetMomentAuditTaskList(ctx *gin.Context, req *moment_audit_t return } - req.ManuallyReviewStatus = goproto.Int64(consts.MomentManuallyReview_Waiting) + // req.ManuallyReviewStatus = goproto.Int64(consts.MomentManuallyReview_Waiting) list, err := _DefaultMomentAuditTask.OpList(ctx, req) if err != nil { logger.Error("OpGetMomentAuditTaskList fail, req: %v, err: %v", util.ToJson(req), err)