优化mongo,封装count逻辑,处理objectId

This commit is contained in:
2026-01-06 17:01:10 +08:00
parent a43da6e06e
commit 213ad95791
8 changed files with 123 additions and 91 deletions

View File

@@ -2,7 +2,6 @@ package controller
import (
"context"
"strings"
"gitee.com/red-future---jilin-g/common/log/model/dto"
"gitee.com/red-future---jilin-g/common/log/service"
@@ -32,13 +31,7 @@ func (c *operationLog) GetByID(ctx context.Context, req *dto.GetLogReq) (res *dt
// @Summary 查询操作日志列表
// @Description 根据多个条件查询操作日志列表
func (c *operationLog) List(ctx context.Context, req *dto.ListLogsReq) (res *dto.ListLogsResp, err error) {
// 处理排序字段
var sortFields []string
if req.SortFields != "" {
sortFields = strings.Split(req.SortFields, ",")
}
logs, total, err := service.OperationLog.List(ctx, req, sortFields...)
logs, total, err := service.OperationLog.List(ctx, req)
if err != nil {
return
}