优化mongo,封装count逻辑,处理objectId
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user