update permissionAllMethod

This commit is contained in:
Hoang 2021-11-17 10:13:08 +07:00
parent b841ef7d8a
commit 72f30fce59
2 changed files with 9 additions and 6 deletions

View File

@ -25,9 +25,10 @@ type PermissionUpdateOptions struct {
// PermissionAllQuery ... // PermissionAllQuery ...
type PermissionAllQuery struct { type PermissionAllQuery struct {
Page int64 Page int64
Limit int64 Limit int64
Sort interface{} Sort interface{}
RoleID string
} }
// Validate ... // Validate ...

View File

@ -125,13 +125,15 @@ func All(queryParams model.PermissionAllQuery) (r model.PermissionAll) {
cond = bson.M{} cond = bson.M{}
) )
query := model.CommonQuery{ query := model.CommonQuery{
Page: queryParams.Page, Page: queryParams.Page,
Limit: queryParams.Limit, Limit: queryParams.Limit,
Sort: queryParams.Sort, Sort: queryParams.Sort,
RoleID: queryParams.RoleID,
} }
// Assign condition // Assign condition
query.SetDefaultLimit() query.SetDefaultLimit()
query.AssignRoleID(cond)
wg.Add(1) wg.Add(1)
go func() { go func() {