fix allQueryModel

This commit is contained in:
Hoang 2021-11-16 14:26:50 +07:00
parent 79b32fa209
commit 7753de40ef
6 changed files with 6 additions and 3 deletions

View File

@ -27,6 +27,7 @@ type PermissionUpdateOptions struct {
type PermissionAllQuery struct {
Page int64
Limit int64
Sort interface{}
}
// Validate ...

View File

@ -22,6 +22,7 @@ type RoleUpdateOptions struct {
type RoleAllQuery struct {
Page int64
Limit int64
Sort interface{}
}
// Validate ...

View File

@ -39,6 +39,7 @@ type UserAllQuery struct {
Keyword string
RoleID string
Status string
Sort interface{}
}
// Validate ...

View File

@ -104,7 +104,7 @@ func All(queryParams model.PermissionAllQuery) (r model.PermissionAll) {
query := model.CommonQuery{
Page: queryParams.Page,
Limit: queryParams.Limit,
Sort: bson.M{"createdAt": -1},
Sort: queryParams.Sort,
}
// Assign condition

View File

@ -102,7 +102,7 @@ func All(queryParams model.RoleAllQuery) (r model.RoleAll) {
query := model.CommonQuery{
Page: queryParams.Page,
Limit: queryParams.Limit,
Sort: bson.M{"createdAt": -1},
Sort: queryParams.Sort,
}
// Assign condition

View File

@ -87,7 +87,7 @@ func All(queryParams model.UserAllQuery) (r model.UserAll) {
Keyword: queryParams.Keyword,
RoleID: queryParams.RoleID,
Status: queryParams.Status,
Sort: bson.M{"createdAt": -1},
Sort: queryParams.Sort,
}
// Assign condition