This commit is contained in:
parent
8fcef422bb
commit
2e08c98384
|
@ -61,6 +61,7 @@ type OpListReq struct {
|
|||
Limit int `json:"limit"`
|
||||
Sort string
|
||||
NotAlignedOpt int
|
||||
IndexName string
|
||||
}
|
||||
|
||||
type OpListData struct {
|
||||
|
|
|
@ -3471,6 +3471,7 @@ func (m *Mongo) GetImageAuditTaskList(ctx *gin.Context, req *imageaudittaskproto
|
|||
if req.Sort != "" {
|
||||
sortClause = req.Sort
|
||||
}
|
||||
opt := options2.Find().SetHint(req.IndexName)
|
||||
err := col.Find(ctx, query).Sort(sortClause).Skip(int64(req.Offset)).Limit(int64(req.Limit)).All(&list)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
err = nil
|
||||
|
|
|
@ -3163,7 +3163,7 @@ func (s *Service) OpGetImageAuditTaskVOList(ctx *gin.Context, req *imageaudittas
|
|||
|
||||
// 仅查询未对齐的任务
|
||||
req.NotAlignedOpt = 1
|
||||
|
||||
req.IndexName = "idx_list" // 指定索引
|
||||
list, err := _DefaultImageAuditTask.OpList(ctx, req)
|
||||
if err != nil {
|
||||
logger.Error("OpGetImageAuditTaskListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
|
|
|
@ -33,9 +33,10 @@ func Run(batchId string) (successNum int, failNum int, err error) {
|
|||
|
||||
// 查询该批次所有审核任务
|
||||
imageaudittasks, err := _DefaultImageAuditTask.OpList(&gin.Context{}, &imageaudittaskproto.OpListReq{
|
||||
BatchId: goproto.String(batchId),
|
||||
Status: goproto.Int64(consts.ImageAudit_Created),
|
||||
Sort: "ct",
|
||||
BatchId: goproto.String(batchId),
|
||||
Status: goproto.Int64(consts.ImageAudit_Created),
|
||||
Sort: "ct",
|
||||
IndexName: "idx_batch_id",
|
||||
})
|
||||
if err != nil {
|
||||
logger.Info("_DefaultImageAuditTask OpList fail: %v", err)
|
||||
|
|
Loading…
Reference in New Issue