diff --git a/model/user_request.go b/model/user_request.go index a99c314..d7a8435 100644 --- a/model/user_request.go +++ b/model/user_request.go @@ -5,6 +5,7 @@ import ( "github.com/Selly-Modules/logger" "github.com/Selly-Modules/usermngmt/internal" + "go.mongodb.org/mongo-driver/bson" ) // UserCreateOptions ... @@ -44,6 +45,7 @@ type UserAllQuery struct { Status string Sort interface{} Other map[string]interface{} // query fields in other object + Cond bson.M } // UserCountQuery ... diff --git a/user/handle.go b/user/handle.go index 3dd5083..05dceb2 100644 --- a/user/handle.go +++ b/user/handle.go @@ -157,6 +157,10 @@ func All(queryParams model.UserAllQuery) (r model.UserAll) { wg sync.WaitGroup cond = bson.M{} ) + if queryParams.Cond != nil { + cond = queryParams.Cond + } + query := model.CommonQuery{ Page: queryParams.Page, Limit: queryParams.Limit,