pageInfo

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2024 License: AGPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// QueryCurrentPage - PageInfo
	QueryCurrentPage = "current_page"
	// QueryPageSize - PageInfo
	QueryPageSize = "page_size"
)

Functions

This section is empty.

Types

type Request

type Request struct {
	Current int64 `json:"current" bson:"current"`
	Size    int64 `json:"size" bson:"size"`
	Skip    int64 `json:"skip" bson:"skip"`
}

Request - PageInfo

func Parse

func Parse(r *http.Request) (*Request, *string)

Parse - PageInfo

func (*Request) ToPageInfo

func (pr *Request) ToPageInfo(totalCount int64) *Response

ToPageInfo - PageInfo

type Response

type Response struct {
	TotalPage   int64 `json:"total_page" bson:"total_page"`
	TotalCount  int64 `json:"total_count" bson:"total_count"`
	CurrentPage int64 `json:"current_page" bson:"current_page"`
	PageSize    int64 `json:"page_size" bson:"page_size"`
}

Response - PageInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL