paginator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 0 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPageSize = 10

DefaultPageSize 默认页大小

Functions

This section is empty.

Types

type Info

type Info struct {
	PageIndex int   `json:"pageIndex,omitempty"`
	PageSize  int   `json:"pageSize,omitempty"`
	Total     int64 `json:"total"`
}

Info 分页一些信息

type Page added in v0.3.3

type Page struct {
	List      interface{} `json:"list"`
	PageIndex int         `json:"pageIndex,omitempty"`
	PageSize  int         `json:"pageSize,omitempty"`
	Total     int64       `json:"total"`
}

Page 分页

type Pages added in v0.3.4

type Pages struct {
	Info
	List interface{} `json:"list"`
}

Pages 分页

type Param

type Param struct {
	PageIndex int `form:"pageIndex" json:"pageIndex"`
	PageSize  int `form:"pageSize" json:"pageSize"`
}

Param 分页查询参数

func DefaultParam

func DefaultParam() Param

DefaultParam 默认分页参数值

func (*Param) Inspect

func (sf *Param) Inspect(pageSize ...int) *Param

Inspect 校验分页查询参数有效性,非法值将设置为默认值, 默认分页索引: 第1页 默认分页大小: DefaultPageSize 可修改DefaultPageSize改变全局默认分页大小或传入参数

Jump to

Keyboard shortcuts

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