Page Query
Definition
PageQuery
is a generic pagination query parameter structure designed to standardize common list query requirements such as pagination and sorting. PageQuery
has three fields, PageNumber
and PageSize
is used to build the paging clause, and Sort
is used to build the sorting clause. PageQuery
implements the Query
interface.
Usage
When defining query objects, embed the PageQuery
struct through composition to reuse standardized pagination and sorting functionality.
Paging
Sorting
The Sort
string should follow regexp.MustCompile("(?i)(\w+)(,(asC|dEsc))?;?")
Last updated
Was this helpful?