page

package
v0.0.0-...-0ee1bbb Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPageSize = 10

DefaultPageSize 默认分页大小

Variables

This section is empty.

Functions

func TotalPage

func TotalPage(totalCount int, pageSize int) int

TotalPage 总页数

Types

type Param

type Param struct {
	Page        int
	PageSize    int
	TableName   string
	Where       string
	WhereParams g.Slice
	Join        ParamJoin
	OrderBy     string
	Field       string
}

type ParamJoin

type ParamJoin []*ParamJoinItem

type ParamJoinItem

type ParamJoinItem struct {
	JoinType  string
	JoinTable string
	On        string
}

type Response

type Response struct {
	ListData   interface{} `json:"list_data"`
	TotalCount int         `json:"total_count"`
	Page       int         `json:"page"`
	PageSize   int         `json:"page_size"`
	TotalPage  int         `json:"total_page"`
	PageCount  int         `json:"page_count"`
}

func Data

func Data(r *ghttp.Request, param *Param, pointStruct interface{}) (pageRe *Response, err error)

Data 以model形式返回分页形式数据

Jump to

Keyboard shortcuts

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