diff --git a/model/permission_request.go b/model/permission_request.go index fd59f60..ec3ed73 100644 --- a/model/permission_request.go +++ b/model/permission_request.go @@ -25,9 +25,10 @@ type PermissionUpdateOptions struct { // PermissionAllQuery ... type PermissionAllQuery struct { - Page int64 - Limit int64 - Sort interface{} + Page int64 + Limit int64 + Sort interface{} + RoleID string } // Validate ... diff --git a/permission/handle.go b/permission/handle.go index b17de7f..f04f53f 100644 --- a/permission/handle.go +++ b/permission/handle.go @@ -125,13 +125,15 @@ func All(queryParams model.PermissionAllQuery) (r model.PermissionAll) { cond = bson.M{} ) query := model.CommonQuery{ - Page: queryParams.Page, - Limit: queryParams.Limit, - Sort: queryParams.Sort, + Page: queryParams.Page, + Limit: queryParams.Limit, + Sort: queryParams.Sort, + RoleID: queryParams.RoleID, } // Assign condition query.SetDefaultLimit() + query.AssignRoleID(cond) wg.Add(1) go func() {