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 { type PermissionAllQuery struct {
Page int64 Page int64
Limit int64 Limit int64
Sort interface{}
} }
// Validate ... // Validate ...

View File

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

View File

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

View File

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

View File

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

View File

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