From f3f3c7633e2e9f00dd7c30c8df94409077ee2d1c Mon Sep 17 00:00:00 2001 From: Leufolium Date: Fri, 23 Feb 2024 20:48:51 +0800 Subject: [PATCH] by Robin at 20240223 --- api/proto/imageaudittask/proto/imageaudittask_op.go | 2 +- api/proto/textaudittask/proto/textaudittask_op.go | 2 +- app/mix/dao/mongo.go | 12 ++++++++---- app/mix/service/service.go | 6 ++++++ etc/mix/mix-prod.yaml | 3 ++- etc/mix/mix-test.yaml | 3 ++- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/api/proto/imageaudittask/proto/imageaudittask_op.go b/api/proto/imageaudittask/proto/imageaudittask_op.go index 05b3377f..6ebd5023 100644 --- a/api/proto/imageaudittask/proto/imageaudittask_op.go +++ b/api/proto/imageaudittask/proto/imageaudittask_op.go @@ -60,7 +60,7 @@ type OpListReq struct { Offset int `json:"offset"` Limit int `json:"limit"` Sort string - IsAligned *int64 + NotAlignedOpt int } type OpListData struct { diff --git a/api/proto/textaudittask/proto/textaudittask_op.go b/api/proto/textaudittask/proto/textaudittask_op.go index 97347f9f..1ddc2c07 100644 --- a/api/proto/textaudittask/proto/textaudittask_op.go +++ b/api/proto/textaudittask/proto/textaudittask_op.go @@ -60,7 +60,7 @@ type OpListReq struct { Offset int `json:"offset"` Limit int `json:"limit"` Sort string - IsAligned *int64 + NotAlignedOpt int64 } type OpListData struct { diff --git a/app/mix/dao/mongo.go b/app/mix/dao/mongo.go index d2f2dd87..f94155eb 100644 --- a/app/mix/dao/mongo.go +++ b/app/mix/dao/mongo.go @@ -2512,8 +2512,10 @@ func (m *Mongo) GetImageAuditTaskList(ctx *gin.Context, req *imageaudittaskproto if req.Status != nil { query["status"] = util.DerefInt64(req.Status) } - if req.IsAligned != nil { - query["is_aligned"] = util.DerefInt64(req.IsAligned) + if req.NotAlignedOpt != 0 { + query["is_aligned"] = qmgo.M{ + "$ne": consts.ImageAuditIsAligned_Yes, + } } sortClause := "-ct" if req.Sort != "" { @@ -2746,8 +2748,10 @@ func (m *Mongo) GetTextAuditTaskList(ctx *gin.Context, req *textaudittaskproto.O if req.Status != nil { query["status"] = util.DerefInt64(req.Status) } - if req.IsAligned != nil { - query["is_aligned"] = util.DerefInt64(req.IsAligned) + if req.NotAlignedOpt != 0 { + query["is_aligned"] = qmgo.M{ + "$ne": consts.TextAuditIsAligned_Yes, + } } sortClause := "-ct" if req.Sort != "" { diff --git a/app/mix/service/service.go b/app/mix/service/service.go index bb3e791a..7cfc54d2 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -2480,6 +2480,9 @@ func (s *Service) OpGetImageAuditTaskVOList(ctx *gin.Context, req *imageaudittas return } + // 仅查询未对齐的任务 + req.NotAlignedOpt = 1 + list, err := _DefaultImageAuditTask.OpList(ctx, req) if err != nil { logger.Error("OpGetImageAuditTaskListByMid fail, req: %v, err: %v", util.ToJson(req), err) @@ -2547,6 +2550,9 @@ func (s *Service) OpGetTextAuditTaskVOList(ctx *gin.Context, req *textaudittaskp return } + // 仅查询未对齐的任务 + req.NotAlignedOpt = 1 + list, err := _DefaultTextAuditTask.OpList(ctx, req) if err != nil { logger.Error("OpGetTextAuditTaskListByMid fail, req: %v, err: %v", util.ToJson(req), err) diff --git a/etc/mix/mix-prod.yaml b/etc/mix/mix-prod.yaml index dcde8188..4540a5d0 100644 --- a/etc/mix/mix-prod.yaml +++ b/etc/mix/mix-prod.yaml @@ -82,7 +82,8 @@ imageaudit: access_key_id: "LTAI5tD2Mg5mPUDQLPZZriPJ" access_key_secret: "IseIbk7fMbwy0eL33J2ro4Y55mWkn4" #scenes: "porn terrorism ad live logo" - scenes: "porn terrorism live logo" + #scenes: "porn terrorism live logo" + scenes: "porn terrorism live" task_buffer_size: 100 task_packet_size: 100 diff --git a/etc/mix/mix-test.yaml b/etc/mix/mix-test.yaml index 5f227eb6..5d24408e 100644 --- a/etc/mix/mix-test.yaml +++ b/etc/mix/mix-test.yaml @@ -81,7 +81,8 @@ imageaudit: access_key_id: "LTAI5tD2Mg5mPUDQLPZZriPJ" access_key_secret: "IseIbk7fMbwy0eL33J2ro4Y55mWkn4" #scenes: "porn terrorism ad live logo" - scenes: "porn terrorism live logo" + #scenes: "porn terrorism live logo" + scenes: "porn terrorism live" task_buffer_size: 100 task_packet_size: 100