Skip to content

Commit

Permalink
feat: add pagex get default empty order by
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectatorNan committed Jan 18, 2025
1 parent cb02250 commit ec9c414
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gormc/pagex/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const PageLimit = 20
type ListReq struct {
Page int `json:"page,optional,default=1" form:"page,optional,default=1"`
PageSize int `json:"pageSize,optional,default=10" form:"pageSize,optional,default=10"`
LastSize int `json:"listSize,optional,default=0" form:"listSize,optional,default=0"`
LastSize int `json:"lastSize,optional,default=0" form:"lastSize,optional,default=0"`
}

func (page *ListReq) Limit() int {
Expand All @@ -32,3 +32,10 @@ type OrderBy struct {
OrderKey string `json:"orderKey"`
Sort string `json:"sort"`
}

func EmptyOrderBy() OrderBy {
return OrderBy{
OrderKey: "",
Sort: "",
}
}

0 comments on commit ec9c414

Please sign in to comment.