优化mongo,封装count逻辑,处理objectId
This commit is contained in:
@@ -229,9 +229,9 @@ const PageSize = 20
|
||||
|
||||
// Find 查询多条记录
|
||||
func (m *MongoDB) Find(ctx context.Context, filter bson.M, result interface{}, collection string, page *beans.Page, orderBy []beans.OrderBy) (total int64, err error) {
|
||||
//if err = utils.ValidStructPtr(result); err != nil {
|
||||
// return
|
||||
//}
|
||||
if err = utils.ValidStructPtr(result); err != nil {
|
||||
return
|
||||
}
|
||||
user, err := utils.GetUserInfo(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user