added: pagination package
This commit is contained in:
parent
995ea60f34
commit
6ea5edb017
2 changed files with 57 additions and 0 deletions
22
pkg/pagination/dto.go
Normal file
22
pkg/pagination/dto.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package pagination
|
||||
|
||||
type QueryParams struct {
|
||||
Query string
|
||||
Page int
|
||||
Limit int
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Pagination Pagination `json:"pagination"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
type Pagination struct {
|
||||
Page int `json:"page"`
|
||||
PerPage int `json:"per_page"`
|
||||
Total int `json:"total"`
|
||||
TotalPages int `json:"total_pages"`
|
||||
HasNext bool `json:"has_next"`
|
||||
HasPrev bool `json:"has_prev"`
|
||||
OverallCount int `json:"overall_count,omitempty"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue